2013-03-14 79 views
1

我有问题让虚拟主机工作,因为我想。我一直在寻找最后的时间,但感觉我比以前更加迷失方向。设置与多个虚拟主机的Apache

所以基本上我想以下设置:

  1. http://test.localhost => d:\ XAMPP \ htdocs中\测试\网站
  2. http://test.localhost/call => d:\ XAMPP \ htdocs中\测试\背部\通话。 PL
  3. ,并可能添加其他东西一样/不管指向一些其他特等脚本

谁能给我一个提示?我一定错过了一些明显的...

回答

0

你试过编辑你的apache conf文件吗?

像这样的事情

# vi /usr/local/apache2/conf/extra/httpd-vhosts.conf 
NameVirtualHost *:80 

<VirtualHost *:80> 
ServerAdmin [email protected] 
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 [email protected] 
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> 
1

对于本地主机的子域,您必须是子域名添加到/ etc/hosts中

127.0.0.1  localhost  test.localhost