Я настраиваю веб-страницу на сервере, который запускает ubuntu 12.04.Конфигурация субдомена с использованием apache2 и виртуальных хостов
Я дезактивировал сайты по умолчанию (a2dissite default default-ssl), и я создал новый, тот, который мне нужен, и работающий, который будет субдоменом.
Imagine У меня есть 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 ...
Что я делаю неправильно?