我在我的虚拟主机中设置了以下内容:
<VirtualHost app.pdf-edelivery.com>
ServerName app.pdf-edelivery.com
DocumentRoot /home/pdfedelivery/public_html/site
<Directory "/home/pdfedelivery/public_html/site/">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
前提是我想要将 app.pdf-edelivery.com 重定向到该site/
文件夹。这是我面临的问题。我认为存在某种冲突。如果您ping app.pdf-edelivery.com
将其解析为我服务器的正确 IP 地址。
在该记录上方大约 6 条记录(在 httpd.conf 文件中)有此记录:
<VirtualHost pdf-edelivery.net>
DocumentRoot /home/pdfedelivery/public_html
<Directory "/home/pdfedelivery/public_html">
allow from all
Options +Indexes
</Directory>
ServerAlias www.pdf-edelivery.net pdf-edelivery.net www.pdf-edelivery.com pdf-edelivery.com www.pdfedelivery.com pdfedelivery.com www.pdfedelivery.net pdfedelivery.net www.pdfedelivery.com.au pdfedelivery.com.au
</VirtualHost>
我担心这在某种程度上与上述记录相冲突。无论我重新启动 apache 多少次,我都无法让 app.pdf-edelivery.com 转到正确的网站(您目前可以在 pdf-edelivery.com/site/ 上看到)
知道我在这里遗漏了什么吗?
答案1
答案2
您应该尝试这个语法:
<VirtualHost xx.xx.xx.xx:80> # where xx.xx.xx.xx is the IP you want Apache listen to.
ServerName pdf-edelivery.net
ServerAlias www.pdf-edelivery.net pdf-edelivery.net www.pdf-edelivery.com pdf-edelivery.com www.pdfedelivery.com pdfedelivery.com www.pdfedelivery.net pdfedelivery.net www.pdfedelivery.com.au pdfedelivery.com.au
DocumentRoot /home/pdfedelivery/public_html
<Directory "/home/pdfedelivery/public_html">
allow from all
Options +Indexes
</Directory>
</VirtualHost>