Description of problem: You can set LogLevel for modules in httpd24. The problem is: 1. We have Include conf.d/*.conf at line 56 of httpd.conf 2. and then we set globally LogLevel warn at line 189 of httpd.conf If i set for example LogLevel debug rewrite:trace8 in conf.d/mod_rewrite.conf this setting is replaced by LogLevel warn in the httpd.conf Version-Release number of selected component (if applicable): JWS 3.0 DR0.2
To solve this problem, we should move the 'Include conf.d/*.conf' directive to the bottom of httpd.conf so customized configurations will not be overriden by httpd.conf main configurations. However, '00-base.conf' should still be loaded firstly as it's part of the main configuration. So the fix is: [weli@dhcp-66-78-87 jws-compose]$ git diff diff --git a/postinstall b/postinstall index d5da046..858d975 100644 --- a/postinstall +++ b/postinstall @@ -65,3 +65,9 @@ echo "PidFile ${currentDir}/run/httpd.pid" >> conf.d/00-mpm.conf dav_lockdb_dir='/var/lib/dav24' mkdir -p ${dav_lockdb_dir} 2> /dev/null chown apache ${dav_lockdb_dir} 2> /dev/null + +# bz1180562 +mv conf.d/00-base.conf conf/ +sed -i -e 's:Include conf.d/\*\.conf:Include conf/00-base.conf:' conf/httpd.conf +echo 'Include conf.d/*.conf' >> conf/httpd.conf + I have roughly tested this change in my local environment and didn't find any obvious problems. If there are more problems caused by this change, please send me bug report :-)
Why do we fix this problem in .postinstall and not directly in httpd.conf ?
(In reply to Libor Fuka from comment #2) > Why do we fix this problem in .postinstall and not directly in httpd.conf ? I'll check the rpm config files. Because in rpm the config file are in three directories: 'conf' 'conf.d' and 'conf.modules.d', and the config files are from multiple packages, I need to think it over to see how we make sure the behavior is same with the zip build. I'll work on it.
Here is the configuration in httpd rpm package: [weli@dhcp-66-78-87 conf]$ grep -n 'conf' httpd.conf 2:# This is the main Apache HTTP server configuration file. It contains the 3:# configuration directives that give the server its instructions. 7:# for a discussion of each configuration directive. 23:# configuration, error, and log files are kept. 56:Include conf.modules.d/*.conf 69:# 'Main' server configuration 191:<IfModule log_config_module> 253:# CGI directory exists, if you have that configured. 269: # AddType allows you to add to or override the MIME configuration 324: MIMEMagicFile conf/magic 350:# Supplemental configuration 352:# Load config files in the "/etc/httpd/conf.d" directory, if any. 353:IncludeOptional conf.d/*.conf At line 56 it loads everything in conf.modules.d/*.conf, then at last line it loads conf.d/*.conf. When user set LogLevel debug rewrite:trace8 in conf.d/mod_rewrite.conf, it will be loaded at last of httpd.conf and won't be overwritten by the config in httpd.conf. The behavior is same with the zip build. Please let me know if this is not sufficient.
Is there any reason why we still have these lines in .postinstall ? grep -F 'Include conf.d/*.conf' conf/httpd.conf 1> /dev/null if [ $? -ne 0 ]; then echo 'Include conf.d/*.conf' >> conf/httpd.conf fi Its static we should have it directly in httpd.conf
Hi Libor, Yes you are right :-) Fix: [weli@dhcp-66-78-87 jws-compose]$ git diff diff --git a/jws-compose.spec b/jws-compose.spec index 55a25b4..e9669b1 100644 --- a/jws-compose.spec +++ b/jws-compose.spec @@ -390,6 +390,7 @@ cp %{_libdir}/%{httpd}/modules/mod_ssl.so httpd/modules/ mv httpd/conf.modules.d/* httpd/conf.d/ rm -rf httpd/conf.modules.d sed -i -e '/IncludeOptional conf\.d\/\*\.conf/d' -e 's/Include conf\.modules\.d/Include conf\.d/' httpd/conf/httpd.conf +echo 'Include conf.d/*.conf' >> httpd/conf/httpd.conf # bz1175307 merge ssl conf echo -e "0r httpd/conf.d/00-ssl.conf\nw" | ed httpd/conf.d/ssl.conf diff --git a/postinstall b/postinstall index 161f8ad..1f751d0 100644 --- a/postinstall +++ b/postinstall @@ -75,9 +75,4 @@ if [ -f conf.d/00-base.conf ]; then sed -i -e 's:Include conf.d/\*\.conf:Include conf/00-base.conf:' conf/httpd.conf fi -grep -F 'Include conf.d/*.conf' conf/httpd.conf 1> /dev/null -if [ $? -ne 0 ]; then - echo 'Include conf.d/*.conf' >> conf/httpd.conf -fi -
Oh no, we can't fix it like this because in postinstall: +++ b/postinstall @@ -75,9 +75,4 @@ if [ -f conf.d/00-base.conf ]; then sed -i -e 's:Include conf.d/\*\.conf:Include conf/00-base.conf:' conf/httpd.conf fi So we must put the 'echo 'Include conf.d/*.conf' >> conf/httpd.conf' at last of postinstall. Change reverted.
change reverted: [weli@dhcp-66-78-87 jws-compose]$ git diff diff --git a/jws-compose.spec b/jws-compose.spec index e9669b1..55a25b4 100644 --- a/jws-compose.spec +++ b/jws-compose.spec @@ -390,7 +390,6 @@ cp %{_libdir}/%{httpd}/modules/mod_ssl.so httpd/modules/ mv httpd/conf.modules.d/* httpd/conf.d/ rm -rf httpd/conf.modules.d sed -i -e '/IncludeOptional conf\.d\/\*\.conf/d' -e 's/Include conf\.modules\.d/Include conf\.d/' httpd/conf/httpd.conf -echo 'Include conf.d/*.conf' >> httpd/conf/httpd.conf # bz1175307 merge ssl conf echo -e "0r httpd/conf.d/00-ssl.conf\nw" | ed httpd/conf.d/ssl.conf diff --git a/postinstall b/postinstall index 1f751d0..161f8ad 100644 --- a/postinstall +++ b/postinstall @@ -75,4 +75,9 @@ if [ -f conf.d/00-base.conf ]; then sed -i -e 's:Include conf.d/\*\.conf:Include conf/00-base.conf:' conf/httpd.conf fi +grep -F 'Include conf.d/*.conf' conf/httpd.conf 1> /dev/null +if [ $? -ne 0 ]; then + echo 'Include conf.d/*.conf' >> conf/httpd.conf +fi +
Correct fix: [weli@dhcp-66-78-87 jws-compose]$ git diff diff --git a/postinstall b/postinstall index 161f8ad..d59ec51 100644 --- a/postinstall +++ b/postinstall @@ -73,11 +73,8 @@ if [ -f conf.d/00-base.conf ]; then mv conf.d/00-base.conf conf/ echo "DefaultRuntimeDir ${currentDir}/run" >> conf/00-base.conf sed -i -e 's:Include conf.d/\*\.conf:Include conf/00-base.conf:' conf/httpd.conf -fi - -grep -F 'Include conf.d/*.conf' conf/httpd.conf 1> /dev/null -if [ $? -ne 0 ]; then echo 'Include conf.d/*.conf' >> conf/httpd.conf fi + [weli@dhcp-66-78-87 jws-compose]$
Verified with ER1