403 Problems with lamp

Source: Internet
Author: User

there is a step in the httpd.conf that you have not modified:
version 2.2 Changes such as:
Vim/usr/local/apache2/conf/httpd.conf found:
<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all
</Directory>
Switch
<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
allow from all
</Directory>

such modifications of the 2.4 version:
<directory/>
allowoverride None
Require all denied
</Directory>

Switch
<directory/>
allowoverride None
Require All granted
</Directory>
2. No appropriate index is defined we can see that all sites can be accessed by just entering a domain name. This is because index is defined.
Vi/usr/local/apache2/conf/httpd.conf
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
This should add index.php or your custom homepage.
<ifmodule dir_module>
directoryindex index.html index.php
</IfModule>
3. DocumentRoot directory permissions are not appropriate
First determine what documentroot you are accessing your site, such as/data/www
Then you want to determine the httpd process user (view method is: PS aux |grep httpd, the first column of the user is), if it is daemon
LS-LD/
ls-ld/data/
Ls-ld/data/www
Look at these directories, daemon whether the user has X permission, but also to see/data/www/the following file, daemon whether the user has Read permission
4. You set theAccess Control
When we do experiments, we often turn on the virtual host configuration file:
/usr/local/apache2/conf/extra/httpd-vhosts.conf
This is the first virtual host (the first <virtualhost*> </virtualhost> the configuration inside) isDefault Virtual Host, about the default virtual host, it has a feature, that is, whether we configure what domain name (servername or Serveralias) or not configured, as long as we point the domain name to the machine, as long as the other virtual host does not configure the domain name, will access the virtual host. With that in mind, we can sort out our ideas. Let me cite a case:
Your access to your domain is www.test.com
Your virtual machine IP is 192.168.31.110
Records are configured in the Hosts file for Windows: 192.168.31.100 www.test.com
And we had a problem with www.test.com when we visited the browser.
At this time, we should check the configuration file, you must first determine whether the virtual host configuration file in your configuration file, open or not see/usr/local/apache2/conf/httpd.conf in this line include conf/extra/ Httpd-vhosts.conf the beginning of the line if there is a # number, if not it is open. If we open it, we must go to/usr/local/apache2/conf/extra/httpd-vhosts.conf to find out the configuration. First search the full text whether there is a domain name www.test.com, there is in the corresponding virtual host configuration check. If not, go to the default virtual host configuration

This article is from the "Boyhack" blog, make sure to keep this source http://461205160.blog.51cto.com/274918/1747917

403 Problems with lamp

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.