在Ubuntu虚拟主机无法正常工作 [英] virtual host in ubuntu not work
本文介绍了在Ubuntu虚拟主机无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了 /etc/apache2/site-available/mysite.local
虚拟主机这个配置:
I created a virtual host in /etc/apache2/site-available/mysite.local
with this config:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
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
它显示了本地主机
!
有什么问题?
but when i go to mysite.local
it shows localhost
!
what's the problem?
推荐答案
问题根据重装的Apache2服务,我必须重新加载Apache作为sudoer。是
the problem is according to reloading apache2 service, I must reload apache as a sudoer.
我必须使用须藤服务的Apache2重装
而不是服务的Apache2重装
。
这篇关于在Ubuntu虚拟主机无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文