wampserver 使用小结,操作一:wamp 配置虚拟域名 操作二:wamp 127.0.0.1正常打开,localhost空白403/404
一、wamp 配置虚拟域名,自定义域名
1、d:\wamp\bin\apache\Apache2.2.17\conf\httpd.conf
(1)#Include conf/extra/httpd-vhosts.conf 去掉注释
(2)找到这段
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
改为
<Directory />
Options FollowSymLinks Includes
AllowOverride None
Order deny,allow
Allow from all
</Directory>
2、d:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "d:\wamp\www\文件夹"
ServerName 域名1(不用http)
ServerAlias 域名2 (不用http)
</VirtualHost>
3、C:\WINDOWS\system32\drivers\etc\hosts
底部添加记录: 127.0.0.1 你要设置的域名2(不用http)
只要文件夹下有文件,就可以通过设置的域名在浏览器访问。
二、wamp 127.0.0.1正常打开,localhost空白403/404
(1) d:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf添加记录
<VirtualHost *:80>
DocumentRoot "d:\wamp\www"
ServerName localhost
</VirtualHost>
(2)d:\wamp\bin\apache\Apache2.2.17\conf\httpd.conf
找到
Deny from all
Allow from 127.0.0.1
改为
#Deny from all
#Allow from 127.0.0.1
Allow from all
若还有问题,就查看一下 C:\WINDOWS\system32\drivers\etc\hosts 里面是否有该记录,没有自己添加: 127.0.0.1 localhost
同理,若想localhost\phpmyadmin正常访问:
D:\wamp\alias\phpmyadmin.conf
找到
Deny from all
Allow from 127.0.0.1
改为
#Deny from all
#Allow from 127.0.0.1
Allow from all
posted on 2018-08-01 00:18 longlongcheng 阅读(275) 评论(0) 编辑 收藏 举报