Author: Sven Knispel
Updated: 2004-12-10
This article describes how to configure Apache to support ~user directories. In a second step each ~user directory is set up to allow cgi-scripts to be run from ~user/cgi-bin.
User specific web-directories are managed by the module mod_userdir.c
. Each user gets a web-directory called /~
mapped to /home/
.
/home/<username>
must have 711
permissions/home/<username>/public_html
must have 755
permissionspublic_html
must be word-readable
~user
directorieshttpd.conf
and make sure that:UserDir disable
is commented outroot
: UserDir disabled root
UserDir
is defined as public_html
~user/public_html
and open them using a browser. If you encounter problems with permissions make sure the above-mentioned rights are granted (remember, Apache access files using the user apache
as a default.
~user
directoriesperl
) in a specific user subdirectory:httpd.conf
(e.g. for perl
).
AddHandler cgi-script .pl
ScriptAlias
ScriptAlias /~sven/cgi-bin "/home/sven/public_html/cgi-bin/"
/~sven/cgi-bin
(don't forget set the x-permission to the script).ExecCGI
can be defined at a <Diretory>
level in httpd.conf
. It is generally not a good idea to set this at the uppermost level /
.~<user>/cgi-bin
directory:
<Directory /home/*/public_html/cgi-bin>
AllowOverride None
Options +ExecCGI +Includes +Indexes
Order allow,deny
Allow from all
</Directory>
httpd.conf
./var/log/httpd/error_log
:
Premature end of script headers
suexec
, that is used by Apache to run scripts (at least on my Fedora Core 2).suexec
is active by running apachectl -V
, and see if there is a suexec
located in the path given by SUEXEC_BIN
./var/log/httpd/suexec.log
.suexec
seems to be quite sensitive about uid/gid
and, if you don't understand what it is doing I recomment deactivating it by renaming /usr/sbin/suexec
and restart Apache.