不知何故,我的虚拟主机文件无法正常工作我不知道为什么 - 我敢打赌这只是我早安大脑中的一个邮件功能:p
现在,我通过指向 /etc/apache2/ 目录中可用站点的符号链接启用了两个站点,例如:
0 Nov 21 12:24 000-default -> ../sites-available/default
0 Nov 21 14:52 001-site -> ../sites-available/site
我的 VHosts 文件如下所示:
默认
<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 字节......我做错了什么?我敢打赌这是一件愚蠢而简单的事情......