Configure httpd.conf
Listening on multiple ports
Copy Code code as follows:
# Listen:allows to bind Apache to specific IP addresses and/or
# ports, instead of the default. Also the <VirtualHost>
# directive.
#
# Listen on specific IP addresses as shown below to
# prevent Apache glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 8081
Listen 8082
Listen 8083
#增加监听端口
After the following is set, you can see if the port is open by Netstat-n-a
Open a virtual site
Copy Code code as follows:
# Virtual Hosts
#Include conf/extra/httpd-vhosts.conf
#修改为
# Virtual Hosts
Include conf/extra/httpd-vhosts.conf
Configuring PHP Modules
Load PHP module, PHP5APACHE2_2 representative is using apache2.2 or above version
LoadModule php5_module "C:/php/php5apache2_2.dll"
Phpinidir "c:/php"
Configure PHP file Type mappings
AddType application/x-httpd-php. php
Configure conf/extra/httpd-vhosts.conf
Copy Code code as follows:
<virtualhost *:8082>
ServerAdmin Webmaster@dummy-host.localhost
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 Webmaster@dummy-host2.localhost
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>
<Directory...>...</Directory>
Must not be less
Restart Apache try again, if there is an error, check the log file below logs and the error log for the Windows Event Viewer record.