Warning:documentroot Error Resolution

Source: Internet
Author: User
The installation takes security into account and is prepared to place the documentroot in a separate partition, so the logical partition specifically builds a directory for it:/DMNR
To mount the partition, set the/etc/fstab to:
Code:...
LABEL=/DMNR/DMNR ext3 Defaults 1 2
After the catalogue is built, copy the contents of the website into the www/html of the directory and modify the/etc/httpd/conf/httpd.conf as follows:
[PHP]
...
DocumentRoot "/dmnr/www/html"
...
...
[/php]
Restart Apache The following error message appears:
Code: #service httpd Restart
Starting Httpd:Warning:DocumentRoot [/dmnr/www/html] does not exist
[OK]
Of course the server does not work properly, Apache thinks this is not a directory! However, the DocumentRoot "" is not a problem with the other directory, and the server is working properly.
Solve:
I. SELinux configuration (slightly ...), you can refer to:
http://www.chinalinuxpub.com/read.php?wid=1010
Http://blog.josesun.org/archives/2004_08/2
Two. Modify the HTML directory permissions:
1. Check the Site Content directory
[PHP]
#ls-Z/dmnr/www/html
[/php]
The status is:
[PHP]
-rwxr-xr-x Someuser Somegroup index.php
...
[/php]
2. Obviously there is no SELinux authority, so make the following changes:
[PHP]
Chcon-r-T httpd_user_content_t/dmnr/www/html
[/php]
And here's how it looks:
[PHP]
-rwxr-xr-x someuser Somegroup user_u:object_r:httpd_sys_content_t index.php
...
[/php]
Restart httpd normal PHP to work.
Three. Database
1. Mysql
However, when the database is read and written to be rejected by SELinux, to/var/lib/mysql or/var/lib/pgsql see no problem, the permissions are as follows:
[PHP]
-rw-rw--MySQL MySQL root:object_r:mysqld_db_t ibdata1
-rw-rw--MySQL MySQL root:object_r:mysqld_db_t ib_logfile0
-rw-rw--MySQL MySQL root:object_r:mysqld_db_t ib_logfile1
Drwx--mysql MySQL root:object_r:mysqld_db_t MySQL
srwxrwxrwx MySQL MySQL root:object_r:mysqld_var_run_t mysql.sock
Drwx--mysql MySQL root:object_r:mysqld_db_t test
[/php]
But in the test library to put the data to see that the self-built table or no SELinux permissions, it's OK, the modification is:
[PHP]
Chcon-r-T Mysqld_db_t/var/lib/mysql
[/php]
Note that the SELinux attribute here is mysqld_db_t
2. Pgsql
I also opened the PostgreSQL library, using this method to modify the property is not successful, error:
[PHP]
Chcon:can ' t apply partial context to unlabeled file pgsql/data/base/23456
Chcon:can ' t apply partial context to unlabeled file pgsql/data/base/12345
[/php]
To/var/lib/pgsql/data/base, it turns out that the properties are not applied to self-built libraries 12345 and 23456. Find information to find the mess, half a day there is no clue, forget!
[PHP]
#su-postgres
cd/vaR/L ib/pgsq L/Data/b ase

The above describes the Warning:documentroot error resolution, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.