LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-15-2011, 09:09 AM   #1
george-lappies
Member
 
Registered: May 2011
Location: Secunda, South Africa
Distribution: Slackware 13.37
Posts: 181

Rep: Reputation: 9
Problem accessing public_html in user directory.


Hi all

I cannot get apache to show the files in ~/public_html it gives me this error
Code:
Forbidden

You don't have permission to access /~george/test.txt on this server.
According to the .conf file it should have read access...
 
Old 06-15-2011, 09:14 AM   #2
unclejed613
Member
 
Registered: Mar 2009
Posts: 352

Rep: Reputation: 32
what about file and directory permissions?
 
Old 06-15-2011, 09:22 AM   #3
george-lappies
Member
 
Registered: May 2011
Location: Secunda, South Africa
Distribution: Slackware 13.37
Posts: 181

Original Poster
Rep: Reputation: 9
Quote:
Originally Posted by unclejed613 View Post
what about file and directory permissions?
Everybody has read and write access on that directory and recursively downwards. Should that user belong to a special group or such?
 
Old 06-15-2011, 10:04 AM   #4
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
try uncommenting this line and restart Apache
Code:
# User home directories
#Include /etc/httpd/extra/httpd-userdir.conf
 
Old 06-15-2011, 10:08 AM   #5
george-lappies
Member
 
Registered: May 2011
Location: Secunda, South Africa
Distribution: Slackware 13.37
Posts: 181

Original Poster
Rep: Reputation: 9
Quote:
Originally Posted by willysr View Post
try uncommenting this line and restart Apache
Code:
# User home directories
#Include /etc/httpd/extra/httpd-userdir.conf
I did so but still no success.
 
Old 06-15-2011, 10:30 AM   #6
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
your $HOME and $HOME/public_html folders should have execute permissions for group and other for letting apache being able to serve the pages traversing directories: these permissions for the two folders should make your webserver happy and should give you reasonable security
Code:
$ ls -la $HOME
total 108536
drwx--x--x 37 myuser mygroup      4096 2011-06-14 16:31 .
 
Old 06-15-2011, 06:27 PM   #7
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,661

Rep: Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784Reputation: 1784
simply giving chmod 755 should fix your permission problem
 
1 members found this post helpful.
Old 06-16-2011, 01:47 AM   #8
george-lappies
Member
 
Registered: May 2011
Location: Secunda, South Africa
Distribution: Slackware 13.37
Posts: 181

Original Poster
Rep: Reputation: 9
Thumbs up

Quote:
Originally Posted by willysr View Post
simply giving chmod 755 should fix your permission problem
Indeed , it solved the problem right away. I am sure ponce's solution would have worked as well I just wasn't sure how to do what he said.

thanks all who replied
 
Old 06-16-2011, 05:20 AM   #9
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 360

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by george-lappies View Post
I am sure ponce's solution would have worked as well I just wasn't sure how to do what he said.
Code:
$ chmod 711 $HOME
The digits are sums of 4 (read), 2 (write), and 1 (execute). Or you can use letters:

Code:
$ chmod u=rwx,go=x $HOME
Which means that user (u) gets read (r), write (w) and execute (x) access, but group (g) and others (o) get only execute access.

man chmod has detailed explanations for all of these.
 
Old 06-16-2011, 05:45 AM   #10
george-lappies
Member
 
Registered: May 2011
Location: Secunda, South Africa
Distribution: Slackware 13.37
Posts: 181

Original Poster
Rep: Reputation: 9
Quote:
Originally Posted by audriusk View Post
Code:
$ chmod 711 $HOME
The digits are sums of 4 (read), 2 (write), and 1 (execute). Or you can use letters:

Code:
$ chmod u=rwx,go=x $HOME
Which means that user (u) gets read (r), write (w) and execute (x) access, but group (g) and others (o) get only execute access.

man chmod has detailed explanations for all of these.
Thanks I will have a look at chmod
 
  


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
[SOLVED] Accessing Web pages shared in /<Directory /home/vinay/public_html> Allowdirectory vinaytp Linux - Newbie 1 06-02-2010 03:53 AM
If I have public_html website for every user whereis MYSQL database for each user? RMLinux Linux - Newbie 1 12-02-2008 05:37 AM
Access to public_html directory ForYouAndI.com Linux - Security 7 02-04-2007 08:48 AM
Accessing a directory with different user permissions archangel77 Linux - Newbie 1 08-07-2005 09:15 AM
How to enable directory browsing inside public_html? gepesz Linux - Networking 1 07-23-2004 04:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:47 PM.

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