LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-01-2009, 05:33 AM   #1
Ginnyz
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?

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

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

/etc/httpd/conf/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
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
For a start you need to enable the UserDir directive in httpd.conf : http://httpd.apache.org/docs/2.0/mod/mod_userdir.html
See also http://www.linuxtopia.org/online_boo...he-config.html
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

also

ls -lZ

will show owner/perms/selinux
 
  


Reply

Tags
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


All times are GMT -5. The time now is 03:17 PM.

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