我遇到了让虚拟主机按照我的意愿工作的问题。我一直在寻找最后几个小时,但感觉我比以前更迷失。
所以基本上我想要以下设置:
有人能给我一个提示吗?我一定错过了一些明显的东西......
答案 0 :(得分:1)
对于localhost子域,您必须将该子域添加到/ etc / hosts
127.0.0.1 localhost test.localhost
答案 1 :(得分:0)
您是否尝试过编辑apache conf文件?
像这样的东西
# vi /usr/local/apache2/conf/extra/httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin ramesh@thegeekstuff.com
DocumentRoot "/usr/local/apache2/docs/thegeekstuff"
ServerName thegeekstuff.com
ServerAlias www.thegeekstuff.com
ErrorLog "logs/thegeekstuff/error_log"
CustomLog "logs/thegeekstuff/access_log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin ramesh@top5freeware.com
DocumentRoot "/usr/local/apache2/docs/top5freeware"
ServerName top5freeware.com
ServerAlias www.top5freeware.com
ErrorLog "logs/top5freeware/error_log"
CustomLog "logs/top5freeware/access_log" common
</VirtualHost>