Apache 本地配置

来源:互联网 发布:阿里云的解决方案ppt 编辑:程序博客网 时间:2024/05/24 05:31


1.启用加载httpd-vhost.conf 

2.修改配置文件


可行方案1

listen 82NameVirtualHost *:82<VirtualHost *:82>    ServerAdmin webmaster@dummy-host2.example.com    DocumentRoot "I:\Develop\workspace"    ServerName dummy-host2.example.com    ErrorLog "logs/dummy-host2.example.com-error.log"    CustomLog "logs/dummy-host2.example.com-access.log" common   <Directory "I:\Develop\workspace">     Require all granted       </Directory> </VirtualHost>

可行方案2

listen 82NameVirtualHost localhost:82<VirtualHost localhost:82>    ServerAdmin webmaster@dummy-host2.example.com    DocumentRoot "I:\Develop\workspace"    ServerName dummy-host2.example.com    ErrorLog "logs/dummy-host2.example.com-error.log"    CustomLog "logs/dummy-host2.example.com-access.log" common   <Directory "I:\Develop\workspace">     Require all granted       </Directory> </VirtualHost>

可行方案3

listen 82NameVirtualHost ::1:82<VirtualHost ::1:82>    ServerAdmin webmaster@dummy-host2.example.com    DocumentRoot "I:\Develop\workspace"    ServerName dummy-host2.example.com    ErrorLog "logs/dummy-host2.example.com-error.log"    CustomLog "logs/dummy-host2.example.com-access.log" common   <Directory "I:\Develop\workspace">     Require all granted       </Directory> </VirtualHost>


失败方案

listen 82NameVirtualHost 127.0.0.1:82<VirtualHost 127.0.0.1:82>    ServerAdmin webmaster@dummy-host2.example.com    DocumentRoot "I:\Develop\workspace"    ServerName dummy-host2.example.com    ErrorLog "logs/dummy-host2.example.com-error.log"    CustomLog "logs/dummy-host2.example.com-access.log" common   <Directory "I:\Develop\workspace">     Require all granted       </Directory> </VirtualHost>






0 0