第一次發佈海報,但請大家幫忙。我一直在尋找,現在重新配置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