2013-03-14 99 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