【问题标题】:Can't get to subsites. Wildcard-subdomains probably misconfigured in Apache无法访问子网站。通配符子域可能在 Apache 中配置错误
【发布时间】:2014-09-06 15:59:27
【问题描述】:

我正在为我工​​作的组织构建一个门户。

该门户是一个使用 Wampserver 2.5 的 Wordpress 站点,安装在 Win server 2008 R2 上。

感谢帮助和耐心的 RiggsFolly,它运行良好,并且可以通过 Intranet 从其他机器访问。

但现在,我已将其更改为站点网络,以便我可以为组织中的不同部门构建子门户。

在此更改期间,Wordpress 发出此警告消息:Warning! Wildcard DNS may not be configured correctly!

Wordpress 有一个页面解释如何在 Apache 上配置通配符子域 - http://codex.wordpress.org/Configuring_Wildcard_Subdomains

我尝试遵循它,但解释缺乏细节,我可能做错了什么。

在安装服务器和站点的机器上,当我在浏览器的地址栏中写http://hipo(hipo 是当前站点名称)时,我可以正常访问该站点。

但是当我写http://depa.hipo(depa是我成功创建的子站点)时,地址变成了http://www.depa.hipo/,浏览器说它没有在那个地址找到服务器。

我可能在 httpd-vhosts.conf 中设置了错误的 ServerAlias 行,而且我没有添加行 *.example.com A 192.0.43.10,或者在我的情况下是 *.hipo A <rightIP>,因为我不确定在哪里添加它文件。

这是我的 httpd-vhosts.conf 文件。感谢您的帮助!

 <VirtualHost *:80>
     DocumentRoot "c:/wamp/www/hipo"
     ServerName hipo
     <Directory  "c:/wamp/www/hipo">
        AllowOverride All
        Require all granted
     </Directory>
 </VirtualHost>

 <VirtualHost *:80>
     DocumentRoot "c:/wamp/www/hipo"
     ServerName subsites.hipo
     ServerAlias *.hipo
     <Directory  "c:/wamp/www/hipo">
        AllowOverride All
        Require all granted
     </Directory>
 </VirtualHost>

 <VirtualHost *:80>
     DocumentRoot "c:/wamp/www"
     ServerName localhost
     ServerAlias localhost
     <Directory  "c:/wamp/www">
        AllowOverride All
        Require all granted
     </Directory>
 </VirtualHost>

【问题讨论】:

  • 您不知道该怎么做的一点是让您的技术支持添加到公司 DNS。与您的技术人员聊天并让他们使用该通配符 DNS A 记录更新 DNS 服务器
  • 好的,他添加了记录,但是地址仍然在开头添加了www.,并说在那里找不到服务器。我的 httpd-vhosts.conf 文件一切正常吗?

标签: wordpress apache wildcard wampserver wildcard-subdomain


【解决方案1】:

此定义没有 ServerAlias,因此请尝试像这样添加一个:

<VirtualHost *:80>
     DocumentRoot "c:/wamp/www/hipo"
     ServerName hipo
     ServerAlias www.hipo
     <Directory  "c:/wamp/www/hipo">
        AllowOverride All
        Require all granted
     </Directory>
 </VirtualHost>

【讨论】:

  • 现在一切正常! RiggsFolly,再次感谢您的帮助和耐心。你确实救了我。
猜你喜欢
  • 1970-01-01
  • 2013-07-13
  • 2016-09-11
  • 2020-04-17
  • 2020-08-23
  • 2016-05-11
  • 1970-01-01
  • 1970-01-01
  • 2014-06-04
相关资源
最近更新 更多