我从linux迁移到了mac。我有Apache和php设置。
现在apache似乎只加载列出的第一个虚拟主机。它也只能通过本地主机而不是网站名称在浏览器中加载它。它已经有3天的时间在网上搜索或解决方案似乎没什么用。
现在,如果我为虚拟主机制作文档根目录,例如。 / Library / WebServer / Documents /然后它的工作原理。如果我添加额外的目录,它会失败,例如。 /Library/WebServer/Documents/livingahimsa.co.uk
这是配置:(我已经尝试了带引号的doc root和
)##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
127.0.0.1 ahimsainvestments.com
127.0.0.1 livingahimsa.co.uk
127.0.0.1 ahimsavillage.com
255.255.255.255 broadcasthost
::1 localhost
和vhost:
<VirtualHost *:80>
DocumentRoot /Library/WebServer/Documents/ahimsainvestments.com
ServerName ahimsainvestments.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /Library/WebServer/Documents/livingahimsa.co.uk
ServerName livingahimsa.co.uk
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /Library/WebServer/Documents/ahimsavillage.com
ServerName ahimsavillage.com
pache2 / httpd.conf中