Red Hat Bugzilla – Bug 593270
Apache resource key not unique enough
Last modified: 2013-09-02 03:24:38 EDT
Description of problem:
Currently, the Apache instance is assigned a resource key containing the full path to the httpd.conf file that the instance uses. I think this is not completely unique, because the ServerRoot (either defined by the -d commandline option or by the ServerRoot directive in the config file itself) contributes to the configuration.
The ServerRoot defines the root directory from which all the relative paths in the configuration file are resolved. This opens an opportunity for the admin to have one "master" httpd.conf that would delegate parts of the configuration to other included config files that would be referenced using relative paths.
The choice of ServerRoot location using the -d commandline param would then cause different files to be included in the "master" config and thus define a different final configuration of the apache server as a whole.
I think the Apache resource key should be composed from *both* the server root location *and* the location of the httpd.conf file.
Steps to Reproduce (as root):
1. mkdir -p /httpd-test/my-server-root1/conf; mkdir /httpd-test/my-server-root1/logs
2. mkdir -p /httpd-test/my-server-root2/conf; mkdir /httpd-test/my-server-root2/logs
3. cp /etc/httpd/conf/http.conf /httpd-test
4. remove all Listen directives from /httpd-test/httpd.conf (and remove all the VirtualHost directives and includes, etc. basically make the configuration as minimal as possible)
5. add "Include conf/listen.conf" to the beginning of httpd-test/httpd.conf
6. echo "Listen 80" > /httpd-test/my-server-root1/conf/listen.conf
7. echo "Listen 81" > /httpd-test/my-server-root2/conf/listen.conf
8. apachectl -d /httpd-test/my-server-root1 -f /httpd-test/httpd.conf
9. apachectl -d /httpd-test/my-server-root2 -f /httpd-test/httpd.conf
The two instances started using the steps above get the same resource key (and thus are considered one) even though one can be reached at port 80 and the other at port 81
Both instances should be identified.
lukas - is this scope for resource upgrade work?
*** Bug 536328 has been marked as a duplicate of this bug. ***
technically no, practically yes.
This is waiting for resource upgrade to be in master so that this code doesn't break people's existing inventories when deployed.
Basically this bug supersedes bug 536328 which I therefore closed as duplicate of this one.
*** Bug 673260 has been marked as a duplicate of this bug. ***
Verified on build#158 (Version: 4.1.0-SNAPSHOT Build Number: c1539ab)
Followed the steps and verified that both Apache instances at port 80 and 81 are discovered.
Marking as verified.
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.