Heim >Backend-Entwicklung >PHP-Tutorial >关于apache虚拟域名的设置

关于apache虚拟域名的设置

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-28 08:29:341235Durchsuche

设置虚拟域名

1.修改hosts文件,目录:C:\Windows\System32\drivers\etc,添加,例

localhost doma.com

2.修改httpd.conf文件

<directory></directory>
    AllowOverride none
    Require all denied
<directory></directory>
    #AllowOverride none
    #Require all denied

   AllowOverride all
    Order deny,allow
    Allow from all

3.修改https-vhosts.conf文件,添加,例
<virtualhost>
    ServerAdmin doma.com
    DocumentRoot "c:/wamp/www/doma"
    ServerName doma.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error.log"
    CustomLog "logs/dummy-host.example.com-access.log" common
</virtualhost>
重启apache服务,访问域名doma.com,成功

但是,出现了问题,访问localhost,或者其他目录报错

403 Forbidden You don't have permission to access / on this server
404 Forbidden The requested URL  was not found on this server
无法决绝该错误,删除原有修改,重启服务器,上述错误仍然存在,无法理解

需要血钙https-vhosts.cong文件,将其中的

<virtualhost>
  ...
</virtualhost>
全部注释,修改httpd.cong文件,

<directory></directory>
    #AllowOverride none
    #Require all denied

    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order deny,allow
    Allow from all

问题解决,虚拟域名设置失败,有待思考解决

以上就介绍了 关于apache虚拟域名的设置,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:Nginx 安装配置Nächster Artikel:解决Zip PHP extension is not installed