WAMP设置
当安装好WAMP后,windows右下角会出现WAMP Server的图标,如图所示!

当中集成了PHP开发的常用功能。
Localhost:表示启动浏览器打开本地首页
My Projects:项目文件夹(目前没有任何作用)
phpMyAdmin:MySql Web管理工具。
Apache:Apache服务器管理相关内容,有版本管理,服务管理,模块管理,虚拟目录管理,配置文件,日志文件。
PHP:PHP相关管理,版本,设置和扩展。
MySQL:MySQL相关管理,版本,服务,MySql控制台,配置文件,日志。
WebGrid:调试窗口
快速设置:启动、关闭、重启所有服务。
切换在线状态:是否能被外部访问,在线表示可以访问,离线表示只能被本机访问。
一、修改WAMP默认的文本编辑器
1、在WAMP根目录中打开wampmanager.conf文件。
将:
editor = "notepad.exe"
修改为:
editor = "C:\Program Files\Notepad++\notepad++.exe"
然后保存,重新启动WAMP。
二、配置WAMP网站根目录。
1、首先在F:盘新建一个Demo文件夹,用来存放网站代码。
2、修改Apache的中httpd.conf中
修改:
DocumentRoot "D:/php/wamp/www/" 为 DocumentRoot "F:/Demo/"
<Directory "D:/php/wamp/www/"> 为 <Directory "F:/Demo/">
注意:所有配置文件修改后,都必须重新启动服务。
这时Apache中的文件就已经修改完成,就可以通过localhost访问F:/Demo中的文件了。
但是WAMP菜单中的www目录还没有改变,如果需要改变WAMP菜单中的目录,还需要修改WAMP安装目录下的wampmanager.ini和wampmanager.tpl文件。
3、修改wampmanager.ini文件。
搜索"menu.left";将
Type: item; Caption: "www 目录"; Action: shellexecute; FileName: "D:/php/wamp/www"; Glyph: 2
修改为:
Type: item; Caption: "Demo目录"; Action: shellexecute; FileName: "F:/Demo"; Glyph: 2
4、修改wampmanager.tpl文件
搜索"menu.left";将:
Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "${wwwDir}"; Glyph: 2
修改为:
Type: item; Caption: "Demo目录"; Action: shellexecute; FileName: "F:/Demo"; Glyph: 2
修改后重新启动WAMP。
三、WAMP多站点的配置
第1步,修改httpd.conf,增加8080端口的监听
#Listen 12.34.56.78:80
Listen 80
Listen 8080
第2步,修改virtual hosts的配置,同样在httpd.conf这个文件中。
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
#修改为
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
第3步,增加虚拟主机配置,修改httpd-vhosts.conf文件。
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
NameVirtualHost *:8080
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "C:/wamp/www/"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
<Directory "C:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:8080>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "C:/wamp/www2/"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
<Directory "C:/wamp/www2/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
第4步,重启apache,就可以看到效果了
四、添加本地域名访问
1、修改httpd-vhosts.conf文件。
<VirtualHost *:80>
DocumentRoot "D:\php\wamp\www\test01"
ServerName test1.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:\php\wamp\www\test02"
ServerName test2.com
</VirtualHost>
2、修改hosts文件
C:\Windows\System32\drivers\etc\hosts
添加:
127.0.0.1 test1.com
127.0.0.1 test2.com
在hosts中只能使用默认端口绑定域名,也就是只能绑定80端口,指定其他端口后就无法访问。
WAMP设置的更多相关文章
- wamp设置本地访问路径为a.com
我们在用wamp进行本地建站时经常会碰到页面样式无法正常加载,这是因为没有正确加载css路径,那我们就用wamp设置本地访问路径为a.com指向本地的一个虚拟空间,如何操作呢?下面就跟随ytkah一起 ...
- wamp设置自定义域名访问php网站
wamp是一个在window系统下很不错的php开发套件,一般我都是使用此套件在本地进行开发和测试的 特别是alias功能特别好,可以同时开发N个php网站而不互相影响 但alias有一个问题,它其实 ...
- Wamp设置虚拟目录
1. 默认安装 wamp后,工作目录为"..../wamp/www" 也就是PHP文件只有放在此目录下才能打得开,打开Apache的配置文件httpd.conf可以看到: 这么两行 ...
- wamp设置mysql默认编码
来自:http://www.cnsecer.com/5984.html wamp下MySQL的默认编码是Latin1,不支持中文,要支持中文的话需要把数据库的默认编码修改为gbk或者utf8. 这里推 ...
- wamp设置实现本机IP或者局域网访问 (转)
<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Allow from all #以前是De ...
- wamp设置实现本机IP或者局域网访问
在 httpd.conf 中查找 Allow from 127.0.0.1 Order Deny,Allow Deny from all Allow from 127.0.0.1 在此下面加上 All ...
- Wamp 设置 www 目录
打开httpd.conf,搜索wwwroot 和 directory 直接改为新目录即可. 对于wamp3是无效的,可以这样解决: “You need to change these values a ...
- WAMP设置默认访问目录
打开httpd.conf 1.修改:DocumentRoot "F:/Project/Php" 2.修改 <Directory "F:/Project/Php&qu ...
- wamp配置虚拟主机
================================================================= 来源参考一:http://wenku.baidu.com/link? ...
随机推荐
- .com和.cn域名的区别所在,各个域名后缀含义
很多人在注册域名的时候不明白域名后缀的含义,在这里就介绍两种最为常用的域名,介绍下他们的区别以及适用的范围.需要先查询是否被注册,我们经常去的就是西部数据和万网,查询并注册未被注册的域名,一般无论是什 ...
- Kali安装到移动硬盘或者U盘中~Linux系通用方法(包括Android)
0.1.保证这个服务必须启动(虚拟机服务最好都启动) 0.2.看看U盘接口类型是否对应 1.安装第一步 2.安装第二步,选择kali镜像 3.设置存放位置(上面的名字无所谓,最后不会用它的,虚拟机只是 ...
- python urllib2 常见请求方式
GET 添加headers头import urllib2 request = urllib2.Request(uri) request.add_header('User-Agent', 'fake-c ...
- Appium+python自动化21-DesiredCapabilities详解【转载】
Appium Desired Capabilities Desired Capabilities 是由 keys 和 values 组成的 JSON 对象. 举个简单例子: { "platf ...
- postman的使用(转载)
Postman介绍 Postman是google开发的一款功能强大的网页调试与发送网页HTTP请求,并能运行测试用例的的Chrome插件.其主要功能包括: 模拟各种HTTP requests 从常用的 ...
- Laravel 项目使用 Carbon 人性化显示文章发表时间
比如说有这样一个需求:一篇文章的发表时间: **距离现在时间** **显示格式** < 1小时 xx分钟前 1小时-24小时 xx小时前 1天-10天 xx天前 >10天 直接显示日期 针 ...
- android 错误
问题1 手机开发者选项 开启USB安装 问题2 怎么变成了两行 问题3 运行虚拟机报错 电脑没有启用虚拟技术或者没有安装Intel HAXM软件 sdk下找到 (或者官网下载 https://soft ...
- Codeforces Round #320 (Div. 2) [Bayan Thanks-Round] A. Raising Bacteria【位运算/二进制拆分/细胞繁殖,每天倍增】
A. Raising Bacteria time limit per test 1 second memory limit per test 256 megabytes input standard ...
- mysql查询含有指定字段的所有表
SELECT * FROM information_schema.columns WHERE column_name='userId'; TABLE_SCHEMA字段为db的名称(所属的数据库),字段 ...
- springMVC笔记:@ResponseBody
使用@ResponseBody的方式,将Map形返回值转为json,用作POST请求的返回值.为了解决406 Not Acceptable错误,需要检查以下几项: 1. 依赖包中包含jackson-m ...