-   Linux - Server (
-   -   Web Root Dir Change and New Dir Added issue in CentOS 5 (

Ginnyz 06-01-2009 06:33 AM

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?


battletroll 06-01-2009 02:37 PM

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.

chrism01 06-01-2009 09:29 PM

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

All times are GMT -5. The time now is 01:12 AM.