LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-25-2010, 02:25 AM   #1
dav_y2k
LQ Newbie
 
Registered: Apr 2005
Distribution: RedHat
Posts: 16

Rep: Reputation: 0
Forbidden You don't have permission to access / on this server.


Hi All,
I am setting up a web server on Fedora 9. I setup a new user webuser (so that httpd won't run as root). I did the following:
- moved my html files into /home/webuser/www/html
- added user to apache group
- restarted apache

but still got the "Forbidden You don't have permission to access / on this server." message.

I also ran the command:
chcon -R -t httpd_sys_content_t /home/webuser/www/html/

to no avail.

I have attached my httpd.conf file.
Attached Files
File Type: txt httpd.txt (34.1 KB, 93 views)
 
Old 10-25-2010, 02:35 AM   #2
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
It will not work in the way you did.
In your file you did
Code:
<Directory "/home/webuser/www/html">

    Options +Indexes FollowSymLinks +ExecCGI
    AllowOverride AuthConfig FileInfo
    Order allow,deny
    Allow from all

</Directory>
Instead you need to define following section of httpd.conf

Code:
#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
and not the one which you edited as follows

Code:
<VirtualHost *:80>
    ServerName what ever your server name is
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /home/webuser/www/html
<Directory "/home/webuser/www/html">

    Options +Indexes FollowSymLinks +ExecCGI
    AllowOverride AuthConfig FileInfo
    Order allow,deny
    Allow from all

</Directory>

    ErrorLog /var/log/site_log
    CustomLog /var/log/site_access_log common
</VirtualHost>
Apache will respond to ServerName i.e. what ever you put in front of server name how are you accessing your site locally or on some server on LAN or internet and http://(what do you type here) to access your site?
If you are having permissions problem post the output of this script
Code:
webfile="/home/webuser/www/html"
ls -l "$webfile"
while [ "$webfile" != "/" ]
do
    webfile=`dirname "$webfile"`
    ls -ld "$webfile"
done

Do you have an index.html in /home/webuser/www/html because you have used Option +Indexes and this wont work until you have an index.html in /home/webuser/www/html

Last edited by tkmsr; 10-25-2010 at 02:46 AM.
 
Old 10-25-2010, 09:31 AM   #3
dav_y2k
LQ Newbie
 
Registered: Apr 2005
Distribution: RedHat
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you for your assistance
I have an index.html in the /home/webuser/www/html as shown below:

[webuser@vmsmbldap html]$ pwd
/home/webuser/www/html
[webuser@vmsmbldap html]$ ls
css images index.html
[webuser@vmsmbldap html]$

here is an output of the command:
[webuser@vmsmbldap ~]$ ./test.sh
total 16
dr-xr-xr-x 2 apache apache 4096 2010-10-26 14:19 css
dr-xr-xr-x 2 apache apache 4096 2010-10-26 14:19 images
-r-xr-xr-x 1 apache apache 5833 2010-08-27 16:44 index.html
dr-xr-xr-x 3 apache apache 4096 2010-10-26 14:17 /home/webuser/www
drwx------ 5 webuser webuser 4096 2010-10-26 23:33 /home/webuser
drwxr-xr-x 5 root root 4096 2010-10-26 14:16 /home
drwxr-xr-x 25 root root 4096 2010-09-19 20:08 /
 
Old 10-25-2010, 09:38 AM   #4
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
Quote:
Originally Posted by dav_y2k View Post
Thank you for your assistance
[webuser@vmsmbldap ~]$ ./test.sh
total 16
dr-xr-xr-x 2 apache apache 4096 2010-10-26 14:19 css
dr-xr-xr-x 2 apache apache 4096 2010-10-26 14:19 images
-r-xr-xr-x 1 apache apache 5833 2010-08-27 16:44 index.html
dr-xr-xr-x 3 apache apache 4096 2010-10-26 14:17 /home/webuser/www
drwx------ 5 webuser webuser 4096 2010-10-26 23:33 /home/webuser
drwxr-xr-x 5 root root 4096 2010-10-26 14:16 /home
drwxr-xr-x 25 root root 4096 2010-09-19 20:08 /
That is your problem.
Run this command
Quote:
chmod a+rx /home/webuser

Last edited by tkmsr; 10-25-2010 at 09:46 AM.
 
Old 10-25-2010, 09:47 AM   #5
dav_y2k
LQ Newbie
 
Registered: Apr 2005
Distribution: RedHat
Posts: 16

Original Poster
Rep: Reputation: 0
thank you so much tkmsr, that solved it... thank you so much
 
  


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] Forbidden You don't have permission to access /moodle on this server. Apache/2.2.16 abdul kadir Linux - Newbie 3 08-27-2010 03:07 AM
Forbidden You don't have permission to access / on this server tekmann33 Linux - Software 4 06-16-2009 03:17 AM
403 forbidden :You don't have permission to access /hi.html on this server. av.dubey Linux - Newbie 3 12-21-2007 12:10 AM
Forbidden - you dont have permission to access / on this server neocontrol Linux - Software 2 05-14-2006 04:36 PM
After file oops ? Forbidden You don't have permission to access / on this server. leongoogs Linux - Newbie 3 04-13-2004 09:27 AM

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

All times are GMT -5. The time now is 07:05 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