apache开启虚拟主机功能与httpd-vhosts.conf 配置分享

首先,在httpd.conf下开启虚拟主机功能

找到配置项

# Virtual hosts                                                                                                         
#Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf  

 

修改为

# Virtual hosts                                                                                                         

Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf  


开发时,httpd-vhosts.conf可以参考如下配置

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "F:\workspace\vim\YNote\src"
    ServerName editor.fuyg.cn
    ServerAlias editor.fuyg.cn
    ErrorLog "logs/dummy-host.localhost-error.log"
    CustomLog "logs/dummy-host.localhost-access.log" combined
    <Directory "F:\workspace\vim\YNote\src">
        Options Indexes FollowSymLinks
        AllowOverride All 
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

你可能感兴趣的:(apache)