0
我在运行ubuntu 12.04的服务器中设置了一个网页。使用apache2和虚拟主机的子域配置
我已经停用了默认网站(a2dissite default default-ssl),并且我已经创建了一个新的,我需要和工作的那个将是一个子域。
想象我有foo.com。 我的目标是,foo.com抛出一个403 HTTP错误和sub.foo.com呈现网页,我需要。 我的虚拟主机是这个样子:
foo.com(默认)
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName foo.com
DocumentRoot /var/www/default
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/default/>
Options Indexes 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}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
sub.foo.com
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName sub.foo.com
DocumentRoot /var/www/sub
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/sub/>
Options Indexes 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}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
当我访问sub.foo.com显示页面。 当我访问foo.com时,同一页面显示(:S),我需要在这里403 ...
我在做什么错?