Appserv本机多端口配置文件一例

发布时间:2020-10-02编辑:脚本学堂
Appserv在本机配置多端口网站的配置文件一例,供大家学习参考。

1、在conf/httpd.conf中将2个虚拟主机启动的注释符号#去掉。
2、在extra/ httpd-vhosts.conf中,先将2个NameVirtualHost,再将2个端口的指向即可。

附,httpd-vhosts.conf文件

复制代码 代码示例:

#
# Virtual Hosts
#
# Use name-based virtual hosting.
#
NameVirtualHost *:81
NameVirtualHost *:82
#
# 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 *:81>
         ServerAdmin test@www.jb200.com
         DocumentRoot D:/AppServ/www
         ServerName www.jb200.com
         ErrorLog D:/AppServ/www/errornongye.log
         CustomLog logs/host1.jb200.com-access_log common
</VirtualHost>

<VirtualHost *:82>
         ServerAdmin test@www.jb200.com
         DocumentRoot D:/AppServ/www/w2
         ServerName www.jb200.com
         ErrorLog D:/AppServ/www/w2/errornongjiale.log
         CustomLog logs/host2.jb200.com-access_log common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.x
    DocumentRoot "C:/Apache2.2/docs/dummy-host2.x"
    ServerName dummy-host2.x
    ErrorLog "logs/dummy-host2.x-error.log"
    CustomLog "logs/dummy-host2.x-access.log" common
</VirtualHost>