大家好!今天让小编来大家介绍下关于wamp设置的问题,以下是酷知号的小编对此问题的归纳整理,让我们一起来看看吧。
当安装好wamp后,windows右下角会出现wamp server的图标,如图所示!
当中集成了php开发的常用功能。
localhost:表示启动浏览器打开本地9游会首页
my projects:项目文件夹(目前没有任何作用)
phpmyadmin:mysql web管理工具。
apache:apache服务器管理相关内容,有版本管理,服务管理,模块管理,虚拟目录管理,配置文件,日志文件。
php:php相关管理,版本,设置和扩展。
mysql:mysql相关管理,版本,服务,mysql控制台,配置文件,日志。
webgrid:调试窗口
快速设置:启动、关闭、重启所有服务。
切换在线状态:是否能被外部访问,在线表示可以访问,离线表示只能被本机访问。
一、修改wamp默认的文本编辑器
1、在wamp根目录中打开wampmanager.conf文件。
将:
editor = “notepad.exe”
修改为:
editor = “c:program filesnotepad
otepad .exe”
然后保存,重新启动wamp。
二、配置wamp网站根目录。
1、首先在f:盘新建一个demo文件夹,用来存放网站代码。
2、修改apache的中httpd.conf中
修改:
documentroot “d:/php/wamp/www/” 为 documentroot “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
#
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
options indexes followsymlinks
allowoverride all
order allow,deny
allow from all
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
options indexes followsymlinks
allowoverride all
order allow,deny
allow from all
第4步,重启apache,就可以看到效果了
四、添加本地域名访问
1、修改httpd-vhosts.conf文件。
documentroot “d:phpwampwww est01”
servername test1.com
documentroot “d:phpwampwww est02”
servername test2.com
2、修改hosts文件
c:windowssystem32driversetchosts
添加:
127.0.0.1 test1.com
127.0.0.1 test2.com
在hosts中只能使用默认端口绑定域名,也就是只能绑定80端口,指定其他端口后就无法访问。
以上就是小编对于wamp设置问题和相关问题的解答了,wamp设置的问题希望对你有用!
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文链接:https://www.andon8.com/440329.html