Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 06-01-2009, 05:33 AM   #1
LQ Newbie
Registered: Nov 2007
Posts: 10

Rep: Reputation: 0
Exclamation Web Root Dir Change and New Dir Added issue in CentOS 5

Hi ! I have just configured CentOS server my new office. This is the first time I am using CentOS.

Whenever I am trying to change the webroot of the httpd server, it usually say "directory doesn't exist". whereas which can't be the case as it is home directory of the user.

old webroot : /var/www/public_html
new webroot desired: /home/username/public_html

to achieve this, what Do I need to do?

the second issue, I am facing that whenever I am adding new directories to public_html folder, it is not accessible. as the error page 404 is shown. I have changed the permissions to 0705 and ownership is also transferred to other user.
What else is required to make new directories accessible by the web?

Old 06-01-2009, 01:37 PM   #2
Registered: Dec 2004
Location: Alabama
Distribution: Slackware, Solaris,Fedora, CentOS, Redhat, SGI
Posts: 65

Rep: Reputation: 18
The new webroot is the default for user accounts. Ensure this is set in the httpd.conf


About half way down there are settings for this.
If you are running se_linux don't forget to enable the public_contect_t taget for the path.
Old 06-01-2009, 08:29 PM   #3
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,396

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
For a start you need to enable the UserDir directive in httpd.conf :
See also
You may have SELinux issue, in which case

chcon -t httpd_sys_content_t index.html

should help.

You can check whether SELinux is set correctly by using

semanage fcontext -l | grep http


ls -lZ

will show owner/perms/selinux


apache, centos, directory, permission, web

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
deny accessing the dir but still allow images in the dir to be used by 'HTML' wikignu Linux - Server 2 01-12-2009 09:04 AM
Command to display /dir, /dir/sub, /dir/sub/files knockout_artist Linux - Newbie 9 10-25-2007 02:57 PM
Change the root Dir in apache-tomcat shan_nathan Linux - Server 0 09-21-2007 10:09 AM
Share configuratin dir (.dir) for 3 accounts on local computer LiNuXkOlOnIe Linux - Software 5 01-08-2006 03:36 AM
Cannot change dir permissions from root sstudley Linux - General 4 02-25-2003 06:52 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:34 PM.

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