Apache Server configuration multiple Web site solutions

Source: Internet
Author: User
Tags php language

2016.5.28 This Saturday afternoon Yin no wind

The weekend took a small single, get a business station, in PHP language, so you have to pick up a long time not moving PHP!

The key first step is to build the Apache environment, where I use the WAMP integrated environment software

This article only talk about me in the construction environment encountered some pits, share to everyone to see, if you are interested in the back of the construction station, please pay attention to the blog, follow-up will continue to write some of the site to build the article Oh!

I met 3 pits here.

1: Server with what good, Iis,apache

2: When building Apache environment, the domain name path too long problem

3: When building the Apache environment, the file denied access problem Forbidden you do not have the permission to access \ in this server.

Here's the solution:

I chose the Apache environment here, using WAMP integrated environment software +win7

1.wamp How to install it is very simple, here default you installed!

2.

Allows Apache to load the virtual host module at boot time.

Open the Apache installation directory under the conf/httpd.conf file, find the following two lines of text, the first # number is removed, and then saved.

#LoadModule Vhost_alias_module modules/mod_vhost_alias.so

#Include conf/extra/httpd-vhosts.conf

3.

After the configuration is complete, you can open the Apache installation directory under the/conf/extra/httpd-vhosts.conf file and add the following at the end:

DocumentRoot is the file placement path, servername is the site domain name:

<virtualhost 127.0.0.1:80>

DocumentRoot "D:/APPSERV/WWW/1"

ServerName www.xxx.com

</VirtualHost>

<virtualhost 127.0.0.2:80>

DocumentRoot "D:/APPSERV/WWW/2"

ServerName www.xxx2.com

</VirtualHost>

4. Finally reboot the Apache service to complete the configuration.

--------------------------------------------------------------------------------------------------------------- -

Apache, version 2.2.8, after the installation is complete, the relevant test;
Configure the next php php.in file, again localhost open discovery error:
HTTP Error 403-forbidden, that is, 403 forbidden:you don't have the permission to access/on the this server.

May be an issue caused by insufficient permissions.

Workaround:

Open the Apache configuration file httpd.conf, and check it line by row.
Found it:

<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all
</Directory>

Since PHP is configured, "Deny from all" here denies all connections.

You can resolve the issue by modifying this line to allow from all.

The modified code is:

<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Allow from all
</Directory>

Open http://localhost in Browser, show it works! Problem solving.

Analysis of main causes of 403 Forbidden

1 Your IP is blacklisted
2 You have access to this site in a certain amount of time (typically with a collection program), the firewall is denied access to the
3 site domain name resolves to space, but space is not bound to this domain name
4 Your Web script file does not have permission to execute under the current directory
5 Create/write file operations in directories that do not allow write/create files
6 server busy, the same IP address sent too many requests by the server Smart Shield

Reference Document: Http://www.jb51.net/os/RedHat/1303.html

Summarize:

HTTP Error 403-forbidden, that is, 403 forbidden:you don't have the permission to access/on the this server.

The above question at first also trapped me for a long time, Baidu has a lot of information, but also tried various methods;

Finally, under the various attempts to solve, or the final reason is the above solution, that is the problem of the few pieces of code, I that reason is the Apache and Wamp inside the configuration file for different reasons!

But as long as you modify allow from all this will basically solve, I hope these pits can take you out of the pits Oh! Stepping on the pit is growing, sharing is quality ...

Apache Server configuration multiple Web site solutions

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.