CentOS Linux System to change the Apache Default Web site Directory __linux

Source: Internet
Author: User
A new Linuxcentos server, installed PHP environment, found that the Apache default resolution path is/var/www/html, if you do not want to use this default path, you can set up a directory. Example: Create a new/data/website folder under the root directory to store the project. Preparation: Create a directory under the root directory 1 mkdir data 2 CD Data 3 mkdir website operation steps: 1, vi/etc/httpd/conf/httpd.conf find DocumentRoot "/var/www/ht ML "This section #apache的根目录 the/var/www/html this directory to/data/website and then find #定义apache/var/www/html this area/var/www/html to/data/website In this way we will apahce the default path to change the 1 service httpd restart #重启Apache服务器 2, visit the localhost, will find access denied, this is why.
Mainly because your/home/wwwroot/web1/htdocs permission is 750,apache This user does not have the privilege to access, you need to change the permission more, can like this changes 1 chmod-r 755/data/website then to visit Found normal operation (Apache User: Apache running Apache Group: Apache) to this point, the Apache default site directory changes successfully. Then move your project to the configured directory. Note: Online Search This method, after the modification, and then hands-on test success, to share with you
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.