The UserDir must be hard-wired into suexec of apache during compile. This is usualy predefined to public_html, but some can use another directory name (I prefer WWW). This is usualy set immediately after installing apache and never changes. Now the default value (public_html) is used in ebuild. I changed one line to detect this automaticaly from apache config. Reproducible: Always Steps to Reproduce:
Here is the patch. --- /root/apache-2.0.49-orig.ebuild 2004-04-03 09:37:46.000000000 +0200 +++ apache-2.0.49.ebuild 2004-04-04 17:21:21.000000000 +0200 @@ -168,7 +168,7 @@ --with-suexec-safepath="/usr/local/bin:/usr/bin:/bin" \ --with-suexec-logfile=/var/log/apache2/suexec_log \ --with-suexec-bin=/usr/sbin/suexec2 \ - --with-suexec-userdir=public_html \ + --with-suexec-userdir=`sed -n 's/^[ \t]*UserDir[ \t][ \t]*//p' /etc/apache2/conf/commonapache2.conf` \ --with-suexec-caller=apache \ --with-suexec-docroot=/var/www \ --with-suexec-uidmin=1000 \
Even better implementation with a reasonable default in case we cannot detect the UserDir value. --- /usr/portage/net-www/apache/apache-2.0.49.ebuild 2004-04-03 09:37:46.000000000 +0200 +++ apache-2.0.49.ebuild 2004-04-05 15:56:45.755564464 +0200 @@ -163,12 +163,14 @@ CXXFLAGS="`echo ${CXXFLAGS} | xargs`" LDFLAGS="`echo ${LDFLAGS} | xargs`" + USERDIR=`sed -n 's/^[ \t]*UserDir[ \t][ \t]*//p' /etc/apache2/conf/commonapache2.conf 2>/dev/null | head -n 1` + echo UserDir set to ${USERDIR:=public_html} SSL_BASE="SYSTEM" \ ./configure \ --with-suexec-safepath="/usr/local/bin:/usr/bin:/bin" \ --with-suexec-logfile=/var/log/apache2/suexec_log \ --with-suexec-bin=/usr/sbin/suexec2 \ - --with-suexec-userdir=public_html \ + --with-suexec-userdir=${USERDIR} \ --with-suexec-caller=apache \ --with-suexec-docroot=/var/www \ --with-suexec-uidmin=1000 \
I'd rather we move variables like this out into a separate configuration file, that can be shared between ebuilds at install time, and daemons at runtime. What do you think? Stu
I agree with stuart, take a look at my app-admin/amanda ebuilds as an interesting example of stored config.
It's also that some of these variables are going to overlap between the webservers (apache, ncsa, cherokee et al) and the GLEP #11 tools (webapp-config and vhost-config). I think we should be careful, and make sure that what we do here isn't just for Apache. Best regards, Stu
It is i good idea. You, as the gentoo developers, must make the decision how it will be implemented. Until you decide you could put this workaround to the ebuild.
This will probably be integrated into -r1 this weekend.
This has been added to 2.0.49-r1. Thanks for the idea and bug report.