无法使用Apache 2.2在VPS上添加第二个网站(多个域)

时间:2012-04-24 10:14:15

标签: apache2

我有一个VPS网站(www.domain1.com)顺利运行(Ubuntu 10.04,Apache 2.2,RoR,Passenger,mysql)。我现在需要运行第二个网站(www.domain2.com)。但是在完成所有设置后,网站不会显示。

我在apache2 / sites-enabled / domain2.com中添加了

<VirtualHost *:80>

  ServerAdmin email@test.com
  ServerName  www.domain2.com
  ServerAlias domain2.com

  DirectoryIndex index.html
  DocumentRoot /home/user/public_html/domain2.com/current/public

  LogLevel debug
  ErrorLog  /home/user/public_html/domain2.com/current/log/error.log
  CustomLog /home/user/public_html/domain2.com/current/log/access.log combined

</VirtualHost>

这与domain1基本相同,只是域名不同。 domain2的代码位于/home/user/public_html/domain2.com/current /

httpd.conf是空的(我认为这对Apache 2.2来说没问题),apache2.conf的相关部分是:

ServerRoot "/etc/apache2"

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

ServerName 23.42.74.241

LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.9
PassengerRuby /usr/local/bin/ruby

PassengerDefaultUser user

/etc/apache2/conf.d/servername.conf是:

ServerName general

我不确定这个名字(“一般”)是否相关......

在sudo /etc/init.d/apache2重新启动后,domain1.com仍然完美运行,而domain2则没有。对于domain1和domain2,DNS设置是相同的,测试为domain2提供了正确的DNS服务器。使用www.dns-info.cz的唯一错误是:

出席区内的NS记录(info)错误 虽然至少有一个名称服务器返回此域名的权威数据,但该区域不包含任何NS记录。该区域必须包含与父服务器相同的NS记录。

我不确定此错误是否与问题直接相关,这仅供您参考。有人知道如何解决这个问题吗?

0 个答案:

没有答案