• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1092
  • Last Modified:

403 Forbidden Per User Web Directory?

Hello all,

Well I'm trying to set up a /~user/ web directory. I have done this is the past with Apache 1.0, but now with 2.0 I am unable to do this. Everytime I set it up I get denied with 403. Every other aspect of the server works fine except for this. I'm leaning towards permissions, but as I said I have set this up in 1.0 with no problems. Here is a little of my httpd.conf:


LoadModule userdir_module modules/mod_userdir.so



User apache
Group apache


#
<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, use this directive instead of "UserDir disable":  
    #
UserDir public_html
 
</IfModule>

<Directory "/home/user/public_html">
        Options Indexes Includes FollowSymLinks
       
        AllowOverride None
        Allow from from all
 

        Order allow,deny
</Directory>

I see no other configs in /conf.d as was an earlier problem with webalizer and mrtg. So I'm not sure where else to look.

Thanks,
GR
0
GR999
Asked:
GR999
  • 5
  • 4
  • 3
  • +1
1 Solution
 
ramazanyichCommented:
shouldn't it be
Allow from all
 instead of
Allow from from all

Could you also check eror.log file?
in that file you will see more explanation for error
0
 
GR999Author Commented:
Yes you are correct....didn't help though. Here is what errror_log has:

[error] [client 192.168.1.2] (13)Permission denied: access to /~user/ denied

Not sure what clues are there. Wrong permissions to home folder???

GR
0
 
ramazanyichCommented:
First question is: are the User and Group directives are both the same on Apache1.3 and apache2.0 configs ?
From log file it seems it didn't load userdir_module. Because it seems that URL /~user/ is not translated to correct /home/user
Try to comment <IfModule mod_userdir.c>
and </IfModule> lines.
Then you will see immediatelly during startup of apache error if mod_userdir is not loaded
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
GR999Author Commented:
Here:

[Tue Nov 23 17:03:12 2004] [notice] caught SIGTERM, shutting down
[Tue Nov 23 17:03:12 2004] [notice] core dump file size limit raised to 4294967295 bytes  
[Tue Nov 23 17:03:13 2004] [notice] mod_python: Creating 10 session mutexes based on 10 max process$
[Tue Nov 23 17:03:13 2004] [notice] Digest: generating secret for digest authentication ...
[Tue Nov 23 17:03:13 2004] [notice] Digest: done
[Tue Nov 23 17:03:14 2004] [notice] Apache/2.0.49 (Fedora) configured -- resuming normal operations

So I guess its not loading the module? If so how do i fix this?

Thanx,
GR
0
 
ramazanyichCommented:
try first check config file:
>apachectl configtest
then check that file modules/mod_userdir.so exists under $ServerRoot (ServerRoot directive value)

Also you can check which modules are compiled to apache by calling:
>httpd -l

If module mod_userdir is not compiled then you should recompile apache with adding --enable-module=userdir
0
 
ramazanyichCommented:
--enable-module=userdir should be added during calling configure
0
 
GR999Author Commented:
Ok well this was an rpm....can it still be reconfigured? I have downloaded the newest version of source from apache, might as well install it from scratch with the right support. Question is if I uninstall the rpm, will i lose any data?

GR
0
 
ramazanyichCommented:
I didn't install apache from rpm, I can't say wiil it delete data or not.
0
 
yuzhCommented:
Check public_html under the user's home to see if it is "rx" by apache, the typical permissions should looks like:

drwxr-sr-x  14 yuzh     nobody      1536 May 12  2004 public_html/

To set the dir permission:

chown yuzh:nobody public_html
chmod 3750 public_html

PS:
   chmod 3750 = chmod 750 dirname ; chmod g+s dirname

man chmod
to leran more details

0
 
GR999Author Commented:
What should the permissions be on the /home/user folder?

GR
0
 
bgbuck7Commented:
You might have the same problem I experienced. If you have SELinux enabled,
run "system-config-securitylevel"
Click the SELinux tab.
Expand the HTTPD tree.
Check Disable SELinux protection for httpd daemon.
Click OK, then Yes.
Restart httpd.

That did it for me.
0
 
yuzhCommented:
just make sure a+x for /home/user, and public_html dir as http:#12661865
0
 
yuzhCommented:
also check your error_log file, to see the cause of the problem.
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 5
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now