Apache 和虚拟主机的问题

发布于 2025-01-17 03:04:40 字数 831 浏览 3 评论 0原文

我正在尝试在 Apache 服务器上运行 MediaWiki 和 Wordpress。我已经在 MediaWiki 站点上设置了几个子域虚拟主机,所以那里一切都很好。它安装在/var/www/html/mediawiki

我正在尝试将 WordPress 安装在它自己的目录 /var/www/wordpress 上。 在我的 WordPress 虚拟主机的配置文件中,我有:

   <VirtualHost *:80>
    ServerName domain.com
    ServerAdmin [email protected]
    DocumentRoot /var/www/wordpress
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<Directory /var/www/wordpress/>    AllowOverride All</Directory>

显然,domain.com 不是域。

然而,每当我访问domain.com时,它似乎都会从/var/www/html/mediawiki加载MediaWiki安装,这显然不是我想要的。

有人知道我在这里做错了什么吗?

I'm, trying to run both MediaWiki and Wordpress on an Apache server. I've got the MediaWiki site set up with a couple of sub-domain Virtual Hosts, so everything is fine there. This is installed at /var/www/html/mediawiki.

I'm trying to install Wordpress on it's own directory, /var/www/wordpress.
In my config file for Wordpress' virtual host, I've got:

   <VirtualHost *:80>
    ServerName domain.com
    ServerAdmin [email protected]
    DocumentRoot /var/www/wordpress
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<Directory /var/www/wordpress/>    AllowOverride All</Directory>

Obviously domain.com is not the domain.

Whenever I visit domain.com, however, it seems to be loading the MediaWiki install from /var/www/html/mediawiki, which is obviously not what I want.

Anyone got any ideas what I'm doing wrong here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

再浓的妆也掩不了殇 2025-01-24 03:04:40

运行 apachectl 以查看服务器上运行的所有服务器/虚拟主机端口 80 和 443

apachectl -S

另外我相信:

<Directory /var/www/wordpress/>    AllowOverride All</Directory>

应该位于您的虚拟主机块内

Run apachectl to see all the servers/vhosts running on your server both port 80 and 443

apachectl -S

Also I believe that:

<Directory /var/www/wordpress/>    AllowOverride All</Directory>

should be inside of your virtual host block

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文