Hi I've installed suexec using on ubuntu 12.04:
apt-get install apache2 apache2-suexec libapache2-mod-fcgid php5-cgi
However when I run the following command:
sudo /usr/lib/apache2/suexec -V
I get the following info:
-D AP_DOC_ROOT="/var/www"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="www-data"
-D AP_LOG_EXEC="/var/log/apache2/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=100
-D AP_USERDIR_SUFFIX="public_html"
I'm utilizing "/home/user/public_html" to serve users content on the web not "/var/www" How can I change the root directory to "/home"?
Or you can
after install go to
edit the file vi www-data
You can see the first 2 lines, make the changes: replace
/var/www
with/home
after, restart apache
You're using ubuntu. Therefore recompile is pretty simple.
Add source repository to your /etc/apt/sources.list . For 12.04 run
change
de.archive.ubuntu.com
to whatever country you're in. After that update your repository.Change dir and download sources:
It will download and extract apache source and install all dependencies therefore you'll be able to build apache. But you'll need to fix AP_DOC_ROOT. So cd to dir with apache source and change dir path in
--with-suexec-docroot
option indebian/rules
file. So now you'll need to build package. You can make it withThat's it. Now yyou have apache deb-package with fixed path. Just install it with
sudo dpkg -i
. But watch on updates. Update will wipe out all your efforts. So runaptitude hold apache2
to forbid updates and don't forget to recompile it each time manually (or write script fpr that).Good luck.
actually you can use mod_userdir
in this case suexec will spawn scripts from owner of /home/user - in this example "user"
so you don't need to define SuexecUserGroup in apache config
UPD: just enable userdir module
and add to main vhost config
UserDir /home/*/public_html
and
You need to recompile it from suexec.c, ideally you could install virtualmin, so it will do it automatically via install.sh and also it will create accounts, domains etc.