Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-19-2008, 07:50 PM   #1
Registered: Apr 2005
Posts: 104

Rep: Reputation: 15
selinux not allows to change www root

hi all!

if i change root of www dir, selinux blocks web browers attempt to open (show) that page.

can you help me how to avoid that behaviour, and how to get proper page in a browser?

thank you in advance!
Old 10-19-2008, 11:19 PM   #2
Registered: Oct 2004
Location: Adelaide Hills, South Australia
Distribution: RHEL 5&6 CentOS 5, 6 & 7
Posts: 572

Rep: Reputation: 56
The problem is most likely caused by incorrect file attributes of the alternate directory root. Issue the following command and compare the output:0-
ls -ldZ /var/www/html/ /your/alt/dir/root
You should get something that looks like this for your original root directory:-
drwxr-xr-x  apache apache system_u:object_r:httpd_sys_content_t /var/www/html/
If the alternate directory root, and all the files below it, aren't given the correct SELinux context (system_u:object_r:httpd_sys_content_t), then SELinux will block access to it. They really should be owned by apache as well.

This command will set the appropriate SELinux context for your new directory root:-
chcon -R --reference=/var/www/html /your/alt/dir/root
Let us know how you get on.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
selinux not allowing su to root vonedaddy Linux - Security 3 01-03-2008 06:39 PM
restricting root with selinux wojtekjs Linux - Security 1 12-15-2005 11:00 PM
tricky root password reset, selinux fluppel Linux - Security 6 09-07-2005 07:11 PM
Apache 2 change www path problem MDK10.2 ewan Linux - Newbie 3 05-08-2005 05:38 AM
should var/www/html be accessible to root only? linuxfond Linux - Newbie 1 09-06-2003 03:00 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration