2013-07-29 168 views
1

我创建了一个虚拟主机/etc/apache2/site-available/mysite.local与此配置:虚拟主机无法正常工作

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    ServerName mysite.local 
    DocumentRoot /var/www/mysite 
    <Directory /> 
      Options FollowSymLinks 
      AllowOverride None 
    </Directory> 
    <Directory /var/www/mysite> 
      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> 
</VirtualHost> 

/etc/hosts

127.0.0.1 localhost 
127.0.1.3 mysite.local 

但是当我去mysite.local它显示localhost! 有什么问题?

+0

我也有问题,我想有些东西需要更改为主机文件 – asm234

回答

1

问题是根据重新加载apache2服务,我必须重新加载apache作为sudoer。

我必须使用sudo service apache2 reload而不是service apache2 reload

相关问题