apache 配置不同的埠訪問不同的站點

2021-07-24 20:41:31 字數 1482 閱讀 6653

科技優家

2016-11-15 20:05

找到「d:\apache\conf」的「httpd.conf」

去掉#號,修改為:

效果圖:

找到「d:\apache\conf\extra」的「httpd-vhosts.conf」

serveradmin [email protected]

documentroot "d:/www"

servername dummy-host.onestopweb.cn

serveralias www.dummy-host.onestopweb.cn

errorlog "logs/dummy-host.onestopweb.cn-error.log"

customlog "logs/dummy-host.onestopweb.cn-access.log" common

serveradmin [email protected]

documentroot "d:/www"

servername dummy-host2.onestopweb.cn

errorlog "logs/dummy-host2.onestopweb.cn-error.log"

customlog "logs/dummy-host2.onestopweb.cn-access.log" common

listen 81

serveradmin [email protected]

documentroot "d:/www2"

servername localhost:81

errorlog "logs/dummy-host.localhost-error.log"

customlog "logs/dummy-host.localhost-access.log" common

options indexes followsymlinks

allowoverride all

order allow,deny

allow from all

效果圖:

通過81埠開啟本地站點:

apache 多埠訪問 配置

使用本地ip 埠號,或者修改hosts檔案 網域名稱的方法來進行本地多站點web除錯。注意這裡是用apache 不是iis 2 修改本機的hosts檔案,如下 示例 127.0.0.1 localhost 127.0.0.1 url www.dede.com url 127.0.0.1 url ww...

Apache多埠配置

virtual hosts include conf extratpd vhosts.conf開啟 virtual hosts include conf extratpd vhosts.conf開啟extratpd vhosts.conf 新增 配置 serveradmin webmaster du...

Apache配置多埠

1 修改apache conf httpd.config檔案,增加listen 2 修改apache conf httpd.config檔案,增加servername 3 修改apache conf httpd.config檔案,開啟虛擬主機 4 修改apache conf extra httpd ...