Troubleshooting 403 error when configuring virtual host for Apache

Source: Internet
Author: User

1. Open the httpd.conf in Apache with a text editor, search for httpd-vhosts.conf, find "#Include conf/extra/httpd-vhosts.conf", and remove "#" to enable the virtual host feature.

Find the following code in HTTPD.CONF:

<directory/>options followsymlinksallowoverride noneorder deny,allowdeny from all</Directory>

When PHP is initially set, "Deny from all" means "Deny all connections" and is modified to "allow from all"

2. Open httpd-vhosts.conf, configure your own virtual host information, add it after the file

<virtualhost *:80>    documentroot "(Root of Project)"    ServerName the domain name    <directory "(Root directory of Project)" >    Options followsymlinks    allowoverride None    Order allow,deny allow from all    </directory></ Virtualhost>

DocumentRoot and ServerName are required to be configured

3. Modify the Hosts file, and the file is finally added

127.0.0.1 the domain name you set yourself

Note: The problem of resolving 403 is primarily to modify the "Deny from all" in httpd.conf and to increase when the virtual host information is configured

<directory "Project root directory"/> Options followsymlinks allowoverride None Order deny,allow allow from all </directory& Gt

Once configured, reboot Apache and the problem should be solved.

Reference: http://www.cnblogs.com/wajika/p/6481167.html

Troubleshooting 403 error when configuring virtual host for Apache

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.