apache2.4.x Virtual Host Configuration

Source: Internet
Author: User
Tags 403 forbidden error

1, open the Apache directory with Notepad httpd file (e.g. D:\wamp\bin\apache\apache2.2.8\conf), find the following module # Virtual hosts #Includeconf/EXTRA/HTTPD-VH Osts.conf Remove the previous # so that the Httpd-vhosts virtual host file is turned on.  This time restart Wamp environment, unable to open localhost, need to be configured in httpd-vhosts.conf. 2. Open the Host file (C:\WINDOWS\system32\drivers\etc\hosts), add a line of code 127.0.0.1 szyqbbs.com 3, open the Httpd-vhosts file with Notepad, Configure the localhost virtual host, refer to the Httpd-vhosts file in the instance, modified as follows:
<virtualhost *:80>    documentroot "d:/wamp/www"    ServerName myserver.com</virtualhost>< VirtualHost *:80>    ServerAdmin [email protected]    documentroot "D:/www/szyqbbs"    ServerName szyqbbs.com    errorlog "Logs/your_web_error.log"    Customlog "Logs/your_web_access.log" common</virtualhost>

Modify the configuration as follows:

DocumentRoot Modify the WWW directory (for example: D:\wamp\www) in the local WAMP environment to ServerName to localhost or to a custom server such as Server.com 4, open test.biuuu.com in the browser, found the following error 403 Forbidden Error forbiddenyou don't have permission to access/on the this server. Analysis: This is mainly the directory access permissions are not set, you need to set access to the directory! 5. Open the httpd file and add the following statement
" d:/www/ ">    Options Indexes followsymlinks    allowoverride all    Require all granted</ Directory>

6, restart Apache, virtual host configuration success! Note 1, directory path, such as E:\WEBROOT\BIUUU2, access permissions, such as the upper deny from all modified to allow from All3,host files, configure the virtual domain name host to point to the 4,httpd file, open the include conf/ extra/httpd-vhosts.conf module 5,httpd-vhosts file, configuring the virtual host

apache2.4.x Virtual Host Configuration

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.