apache 2.2.16 mysql 5.1.63 php5.3.3
apache配置了两个虚拟主机,位于sites-enabled
域名1:www.a.com 网站 2: www.b.com DZ论坛
A的配置文件
- 代碼: 選擇全部
<VirtualHost *:80> #此处我填写的是真实ip,现在换成*,隐私问题,下同上
ServerAdmin xiaoluoinc@gmail.com
ServerName www.A.com
DocumentRoot /home/wwwroot/public_html
<Directory /home/wwwroot/public_html/>
Options FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/octal/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/octal/access.log combined
</VirtualHost>
B的配置文件:
- 代碼: 選擇全部
<VirtualHost *:80>
ServerAdmin xiaoluoinc@gmail.com
ServerName www.B.com
DocumentRoot /home/apk/
<Directory /home/apk/>
Options FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/apk/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/apk/access.log combined
</VirtualHost>
问题:
访问A域名的时候正常,访问B的时候访问到的还是A的网页。
或者有时候反过来,访问A域名的时候,访问到的是论坛。
求解?