具有多个 WordPress 博客的 Apache 虚拟主机
我正在使用 Linux 9.10 运行 VPS @ slicehost。到目前为止我已经有了基本的灯设置。我正在托管几个网站并添加六个网站,我希望几乎所有网站都可以使用文字新闻博客。
我尝试按照正常说明将 wordpress 安装到每个目录中,认为 apache 虚拟主机,因为它找到每个域,所以会扩展遵循每个域的 /blog/ 目录(我尝试将其保留为默认值 /wordpress/ ,但也没有结果)。当我将 WordPress 设置在 var/www 目录中时,WordPress 也安装并运行良好,我最初是在该目录中设置它的,后来才意识到每次安装只会托管一个站点。
我需要 WordPress 响应许多博客之一,该博客与它通过同一 LAMP 设置的虚拟主机提供的域相匹配。
如果这是布局问题,并且有更好的方法可以在带有虚拟主机的单个服务器灯设置上托管多个完全独立的 WordPress 博客,我也对此持开放态度。
预先感谢您提供的任何帮助。
我将密切关注此事,以便能够回答任何问题。
哦,另外,我已经制作了单独的 mysql Db's &每个博客的用户名用于将它们分开。
I'm running a VPS @ slicehost with Linux 9.10. I've got a basic Lamp setup so far. I am hosting a few sites and adding a half dozen more, and I'd like almost all of them to have word press blogs available.
I tried installing wordpress into each directory following the normal instructions thinking that apache virtual hosts, since it finds each domain, would by extension follow each domain's /blog/ directory(I've tried leaving it the default of /wordpress/ with no results either). WordPress also installed and worked fine when I set it up in the var/www directory where I originally set it up before realizing it would only host one site per installation.
I need wordpress to respond with one of many blogs which is matched to the domain it serves via virtual hosts off the same LAMP setup.
If this is a problem of layout, and there is a better way to host multiple, completely separate wordpress blogs on a single server lamp setup with virtual hosts, I'm open to that as well.
Thank you in advance for any assistance.
I'll be keeping an eye on this to be able to answer any questions.
Oh, Also, I've made separate mysql Db's & usernames for each blog to use to keep them compartmentalized.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需设置不同的 VirtualHost 目录并在每个目录中安装 WordPress。
虚拟主机的示例
在每个相应的 public_html 目录中放入 WordPress 安装。
因此,对于 site1.com,wordpress 可以放入 /srv/www/site1.com/public_html/wp
对于 site2.com /srv/www/site2.com/public_html/wp
这将使它们完全分开。
Simply set up different VirtualHost directories and put a wordpress installation in each.
Example of your virtualhosts
In each of the respective public_html directories put in a wordpress installation.
So for site1.com the wordpress can be put into /srv/www/site1.com/public_html/wp
For site2.com /srv/www/site2.com/public_html/wp
This will completely keep them seperate.
感谢您的回答。我不确定,但我认为这是我对不同目录所做的事情,并且它没有找到 WP 目录,即使 apache 找到了 exampleX.com 目录中每个站点的 index.html 。所以要明确的是,它加载 example1.com/index.html,但不加载 example1.com/wordpress/,即使 /wordpress/ 与 index.html 位于同一目录中(每个 index.html 都在内部标记以确保我我没有以某种方式指向错误的)。
我在 home/public_html/example1.com、home/public_html/example2.com 等之外提供服务。
启用站点中的虚拟主机文件指向 /home/user/public_html/ 作为文档根目录。
/srv/ 目录是重要的部分吗?我想我可以将指针设置到方便的地方?
我是否需要在启用站点的目录中更改除 000-default 之外的其他内容来指向?
--- 当我开始查看并思考它时,我去检查了我的虚拟主机文件。结果我把文档根目录一直写到/public,与/blog/处于同一级别,所以我将其备份到example1.com,并在index.html中使用转发href,让example1.com指向example1。 com/blog/index.html(指向 wp 的 index.php),这会带来著名的 5 分钟安装。这很有效,因为该网站只是一个博客。我将从每个 exampleX.com 中的 index.html 转发到每个 exampleX.com/public/ ,其余的一切都应该正常工作。
非常感谢您的帮助。
Thanks for the answer. I'm not sure, but I think this is what i've done with a different directory and it isn't finding the WP directory, even though apache finds the index.html for each site in the exampleX.com directories. So to be clear, It loads example1.com/index.html, but not example1.com/wordpress/ even though /wordpress/ is in the same directory as the index.html(each index.html is labeled internally to make sure i'm not pointing to the wrong one somehow).
I'm serving out of home/public_html/example1.com, home/public_html/example2.com, etc.
The virtual hosts file in sites-enabled points to /home/user/public_html/ as document root.
is the /srv/ directory the important part somehow? I thought I could set the pointers to essentially where ever was convenient?
Do I need to change something else other than 000-default in the sites-enabled directory to point?
--- as I started looking at this and thinking about it, I went and checked over my virtual hosts file. It turns out I wrote the document root all the way to /public, which is at the same level as /blog/ So I backed it up to example1.com with a forwarding href in index.html for example1.com pointed to example1.com/blog/index.html(which points to index.php for wp) which brings up the famous 5 minute installation. This works well since this site is only a blog. I'll just forward to each exampleX.com/public/ from an index.html in each exampleX.com for the rest and everything should be working fine.
Thank you very much for your help.