PDA

View Full Version : Setting up Apache's UserDir


Sadrok
02-20-02, 11:45 AM
So I cannot get the UserDir option to work right. The problem: 403 Forbidden - You don't have permission to access /~sadrok on this server
sadrok is the username with a directory /home/sadrok (~home).
I've setup Userbin public_html
I've done the <Directory /home/*/public_html> part with Order allow,deny and Allow from All
The files and the public_html dirs are owned by apache.apache and I also tried sadrok.sadrok with various chmod settings. Nothin worked.

Log Dumps (or the latest few lines in them)
Nothing happens in the error_log when I get the permission error

• error_log -----------------
[Wed Feb 20 14:38:18 2002] [notice] caught SIGTERM, shutting down
[Wed Feb 20 14:38:42 2002] [notice] Apache-AdvancedExtranetServer/1.3.19 (Linux-Mandrake/3mdk) mod_ssl/2.8.2 OpenSSL/0.9.6 PHP/4.0.4pl1 configured -- resuming normal operations
[Wed Feb 20 14:38:42 2002] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Feb 20 14:38:56 2002] [crit] (98)Address already in use: make_sock: could not bind to port 443

• access_log -----------------
192.168.1.2 - - [20/Feb/2002:14:40:56 +0200] "GET /~sadrok HTTP/1.1" 403 315 "-" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"

• suexec_log -----------------
[2002-02-20 12:16:43]: info: (target/actual) uid: (sadrok/sadrok) gid: (sadrok/sadrok) cmd: first.pl
[2002-02-20 12:16:43]: emerg: cannot get docroot information (/home/sadrok)

• ssl-access_log
192.168.1.2 - - [20/Feb/2002:13:07:44 +0200] "GET /cgi-bin/test-cgi HTTP/1.1" 200 662
192.168.1.2 - - [20/Feb/2002:13:08:15 +0200] "GET /~sadrok/ HTTP/1.1" 403 317

Stu
02-20-02, 12:25 PM
Did you load the UserDir module? Your httpd.conf should have something like this in it (assuming you only are serving static pages in the UserDir):



<IfModule mod_userdir.c>
UserDir public_html
</IfModule>

<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>



Also, the files and the directory public_html should be owned by username:user_group and chmod'ed 755 ( (d|-)rwxr-xr-x ), your $HOME should be chmod'ed 755 as well.

Sadrok
02-20-02, 12:45 PM
thank stu,

i guess I only had to chmod the $HOME and public_html dirs. it works fine now, even the cgi-bins for the users too!