WampServer添加多站点
2013-04-16 22:47
232 查看
首页安装正常的WampServer,安装成功后能够正常运行。如下图:
下面第一步就是安装第二个apache服务
一、找到Apache2的htppd.conf文件.例如:我的wamp是安装在I盘的,我的就是I:\wamp\bin\apache\apache2.2.22\conf目录下。
二、复制httpd.conf,粘贴后在conf目录下后更名httpd2.conf(这里httpd2.conf是自定义的。)
三、用用编辑器打开httpd2.conf 找到如下几行代码 (不在一起的)
四、接下来就是安装服务了,
在桌面或其他地方新建个文本,贴入下面内容(注意目录)
然后我们在www2下放一个html文件来做测试,在浏览器中输入 http://localhost:8080 OK。服务正常。如果此时无法访问,可能是因为服务还没启动,在windows服务中会有个我们刚刚新增的名为www2服务,如下图,启动他即可正常访问8080地址了
第二步要做的就是用wamp控制台来控制新安装的服务
一、打开wamp目录,找到wampmanager.ini用编辑器打开
二、相关的修改
其实主要就是全部停止服务、全部启动服务、地址、目录几个配置,只要看到 Service: wampapache 之类的配置然后在下面再加行 Service: www2配置就可以了
在这里有个需要注意的就是在配置之前先前 wampmanager.tpl 改名,不然如果配置文件里的配置与 wampmanager.tpl 不相符的话会自动给覆盖掉。
下面的修改供参考:
更改完成后保存并重启wamp就可以了。下面是我改后的效果:
可以按此方法继续添加多个站点。
下面第一步就是安装第二个apache服务
一、找到Apache2的htppd.conf文件.例如:我的wamp是安装在I盘的,我的就是I:\wamp\bin\apache\apache2.2.22\conf目录下。
二、复制httpd.conf,粘贴后在conf目录下后更名httpd2.conf(这里httpd2.conf是自定义的。)
三、用用编辑器打开httpd2.conf 找到如下几行代码 (不在一起的)
Listen 80 ServerName localhost:80 DocumentRoot "i:/wamp/www/" <Directory "i:/wamp/www/">更改为
Listen 8080 //apache服务新监听的端口,可根据自己需要进行修改 ServerName localhost:8080 DocumentRoot "i:/wamp/www2/" //www2是我们第二个网站的目录 <Directory "i:/wamp/www2/">然后在i:/wamp下建一新文件夹为 www2
四、接下来就是安装服务了,
在桌面或其他地方新建个文本,贴入下面内容(注意目录)
cd /d i:\wamp\bin\apache\apache2.2.22\bin httpd.exe -k install -n "www2" -f "i:\wamp\bin\apache\apache2.2.22\conf\httpd2.conf"保存,然后将扩展后改成.bat,双击即可。
然后我们在www2下放一个html文件来做测试,在浏览器中输入 http://localhost:8080 OK。服务正常。如果此时无法访问,可能是因为服务还没启动,在windows服务中会有个我们刚刚新增的名为www2服务,如下图,启动他即可正常访问8080地址了
第二步要做的就是用wamp控制台来控制新安装的服务
一、打开wamp目录,找到wampmanager.ini用编辑器打开
二、相关的修改
其实主要就是全部停止服务、全部启动服务、地址、目录几个配置,只要看到 Service: wampapache 之类的配置然后在下面再加行 Service: www2配置就可以了
在这里有个需要注意的就是在配置之前先前 wampmanager.tpl 改名,不然如果配置文件里的配置与 wampmanager.tpl 不相符的话会自动给覆盖掉。
下面的修改供参考:
[Services] Name: wampapache Name: wampmysqld Name: www2 [StartupAction] ;WAMPSTARTUPACTIONSTART Action: run; FileName: "i:/wamp/bin/php/php5.3.13/php-win.exe";Parameters: "refresh.php";WorkingDir: "i:/wamp/scripts"; Flags: waituntilterminated Action: resetservices Action: readconfig; Action: service; Service: wampapache; ServiceAction: startresume; Flags: ignoreerrors Action: service; Service: wampmysqld; ServiceAction: startresume; Flags: ignoreerrors Action: service; Service: www2; ServiceAction: startresume; Flags: ignoreerrors ;WAMPSTARTUPACTIONEND [Menu.Left] ;WAMPMENULEFTSTART Type: separator; Caption: "Powered by Alter Way" Type: item; Caption: "Localhost"; Action: run; FileName: "C:\Program Files\Google\Chrome\Application\chrome.exe"; Parameters: "http://localhost/"; Glyph: 5 Type: item; Caption: "Localhost 8080"; Action: run; FileName: "C:\Program Files\Google\Chrome\Application\chrome.exe"; Parameters: "http://localhost:8080/"; Glyph: 5 Type: item; Caption: "phpMyAdmin"; Action: run; FileName: "C:\Program Files\Google\Chrome\Application\chrome.exe"; Parameters: "http://localhost/phpmyadmin/"; Glyph: 5 Type: item; Caption: "www directory"; Action: shellexecute; FileName: "i:/wamp/www"; Glyph: 2 Type: item; Caption: "www2 directory"; Action: shellexecute; FileName: "i:/wamp/www2"; Glyph: 2 [StartAll] ;WAMPSTARTALLSTART Action: service; Service: wampapache; ServiceAction: startresume; Flags: ignoreerrors Action: service; Service: wampmysqld; ServiceAction: startresume; Flags: ignoreerrors Action: service; Service: www2; ServiceAction: startresume; Flags: ignoreerrors [StopAll] ;WAMPSTOPALLSTART Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors Action: service; Service: wampmysqld; ServiceAction: stop; Flags: ignoreerrors Action: service; Service: www2; ServiceAction: stop; Flags: ignoreerrors [RestartAll] ;WAMPRESTARTALLSTART Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors waituntilterminated Action: service; Service: wampmysqld; ServiceAction: stop; Flags: ignoreerrors waituntilterminated Action: service; Service: www2; ServiceAction: stop; Flags: ignoreerrors waituntilterminated Action: service; Service: wampapache; ServiceAction: startresume; Flags: ignoreerrors waituntilterminated Action: service; Service: wampmysqld; ServiceAction: startresume; Flags: ignoreerrors waituntilterminated Action: service; Service: www2; ServiceAction: startresume; Flags: ignoreerrors waituntilterminated [myexit] ;WAMPMYEXITSTART Action: service; Service: wampapache; ServiceAction: stop; Flags: ignoreerrors Action: service; Service: wampmysqld; ServiceAction: stop; Flags: ignoreerrors Action: service; Service: www2; ServiceAction: stop; Flags: ignoreerrors Action: exit
更改完成后保存并重启wamp就可以了。下面是我改后的效果:
可以按此方法继续添加多个站点。
相关文章推荐
- WampServer添加多站点并设置特定ip访问
- WampServer添加多站点
- WampServer添加多站点
- 在DNN站点中加上Tabs效果,并实现在tab中添加模块
- 添加一个站点,里面可能有多个程序,没有转换为应用程序而报错
- 添加信息站点及将指定IP添加到本地Intranet中
- Javascript 注册表添加IE信任站点及启用Activex控件详解
- PHP学习总结(11)——PHP入门篇之WAMPServer多站点配置
- C#为IE添加可信任站点
- 添加IIS FTP站点密码
- wampserver配置多站点
- wampserver配置多个站点
- 在您的站点上添加 Windows Live Favourites 收藏入口
- 修改注册表添加IE信任站点及启用Activex控件
- 在js中添加信任站点,禁用xinxp弹出窗口阻止程序,修改IE ActiveX安全设置
- WAMPServer集成开发之多站点配置
- 在WSS 3.0中为站点设置菜单添加一个Feature(翻译)
- IE添加信任站点并设置允许ActiveX控件的VBS脚本
- JS添加可信站点、修改ActiveX安全设置,禁用弹出窗口阻止程序的方法
- JS添加可信站点、修改ActiveX安全设置,禁用弹出窗口阻止程序的方法