1. Configure httpd.conf
Listening to multiple ports
#Listen 12.34.56.78:80
Listen 8081
Listen 8082
Listen 8083
Netstat-n-A can be used to see if the port is turned on
2. Turn on the virtual site
# Virtual Hosts
#Include conf/extra/httpd-vhosts.conf
#修改为
# Virtual Hosts
Include conf/extra/httpd-vhosts.conf
3.php Configuration
Load PHP module, php5apache2_2 is using apache2.2 or later
LoadModule php5_module "C:/php/php5apache2_2.dll"
Phpinidir "c:/php"
Configuring PHP File Type Mappings
AddType application/x-httpd-php. php
4. Configure conf/extra/httpd-vhosts.conf
<virtualhost *:8082>
ServerAdmin [email protected]
DocumentRoot "C:/phpdocroot/site1"
ServerName localhost
Serveralias localhost
Errorlog "Logs/dummy-host.localhost-error.log"
Customlog "Logs/dummy-host.localhost-access.log" common
<directory "C:/phpdocroot/site1" >
Options Indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
</VirtualHost>
<virtualhost *:8083>
ServerAdmin [email protected]
DocumentRoot "C:/phpdocroot/site2"
ServerName localhost
Errorlog "Logs/dummy-host2.localhost-error.log"
Customlog "Logs/dummy-host2.localhost-access.log" common
<directory "C:/phpdocroot/site2" >
Options Indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
</VirtualHost>
The actual use of multi-domain name only 80 and then the hosts specify LOCALHOST2 can:
<virtualhost *:80>
DocumentRoot E:/SVNROOT/BFGLOGIC/SRC
ServerName localhost
Serveralias localhost
</VirtualHost>
<virtualhost *:80>
DocumentRoot D:/php/webroot
ServerName Localhost2
Serveralias Localhost2
</VirtualHost>
Last reboot, if error carefully query log
Wamp Multi-site multiport configuration