1、修改apache\conf\httpd.config文件,增加Listen

Apache配置多端口

2、修改apache\conf\httpd.config文件,增加ServerName

Apache配置多端口

3、修改apache\conf\httpd.config文件,开启虚拟主机

Apache配置多端口

4、修改apache\conf\extra\httpd-vhosts.config文件,增加NameVirtualHost

Apache配置多端口

 

5、修改apache\conf\extra\httpd-vhosts.config文件,增加配置


<VirtualHost 【第4不增加的NameVirtualHost】>
 ServerName 【第2步里增加的ServerName】
 DocumentRoot "代码文件夹路径" 
 <Directory "代码文件夹路径">  
  Options FollowSymLinks IncludesNOEXEC Indexes
  DirectoryIndex index.php index.html index.shtml
  AllowOverride All
  Order Deny,Allow
  Allow from all
 </Directory>
</VirtualHost>

Apache配置多端口

6、注意要在防火墙那开启端口

相关文章: