My webserver contains several virtual hosts. I want phpmyadmin to install to the DocumentRoot of one of the virtual hosts that is NOT the default. When I try to set the HTTPD_ROOT variable on the command line, it is not set inside the ebuild. I attempted to add an override line in the ebuild, but somewhere this variable gets reset to the default root in /etc/apache2/conf/apache2.conf. Reproducible: Always Steps to Reproduce: 1. emerge apache 2. set default DocumentRoot in /etc/apache2/conf/apache2.conf to /var/www/myroot from /var/www/localhost/htdocs. 3. add two virtual host entries, the default pointing to /var/www/myroot and a secondary one to /var/www/localhost/htdocs. --------- 4. HTTPD_ROOT="/var/www/localhost/htdocs/" emerge phpmyadmin OR 5. Edit /usr/portage/dev-db/phpmyadmin/phpmyadmin-2.5.4.ebuild 6. Add the line HTTPD_ROOT="/var/www/localhost/htdocs/" in one of the following places: outside any ebuild function, inside the pkg_setup function AFTER the webapp-pkg_setup call, first line in src_compile function. 7. emerge phpmyadmin Actual Results: phpmyadmin installs to the default documentroot /var/www/myroot directory. Expected Results: phpmyadmin should have installed to the /var/www/localhost/htdocs directory. This seems to be a mismatch in expected functionality from the webapp-pkg_setup function. As with most other packages in portage, an administrator expects to be able to redirect ebuilds to install to customized locations rather than defaults determined by random configuration files. After reviewing the webapp-apache.eclass file, I can see no way to specify the DocumentRoot beyond editing /etc/apache2/conf/apache2.conf or the ebuild file directly.
webapp-apache is obsolete, however phpmyadmin should have only installed to /var/www/localhost/htdocs at this time (this is a hard decision that we have made until the vhost-config and webapp-config have been completed). Eg it should not take any input to control this yet.
According to the grep comment in webapp-apache: HTTPD_ROOT="`grep '^DocumentRoot' ${APACHECONF} | cut -d ' ' -f 2`" It looks to me as though it will install to whatever the DocumentRoot is set to in /etc/apache2/conf/apache2.conf. If this DocumentRoot is different than the default, why should it have still installed to the default path?
Because supporting DocumentRoot is never going to be clean unless there is proper support for this in Portage. If you build a .tbz2 package of an ebuild on a machine with the default DocumentRoot, then install that .tbz2 on a machine with a different one, you're out of luck. Same thing if the situation is reversed. Therefore, there can be only one.
I think my point is more that I don't understand why there isn't a way to override the default install root when desired. Couldn't the ebuild have been built to detect if HTTPD_ROOT is set prior to calling webapp-pkg_setup? If HTTPD_ROOT is not set, then the ebuild needs to call webapp-pkg_setup to properly configure everything. (Or perhaps inside webapp-pkg_setup perform this checking.)
Chris, you seemed to ignore what I said: 'webapp-apache is obsolete' ultimately with vhost-config and webapp-config, the behavior is this: case 1 (not using vhosts): all web applications are installed to /var/www/localhost/htdocs or a fixed location (vhost-config/webapp-config _may_ [but probably not at this point] have this in a configuration file, but we will definetly be going away from parsing the apache config, just because it's so error-prone). if you are using non-standard locations, expect big flashing warnings about moving the tbz2 between machines. case 2 (using vhosts): on emerge, the package is installed to a location is that seperate, possibly /usr/share/webapps/${PF}/ or something of the sort. you can create/edit/delete vhosts using vhost-config (modeled after zope-config to a degree). then using webapp-config (modeled after zprod-manager to a degree) you will be able to add/remove webapps to each of the defined vhosts.
Sorry, I didn't ignore what you said. I was merely pointing out that claiming a component of an ebuild is obsolete does not fix the problem that the ebuild does not have the desired functionality.
As the original author, I'm sorry that webapp-apache (in this case) won't do what you want it to do. It wasn't designed to support virtual hosts. We have a new approach for dealing with that, which we hope to introduce as soon as possible. Robin's right - it is obsolete, and I won't be making changes to it in future. Sorry. Best regards, Stu