2013-02-06 54 views
0

運行兩個域這是我的httpd.conf文件一個VPS

NameVirtualHost *:80 

<VirtualHost *:80> 
DocumentRoot /var/www/joshhornby 
ServerName www.joshhornby.co.uk 
</VirtualHost> 

<VirtualHost *:80> 
DocumentRoot /var/www/designerschool 
ServerAlias www.designer-school.com 
</VirtualHost> 

如果你去joshhornby.co.uk然後你會看到,它需要你到正確的位置,並在現場與加載了out問題。去designer-school.com不加載正確的文件,而只是加載沒有樣式表的joshhornby.co.uk。

我哪裏錯了?兩個域都指向相同的DNS,並且DNS正在運行在同一臺服務器上。我正嘗試從VPS上運行兩個域。我曾試着用搜索引擎,並沒有什麼工作

回答

0
NameVirtualHost *:80 

<VirtualHost *:80> 
ServerName www.joshhornby.co.uk 
ServerAlias joshhornby.co.uk 
DocumentRoot /var/www/joshhornby 
ServerName www.joshhornby.co.uk</pre> 
<VirtualHost> 

<VirtualHost *:80> 
ServerName www.designer-school.com 
ServerAlias designer-school.com 
DocumentRoot /var/www/designerschool 
ServerAlias www.designer-school.com 
</VirtualHost> 
+0

這是錯誤resarting服務器時,我得到啓動httpd:httpd:/etc/httpd/conf/httpd.conf的第996行的語法錯誤:/etc/httpd/conf/httpd.conf:1001:未關閉。\ n/etc/httpd/conf/httpd .conf:996:未關閉。 – joshuahornby10

0

經過大量的試錯的我終於得到這個工作

了NameVirtualHost *:80

<VirtualHost *:80> 
ServerName joshhornby.com 
ServerAlias joshhornby.co.uk 
DocumentRoot /var/www/joshhornby 
ServerName www.joshhornby.co.uk 
</VirtualHost> 

<VirtualHost *:80> 
ServerName joshornby.com 
ServerAlias designer-school.com 
DocumentRoot /var/www/designerschool 
ServerAlias www.designer-school.com 
</VirtualHost>