1、修改apache\conf\httpd.config文件,增加Listen
2、修改apache\conf\httpd.config文件,增加ServerName
3、修改apache\conf\httpd.config文件,开启虚拟主机
4、修改apache\conf\extra\httpd-vhosts.config文件,增加NameVirtualHost
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>
6、注意要在防火墙那开启端口