Apache Multi-Port multiple site configuration method _linux

Source: Internet
Author: User
Tags php file
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.