第一次发布海报,但请大家帮忙。我一直在寻找,现在重新配置6天,失去了头发的几个团块..EC2上的多个虚拟主机ubuntu - 无法访问第二台主机,总是访问默认的
问题: 我希望我的Ubuntu的服务器上2台+虚拟主机(1个IP) 但是 - 只有第一个“字母”上市网站启用的节目。 000默认 www.domain1.com www.domain2.com
单独他们所有的工作(如果我a2dissite每个留1)
CONFIG: UBUNTU 10.10服务器 EC2实例(不要拍我对于这部分 - 希望这心不是问题) APACHE 2.2.16 DNS my.domain.com - 我的公开EC2 DNS(这工作)
虚拟主机:
默认
<VirtualHost *:80>
DocumentRoot "/home/www/"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>
<Directory /home/www>
Options Indexes Multiviews FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
LogLevel debug
ErrorLog /home/www/logs/error.log
CustomLog /home/www/logs/access.log "combined"
</VirtualHost>
虚拟主机1 - 域1
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName domain1.com
ServerAlias domain1.com www.domain1.com
# Indexes + Directory Root.
DirectoryIndex index.php
DocumentRoot "/home/www/www.domain1.com/"
# Directory directive
<Directory "/home/www/www.domain1.com">
Options Indexes Multiviews FollowSymLinks
AllowOverride none
Order allow,deny
Allow from all
</Directory>
# CGI Directory
ScriptAlias /cgi-bin/ /home/www/www.domain1.com/cgi-bin
<Location /cgi-bin>
Options +ExecCGI
</Location>
# Logfiles
LogLevel debug
ErrorLog "/home/www/www.domain1.com/logs/error.log"
CustomLog "/home/www/www.domain1.com/logs/access.log" combined
</VirtualHost>
我也有上述的另一个文档根域2具有不同的域名
符号链接到位: 我apache2ctl -St显示以下内容 - VirtualHost配置:
*:80 is a NameVirtualHost
default server (/etc/apache2/sites-enabled/000-default:4)
port 80 namevhost (/etc/apache2/sites-enabled/000-default:4)
port 80 namevhost domain1.com (/etc/apache2/sites-enabled/www.domain1.com:4)
port 80 namevhost www.domain2.com (/etc/apache2/sites-enabled/www.domain2.com:4)
Syntax OK
我ports.conf: 了NameVirtualHost *:80 听80种
<IfModule mod_ssl.c>
NameVirtualHost *.443
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
从默认到我的apache2.conf没有变化和httpd.conf文件是空的。
我曾尝试以下(约一百人):
[URL =“http://ubuntu-tutorials.com/2008/01/09/setting-up-name-based-virtual -hosting /“] [/ URL] [URL =”http://httpd.apache.org/docs/2.2/rewrite/vhosts.html“] http://httpd.apache.org/docs/2.2/rewrite /vhosts.html[/URL] [URL =“http://ubuntuforums.org/archive/index.php/t-1466665.html”] http://ubuntuforums.org/archive/index.php/t- 1466665.html [/ URL] [URL =“http://flurdy.com/docs/ec2/basics/index.html”] http://flurdy.com/docs/ec2/basics/index.html [/ URL] [URL =“http://www.webmasterworld.com/apache/3282118.htm”] http://www.webmasterworld.com/apache/3282118.htm [/ URL]
它似乎我已经尝试了所有其他人都有问题,但似乎没有解决我的问题。
可能性:
1)EC2
2)中的文件权限 - 我改变了一切为用户的Apache2 “WWW的数据” - 没有骰子。
3)我是一个涂料......让我们希望它和你们中的一位善良的人指出我的问题。 :)
即将开始聊天...生病会在这里失去我的头发。
问候,Logansanoh
看起来它可能与DNS有关。 现在尝试修复...让我们看看当缓存清除自己时会发生什么! – Logansanoh 2011-05-20 14:33:34
这个问题与ec2没有任何关系,它是你配置Apache的方式。 – Till 2011-05-22 23:48:34
我有完全相同的问题。我想知道如果主机名传递给Apache ...即,它只能区分命名虚拟主机,如果它收到名称。据我所知,它没有得到它,所以它选择第一个作为默认值。 – John 2011-05-27 21:30:55