Php Apache Virtual Host Configuration, phpapache Virtual Host

Source: Internet
Author: User

Php Apache Virtual Host Configuration, phpapache Virtual Host

Apache 2.4 is used as an example.

1,Modify httpd. conf

Remove the # in the second line below to start the Virtual Host Configuration

# Virtual hosts  # Include conf/extra/httpd-vhosts.conf  

2. Configure httpd-vhost.conf

Port 8081 is used and two virtual hosts are configured. DocumentRoot cannot contain Chinese directories.

<VirtualHost *:8081>      ServerName localhost    DirectoryIndex index.php       DocumentRoot "D:\Work\php\Apache24\htdocs"      <Directory "D:\Work\php\Apache24\htdocs">           Options Indexes FollowSymLinks           AllowOverride None           Order allow,deny           Allow from all       </Directory>   </VirtualHost>  <VirtualHost *:8081>      ServerName www.aa.com    DirectoryIndex index.php       DocumentRoot "E:\php\PhpProjectBase"      <Directory "E:\php\PhpProjectBase">           Options Indexes FollowSymLinks           AllowOverride None           Order allow,deny           Allow from all       </Directory>   </VirtualHost>  

3. etc/hosts Configuration

127.0.0.1 localhost127.0.0.1 www.aa.com

4. Restart the Apache service.

If the VM is still inaccessible, configure the following items in httpd. conf:

<Directory />    AllowOverride none    #Require all denied</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.