多端口站点设置,以APMSERV集成环境为例!

以下以APMSERV集成环境为例:

1、找到你的apache上的配置文件httpd.conf,用记事本打开, D:APMServApacheconf

2、修改以下几项: Listen 80 下增加一行:这里为81, Listen 80 Listen 81

3、把conf文件接到下面,找到这一段:

#APMServ默认虚拟主机

NameVirtualHost *:80

<VirtualHost *:80>  

ServerName *  

DocumentRoot "D:/APMServ/www/htdocs"

<Directory "D:/APMServ/www/htdocs">   

  Options FollowSymLinks IncludesNOEXEC Indexes  

  DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml  

  AllowOverride None   

  Order Deny,Allow   

  Allow from all 

</Directory>

</VirtualHost>

在下面添加不同端口绑定的不同目录

NameVirtualHost *:81

<VirtualHost *:81>  

  ServerName *  

  DocumentRoot "D:/APMServ/www/htdocs/rz"

  <Directory "D:/APMServ/www/htdocs/rz">   

  Options FollowSymLinks IncludesNOEXEC Indexes  

  DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml  

  AllowOverride None   

  Order Deny,Allow   

  Allow from all 

</Directory>

</VirtualHost>

 

重启apache

原文地址:https://www.cnblogs.com/JerryWang24/p/3522501.html