Configure httpd. conf
Listen to multiple ports
CopyCode The Code is as follows: # Listen: allows you to bind Apache to specific IP addresses and/or
# Ports, instead of the default. See also the <virtualhost>
# Directive.
#
# Change this to listen on specific IP addresses as shown below
# Prevent Apache from glomming onto all bound IP addresses.
#
# Listen 12.34.56.78: 80
Listen 8081.
Listen 8082.
Listen 8083.
# Adding listening ports
After setting the following content, you can use netstat-n-a to check whether the port is enabled.
Enable Virtual SiteCopy codeThe Code is as follows: # Virtual Hosts
# Include CONF/extra/httpd-vhosts.conf
# Change
# Virtual Hosts
Include CONF/extra/httpd-vhosts.conf
Configure the PHP Module
When the PHP module is loaded, php5apache2_2 indicates that apache2.2 or a later version is used.
Loadmodule php5_module "C:/PHP/php5apache2_2.dll"
Phpinidir "C:/PHP"
Configure PHP file type ing
Addtype application/X-httpd-PHP. php
Configure CONF/extra/httpd-vhosts.conf
Copy code The Code is as follows: <virtualhost *: 8082>
Serveradmin webmaster@dummy-host.localhost
DocumentRoot "C:/phpdocroot/Site1"
Servername localhost
Serveralias localhost
Errorlog "log/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 webmaster@dummy-host2.localhost
DocumentRoot "C:/phpdocroot/Site2"
Servername localhost
Errorlog "log/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>
<Directory...>... </directory>
Must not be less
Restart Apache and try again. If an error occurs, check the log file under logs and the error log recorded by Windows event viewer.