Appserv本机多端口配置文件(示例代码)

发布时间:2019-10-04编辑:脚本学堂
分享一例Appserv中本机多端口的配置文件,即httpd-vhosts.conf配置文件代码,有需要的朋友参考下。

本节内容:
Appserv本机多端口配置文件

在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 admin#jb200.com
         DocumentRoot D:/AppServ/www
         ServerName www.jb200.com
         ErrorLog D:/AppServ/www/errornongye.log
         CustomLog logs/dummy-host2.appservnetwork.com-access_log common
</VirtualHost>


<VirtualHost *:82>
         ServerAdmin admin#jb200.com
         DocumentRoot D:/AppServ/www/xuejk
         ServerName www.jb200.com
         ErrorLog D:/AppServ/www/xuejk/errornongjiale.log
         CustomLog logs/dummy-host2.appservnetwork.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>

有时间的话, 大家可以在自己的环境中亲自测试下Appserv本机多端口的配置。