这是我的httpd.conf文件
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然后你会看到它带你到正确的位置,网站加载出问题。去designer-school.com不会加载正确的文件而只是加载没有样式表的joshhornby.co.uk。
我哪里错了?两个域都指向相同的DNS,并且DNS在同一服务器上运行。我试图在VPS上运行两个域。我试过谷歌搜索,没有任何工作
答案 0 :(得分: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>
答案 1 :(得分: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>