WAMP多站点配置,更改服务器端口

修改apache.conf的配置文件 设置保存路径
原本的路径:DocumentRoot "D:/wamp/www/"
修改为自己定义的路径:D:\all_code\php
 
查询:
<Directory "D:\all_code\php">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
 路径也需要一起修改为自定义的路径D:\all_code\php
 
 
不同的版本需要多配置
这样还不够:
Wampmanager.ini
搜索栏查询 Menu.left
 
多站点的配置(至少两个)
 
配置站点需要找到 apache的虚拟配置文件
路径:D:\wamp\bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf
 
 
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:\all_code\php\demo01"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
 
蓝色为修改
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:\all_code\php\demo01"
    ServerName test02.com
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
 
但是这样还不够!
最后需要去配置apache.conf配置文件, 默认是关闭的
 查找关键字
httpd-vhost
 
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf(打开)
 
还有apache默认不拒绝其他机子访问本机子上的目录文件, 所以也需要开启
 

 
 
最后需要去配置下C:
C:\Windows\System32\drivers\etc
127.0.0.1      test01.com
127.0.0.1      test02.com
 
 
有时候端口号被占用需要更改端口号
Listen 0.0.0.0:80
 
ServerName localhost:80
 
更改造和处就可以了
 
Ok大工搞成, !

  

posted @ 2015-01-14 14:20  初入程序猿  阅读(287)  评论(0编辑  收藏  举报