我使用的xampp
1、修改C:WindowsSystem32driversetc中的hosts文件,添加127.0.0.1 www.feiquan.com
2、修改D:xamppapacheconfextra中的httpd-vhosts.conf,添加
<VirtualHost *:80> DocumentRoot "网站路径" ServerName www.feiquan.com ErrorLog "logs/www.feiquan.com-error.log" CustomLog "logs/www.feiquan.com-access.log" common </VirtualHost>
3. 配置D:xamppapacheconfhttpd.conf
3.1:将Listen 80给为Listen 自己的ip:80
3.2将Servername localhost:80改为 自己的ip:80
3.3在文件最后添加:
<Directory "网站路径"> AllowOverride None Options None Order allow,deny Allow from all </Directory>
3.4如果还不行 ,那可能还需要配置xamppapacheconfextrahttpd-xampp.conf中的httpd-xampp.conf
按3.3的方法,将Deny改为Allow
重启apache服务。