Configure multiple sites in Apache + PHP

Source: Internet
Author: User

Configure httpd. conf in Apache

# Added the listener to check whether the port is enabled through netstat-n-.
# 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 80
Listen 8081.
Listen 8082.
Listen 8083.
# Enable a Virtual Site
# Virtual Hosts
Include CONF/extra/httpd-vhosts.conf





# Loading PHP
Loadmodule php5_module "C:/PHP/php5apache2_2.dll"
<Ifmodule php5_module>
Phpinidir "C:/PHP"
LoadFile "C:/PHP/php5ts. dll"
</Ifmodule>
# PHP file type ing
Addtype application/X-httpd-PHP. php

 

Configure CONF/extra/httpd-vhosts.conf

<VirtualHost *:8082>
ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "C:/root1"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common
<Directory "C:/root1">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:8083>
ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot "C:/root2"
ServerName localhost
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
<Directory "C:/root2">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Basic PHP configuration

PHP. ini

; Select the loaded Module
Extension = php_mysql.dll

Set Environment Variables

Right-click "my computer", select "properties", select the "advanced" tab, click "environment variables", find the "path" variable under "system variables", and select, double-click or click "edit" to add "; C: \ PHP \ Ext" to the end of the original value. Of course, "C: \ PHP "is the PHP installation directory

 

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.