LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 04-18-2007, 03:49 AM   #1
bzlaskar
Member
 
Registered: May 2006
Location: Bangalore, INDIA
Distribution: Fedora Core
Posts: 69
Blog Entries: 2

Rep: Reputation: 17
User directories in apache


Hi All,

apache provides the facility to access user's home directory through
URL. For that I have done the following configuration in /etc/httpd/conf/httpd.conf .

# UserDir disable (commented in httpd conf file)

UserDir public_html

After that I have created the public_html directory under user's home directory.

But when I try to access the URL , www.example.com/~user, it is giving 403 forbidden error.
The log file is splashing the following error.
"""

[Wed Apr 18 14:28:40 2007] [error] [client 172.16.16.25] (13)Permission denied: access to /~zaman denied

"""

I change the ownership of public_html directory to
apache.apache .

But even though it is not working.

Please somebody guide me in correcting the problem.


With thanks.
 
Old 04-18-2007, 04:21 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
You need to give your home and public_html directories, 755 permissions(don't change ownership to apache like you did above). So you would do
Code:
$chmod 755 /home/user1
$chmod 755 /home/user1/public_html
If you use selinux, you have to also do
Code:
#chcon -t httpd_sys_content_t /home/user1/public_html
 
Old 04-18-2007, 05:06 AM   #3
bzlaskar
Member
 
Registered: May 2006
Location: Bangalore, INDIA
Distribution: Fedora Core
Posts: 69

Original Poster
Blog Entries: 2

Rep: Reputation: 17
You need to give your home and public_html directories, 755 permissions(don't change ownership to apache like you did above). So you would do
chmod 755 /home/user1
chmod 755 /home/user1/public_html


Thanks . It is working.
But I feel there is a security issue there. With the 755 permissions
, anybody can do "cd" to my home directory and "execute " the executables.

So, I feel that that solution is workable but you are opening
a security hole.


With Thanks.
 
Old 04-18-2007, 05:23 AM   #4
bzlaskar
Member
 
Registered: May 2006
Location: Bangalore, INDIA
Distribution: Fedora Core
Posts: 69

Original Poster
Blog Entries: 2

Rep: Reputation: 17
I got a fix of the problem.
I tried with the following permissions.

chmod 701 /home/zaman
chmod 701 /home/zaman/public_html
chmod 704 /home/zaman/public_html/index.html


I think that is safe and it is also working.

With Thanks.
 
  


Reply



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
Apache user directories permissions Wordan Linux - Networking 9 07-14-2006 03:42 PM
Multiple website on Apache with User Directories Mr_Oz Red Hat 2 01-16-2006 07:20 AM
Creating user directories in Apache root robojerk Linux - Networking 1 09-21-2004 12:34 PM
Per-user directories with password protection (apache) gwroy20 Linux - Software 1 04-27-2004 12:48 AM
apache 2.0 user cgi-bin directories JHuizingh Linux - Software 3 03-19-2003 03:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration