gpt4 book ai didi

ubuntu - ubuntu 中的虚拟主机无法正常工作

转载 作者:太空宇宙 更新时间:2023-11-03 17:00:07 27 4
gpt4 key购买 nike

我使用以下配置在 /etc/apache2/site-available/mysite.local 中创建了一个虚拟主机:

<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 时,它显示 localhost!有什么问题吗?

最佳答案

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

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

关于ubuntu - ubuntu 中的虚拟主机无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17936026/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com