我在想我是不是做错了什么?我正在尝试为我的网页创建一个虚拟主机。我的默认 apache 配置如下/etc/apache2/sites-available
:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www>
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>
以及我自己的虚拟主机配置文件/etc/apache2/sites-available
:
<VirtualHost *:80>
DocumentRoot /var/www/mywebpage
ServerName aaa.bbb.cc
ServerAlias www.aaa.bbb.cc
</VirtualHost>
我得到的只是 Apache 的默认页面http://aaa.bbb.cc
答案1
您必须创建到 /etc/apache2/sites-enabled 的链接并重新加载服务器。
ln -s /etc/apache2/sites-available/myownvirtualhost.conf /etc/apache2/sites-enabled/myownvirtualhost.conf
service apache2 restart