一些虚拟主机文件出现了问题,我无法确定原因——可能是我的大脑还没有完全清醒。目前,我通过符号链接将/etc/apache2/目录下的sites available中的两个站点启用了。
0 Nov 21 12:24 000-default -> ../sites-available/default
0 Nov 21 14:52 001-site -> ../sites-available/site
我的虚拟主机文件如下:
默认
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName (the IP Address from my Server)
ServerAlias (the 2nd IP Address from my Server)
DocumentRoot /var/www/default
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/default>
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}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
站点
<VirtualHost *:80>
ServerAdmin myname@example.de
DocumentRoot /var/www/site/
ServerName jobbörse-köln.de
ServerAlias www.example.de ww.example.de w.example.de
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/site>
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}/site-error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/site-access.log combined
</VirtualHost>
不知怎么的,当我访问"example.de"时,我进入了默认目录而不是站点目录。 甚至日志文件也是如此:
site-error.log
site-access.log
停留在0字节......我做错了什么?我敢打赌这是一些愚蠢而简单的东西......