Alon Bar-Lev has uploaded a new change for review. Change subject: packaging: rework httpd proxy ......................................................................
packaging: rework httpd proxy - store as template - generate during setup - sync syntax with engine Change-Id: I4255bdebbe9bf253d62d895a2952bdd18a768626 Signed-off-by: Alon Bar-Lev <[email protected]> --- M Makefile M ovirt-engine-reports.spec.in A packaging/conf/ovirt-engine-reports-proxy.conf.in M packaging/legacy-setup/ovirt-engine-reports-setup.py D packaging/sys-etc/httpd/conf.d/z-ovirt-engine-reports-proxy.conf 5 files changed, 36 insertions(+), 32 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/10/23310/1 diff --git a/Makefile b/Makefile index ffb258e..415e2e9 100644 --- a/Makefile +++ b/Makefile @@ -156,7 +156,6 @@ install -d $(DESTDIR)$(PKG_SYSCONF_DIR)/ovirt-engine-reports install -d $(DESTDIR)$(SYSCONF_DIR)/$(OVIRT_REPORTS_NAME)/ovirt-engine-reports.conf.d install -d $(DESTDIR)$(BIN_DIR) - install -d $(DESTDIR)$(SYSCONF_DIR)/httpd/conf.d install -d $(DESTDIR)$(DATA_DIR)/conf install -d $(DESTDIR)$(DATA_DIR)/legacy-setup install -d $(DESTDIR)$(DATA_DIR)/reports @@ -164,12 +163,12 @@ cp -a reports/repository_files/* $(DESTDIR)$(DATA_DIR)/reports install -p -m 644 packaging/sys-etc/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf $(DESTDIR)$(PKG_SYSCONF_DIR)/engine.conf.d - install -p -m 644 packaging/sys-etc/httpd/conf.d/z-ovirt-engine-reports-proxy.conf $(DESTDIR)$(SYSCONF_DIR)/httpd/conf.d install -p -m 755 packaging/legacy-setup/ssl2jkstrust.py $(DESTDIR)$(DATA_DIR)/legacy-setup install -p -m 755 packaging/legacy-setup/ovirt-engine-reports-setup.py $(DESTDIR)$(DATA_DIR)/legacy-setup install -p -m 755 packaging/legacy-setup/common_utils.py $(DESTDIR)$(DATA_DIR)/legacy-setup install -p -m 755 packaging/legacy-setup/decorators.py $(DESTDIR)$(DATA_DIR)/legacy-setup install -p -m 644 packaging/conf/default_master.properties $(DESTDIR)$(DATA_DIR)/conf + install -p -m 644 packaging/conf/ovirt-engine-reports-proxy.conf.in $(DESTDIR)$(DATA_DIR)/conf install -p -m 644 packaging/conf/reports.xml $(DESTDIR)$(DATA_DIR)/conf cp -rpf server-customizations/* $(DESTDIR)$(DATA_DIR)/server-customizations diff --git a/ovirt-engine-reports.spec.in b/ovirt-engine-reports.spec.in index 9bf7f25..2ed81de 100644 --- a/ovirt-engine-reports.spec.in +++ b/ovirt-engine-reports.spec.in @@ -123,7 +123,6 @@ %{_sysconfdir}/ovirt-engine/engine.conf.d/50-ovirt-engine-reports.conf %{_sysconfdir}/ovirt-engine/ovirt-engine-reports -%{_sysconfdir}/httpd/conf.d/z-ovirt-engine-reports-proxy.conf %{reports_java} %{_datadir}/%{reports_name} %if "%{name}" != "%{reports_name}" diff --git a/packaging/conf/ovirt-engine-reports-proxy.conf.in b/packaging/conf/ovirt-engine-reports-proxy.conf.in new file mode 100644 index 0000000..cf105a1 --- /dev/null +++ b/packaging/conf/ovirt-engine-reports-proxy.conf.in @@ -0,0 +1,16 @@ +# +# The name of this file name is very important, the "z-" prefix is used +# to force the web server to load this file after all the other +# configurations, in particular after the configuration of the required +# proxy modules, otherwise the "IfModule" directives fail. +# +<IfModule proxy_ajp_module> + + <Location /ovirt-engine-reports> + ProxyPassMatch ajp://127.0.0.1:@JBOSS_AJP_PORT@ + <IfModule deflate_module> + AddOutputFilterByType DEFLATE text/javascript text/css text/html text/xml text/json application/xml application/json application/x-yaml + </IfModule> + </Location> + +</IfModule> diff --git a/packaging/legacy-setup/ovirt-engine-reports-setup.py b/packaging/legacy-setup/ovirt-engine-reports-setup.py index dd2e74c..38d12ff 100755 --- a/packaging/legacy-setup/ovirt-engine-reports-setup.py +++ b/packaging/legacy-setup/ovirt-engine-reports-setup.py @@ -955,6 +955,23 @@ os.chdir(current_dir) shutil.rmtree(savedRepoDir) + +def configureApache(): + with open( + os.path.join( + REPORTS_PACKAGE_DIR, + 'conf', + 'ovirt-engine-reports-proxy.conf.in', + ) + ) as f: + content = f.read().replace('@JBOSS_AJP_PORT@', '8702') + with open( + '/etc/httpd/conf.d/z-ovirt-engine-reports-proxy.conf', + 'w', + ) as f: + f.write(content) + + def main(options): ''' main @@ -1188,6 +1205,8 @@ if os.path.exists(path): shutil.rmtree(path) + configureApache() + # Restore previous version except: logging.error("Failed to complete the setup of the reports package!") diff --git a/packaging/sys-etc/httpd/conf.d/z-ovirt-engine-reports-proxy.conf b/packaging/sys-etc/httpd/conf.d/z-ovirt-engine-reports-proxy.conf deleted file mode 100644 index a607119..0000000 --- a/packaging/sys-etc/httpd/conf.d/z-ovirt-engine-reports-proxy.conf +++ /dev/null @@ -1,29 +0,0 @@ -# -# The name of this file name is very important, the "z-" prefix is used -# to force the web server to load this file after all the other -# configurations, in particular after the configuration of the required -# proxy modules, otherwise the "IfModule" directives fail. -# -<IfModule proxy_ajp_module> - - <Proxy ajp://localhost:8702> - # This is needed to make sure that connections to the application server - # are recovered in a short time interval (5 seconds at the moment) - # otherwise when the application server is restarted the web server will - # refuse to connect during 60 seconds. - ProxySet retry=5 - - # This is needed to make sure that long RESTAPI requests have time to - # finish before the web server aborts the request as the default timeout - # (controlled by the Timeout directive in httpd.conf) is 60 seconds. - ProxySet timeout=3600 - </Proxy> - - <Location /ovirt-engine-reports> - ProxyPass ajp://localhost:8702/ovirt-engine-reports - <IfModule deflate_module> - AddOutputFilterByType DEFLATE text/javascript text/css text/html text/xml text/json application/xml application/json application/x-yaml - </IfModule> - </Location> - -</IfModule> -- To view, visit http://gerrit.ovirt.org/23310 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4255bdebbe9bf253d62d895a2952bdd18a768626 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-reports Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
