LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 07-22-2007, 05:06 AM   #1
The_eXXe
Member
 
Registered: Mar 2004
Location: TR
Distribution: Ubuntu 9.04 (x64)
Posts: 62

Rep: Reputation: 15
User directories permission problem


I am trying to user Apache's user directories. I successfully enabled it. But when i try to access from a web browser it says Forbidden. Here are the informations:

* My linuxbox is loaded with Fedora 7 64 bit.
* Apache server comes with distro.
* I am controlling tux box with putty from my windows machine. They are in the same LAN.
* Apache works normally.
When i type from windows machine:
http://serverip/~beloveds

You don't have permission to access /~beloveds on this server.
Apache/2.2.4 (Fedora) Server at 10.0.0.4 Port 80


apache error.log says
[Sun Jul 22 16:10:09 2007] [error] [client 10.0.0.5] (13)Permission denied: access to /~beloveds denied

Here is httpd.conf
Code:
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    #UserDir disable

    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disable" line above, and uncomment
    # the following line instead:
    #
    UserDir /home/*/public_html
</IfModule>

<Directory /home/*/public_html>
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>
ls -l command output: in home directory.
drwxrwxrwx 2 beloveds root 4096 2007-07-22 01:14 public_html

Everything seems ok why the permission problem?

UPDATE: I am sorry it is in wrong section. Could any moderators move this topic to Linux-Servers section. I apologize.

Last edited by The_eXXe; 07-22-2007 at 05:21 AM.
 
Old 07-22-2007, 05:32 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
SELinux protects home directories from access by Apache. In order to allow this, as root:

setsebool httpd_enable_homedirs on

More information on SELinux in the Wiki.
 
Old 07-22-2007, 06:02 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
directory permissions have nothing to do with networking. moved to Linux - Server.
 
Old 07-23-2007, 10:28 AM   #4
The_eXXe
Member
 
Registered: Mar 2004
Location: TR
Distribution: Ubuntu 9.04 (x64)
Posts: 62

Original Poster
Rep: Reputation: 15
Thanks acid_kewpie

I have already disabled SELinux. But i will give a try.
No more comments?
 
Old 07-23-2007, 02:13 PM   #5
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
What is the permission on the user's home dir? In order to give directory listing, apache must have at least '+x' permission to all parent directories of public_html.
 
Old 07-25-2007, 02:20 PM   #6
The_eXXe
Member
 
Registered: Mar 2004
Location: TR
Distribution: Ubuntu 9.04 (x64)
Posts: 62

Original Poster
Rep: Reputation: 15
This is the output of ls -l command in root

Code:
drwxr-xr-x   8 root root  4096 2007-07-20 15:37 home
I think everyone has +x permission

Last edited by The_eXXe; 07-25-2007 at 02:25 PM.
 
Old 07-25-2007, 03:48 PM   #7
The_eXXe
Member
 
Registered: Mar 2004
Location: TR
Distribution: Ubuntu 9.04 (x64)
Posts: 62

Original Poster
Rep: Reputation: 15
Code:
chmod -R 755 /home
did everything for me.

I dont understand linux sometimes. but happy to have one.

Last edited by The_eXXe; 07-25-2007 at 03:51 PM.
 
Old 07-25-2007, 03:50 PM   #8
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
That works ok, if you don't mind everyone being able to read everyone else's files.
 
Old 07-26-2007, 12:27 PM   #9
The_eXXe
Member
 
Registered: Mar 2004
Location: TR
Distribution: Ubuntu 9.04 (x64)
Posts: 62

Original Poster
Rep: Reputation: 15
Yes, you are right. I assigned 711 for user's directory and 755 for public_html folder. Now it seems OK. I cant reach someone's files from someone else's account.
 
  


Reply

Tags
apache, permission, userdir


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
Samba sharing problem (user permission problem) beikokutn Linux - Software 4 03-11-2008 05:55 AM
permission on user directories changing zpidr Linux - Security 5 06-13-2006 10:22 AM
Apache User Directories problem in Fedora 5 Core upgrade SparceMatrix Linux - Security 6 04-25-2006 10:15 PM
permission problem - root is the only user which can login hitman_et Linux - Newbie 6 04-03-2005 10:12 AM
sound device permission problem as user matjazk Slackware 5 01-31-2004 03:34 PM


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

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