Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #5160: Make the packaging Apache 2.4 compliant #493

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions rudder-webapp/SOURCES/rudder-networks-24.conf
@@ -0,0 +1 @@
Require all denied
4 changes: 4 additions & 0 deletions rudder-webapp/SPECS/rudder-webapp.spec
Expand Up @@ -85,6 +85,7 @@ Group: Applications/System
Source1: rudder-users.xml
Source2: rudder.xml
Source3: rudder-networks.conf
Source4: rudder-networks-24.conf
Source5: rudder-upgrade
Source6: rudder-upgrade-database
Source7: rudder-webapp
Expand Down Expand Up @@ -212,7 +213,9 @@ cp %{_sourcedir}/rudder-sources/rudder/rudder-web/src/main/resources/apache2-sys

install -m 644 %{SOURCE2} %{buildroot}%{rudderdir}/share/webapps/

# Copy stub rudder-networks*.conf
cp %{SOURCE3} %{buildroot}%{rudderdir}/etc/
cp %{SOURCE4} %{buildroot}%{rudderdir}/etc/

%if 0%{?sles_version}
# On SLES, change the Apache DocumentRoot to the OS default
Expand Down Expand Up @@ -476,6 +479,7 @@ rm -rf %{buildroot}
%config(noreplace) /etc/%{apache_vhost_dir}/rudder-vhost.conf
%config(noreplace) /etc/%{apache_vhost_dir}/rudder-vhost-ssl.conf
%config(noreplace) %{rudderdir}/etc/rudder-networks.conf
%config(noreplace) %{rudderdir}/etc/rudder-networks-24.conf
%config(noreplace) /etc/sysconfig/rudder-apache
/usr/share/doc/rudder
%{rudderdir}/bin/rudder-upgrade-database
Expand Down
1 change: 1 addition & 0 deletions rudder-webapp/debian/conffiles
Expand Up @@ -5,4 +5,5 @@
/etc/apache2/sites-available/rudder-vhost
/etc/apache2/sites-available/rudder-vhost-ssl
/opt/rudder/etc/rudder-networks.conf
/opt/rudder/etc/rudder-networks-24.conf
/opt/rudder/etc/rudder-passwords.conf
2 changes: 2 additions & 0 deletions rudder-webapp/debian/links
@@ -1 +1,3 @@
/opt/rudder/bin/rudder-init /opt/rudder/bin/rudder-init.sh
/etc/apache2/sites-available/rudder-vhost /etc/apache2/sites-available/rudder-vhost.conf
/etc/apache2/sites-available/rudder-vhost-ssl /etc/apache2/sites-available/rudder-vhost-ssl.conf
11 changes: 11 additions & 0 deletions rudder-webapp/debian/postinst
Expand Up @@ -28,11 +28,22 @@ case "$1" in
invoke-rc.d rsyslog restart >/dev/null 2>&1
echo "Done"

APACHE_VERSION=$(apache2 -v|grep Apache|sed "s%^.*Apache/\([1-9].[1-9]\).*%\1%")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't Apache versions have 0s in them?


SITES_TO_DISABLE="default rudder-default rudder-default-ssl"
SITES_TO_ENABLE="rudder-vhost rudder-vhost-ssl"

MODULES_TO_ENABLE="dav_fs rewrite proxy_http headers ssl"

# Migration: Clean up old vhosts if we are running Apache 2.4
if [ ${APACHE_VERSION} = 2.4 ]
then
for i in ${SITES_TO_ENABLE}
do
[ -e /etc/apache2/sites-enabled/${i} ] && rm -f /etc/apache2/sites-enabled/${i}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will trigger set -e error catching. Let's reverse it like this:

[ ! -e /etc/apache2/sites-enabled/${i} ] || rm -f /etc/apache2/sites-enabled/${i}

done
fi

for dissite in ${SITES_TO_DISABLE}
do
a2dissite ${dissite} >/dev/null 2>&1 || true
Expand Down
1 change: 1 addition & 0 deletions rudder-webapp/debian/rules
Expand Up @@ -86,6 +86,7 @@ binary-arch: install
dh_install --SOURCEDIR=$(CURDIR)/BUILD/ rudder-vhost-ssl /etc/apache2/sites-available/
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder.xml /opt/rudder/share/webapps/
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder-networks.conf /opt/rudder/etc/
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder-networks-24.conf /opt/rudder/etc/
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder-passwords.conf /opt/rudder/etc/
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder-webapp /opt/rudder/etc/server-roles.d/
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder-web /opt/rudder/etc/server-roles.d/
Expand Down