PHP + Apache how to monitor multiple ports and configure multiple sites, phpapache
Configure httpd. conf
Listen to multiple ports
# 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.
After setting Listen 8083 and other content, you can use netstat-n-a to check whether the port is enabled.
Enable Virtual Site
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf # 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
<VirtualHost *: 8082>
ServerAdmin
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
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>
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.