CentOS Modify the Site Directory Tip 403 Solution

Source: Internet
Author: User
Tags centos

Under CentOS the APAHCE Web site root directory is installed under/var/. The mount point is out of space, so we have to change the position to/home/www.

Switch to this directory and restart Apache. Also give this directory 777 permissions, but access is to appear 403

Search on the Internet, and finally found the following command:

The code is as follows Copy Code

Chcon-r-T Httpd_sys_content_t/home/www

Run it again, it's normal!

It is said that this is the cause of selinux, do not understand. Just keep the record!

The following steps are attached to the switch directory

1, vi/etc/httpd/conf/httpd.conf
finds the DocumentRoot "/var/www/html" section #apache的根目录
Change/var/www/html this directory to/home/ Wwwroot/web1/htdocs
Then find <directory "/var/www/html" > #定义apache/var/www/html this area
to convert/var/www/html to/home/ Wwwroot/web1/htdocs
So we apahce the default path to the
service httpd restart #重启Apache服务器
2, access to the localhost, you will find access denied, What is this for?
System Operation Dimension Warm reminder: qihang01 original content copyright, reprint please specify the source and the original link
is mainly because your/home/wwwroot/web1/htdocs permission is 750,apache This user does not have the privilege to access, You need to get rid of the permissions, you can change the
chmod-r 755/home/wwwroot/web1/htdocs
and then go to the discovery that the normal run (Apache User: Apache run Apache Group: Apache)
So far , the Apache default site directory changes successfully.

Related Article

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.