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、注意要在防火牆那開啓端口