Bug #2306 » rudder-webapp-fix-apache.patch
SPECS/rudder-webapp.spec 2012-02-03 17:28:00.963739083 +0100 | ||
---|---|---|
%define ruddervardir /var/rudder
|
||
%define rudderlogdir /var/log/rudder
|
||
%if 0%{?sles_version}
|
||
%define apache apache2
|
||
%endif
|
||
%if 0%{?el6}
|
||
%define apache httpd
|
||
%endif
|
||
#=================================================
|
||
# Header
|
||
#=================================================
|
||
... | ... | |
mkdir -p %{buildroot}%{rudderdir}/share/plugins/
|
||
mkdir -p %{buildroot}%{ruddervardir}/inventories/incoming
|
||
mkdir -p %{buildroot}%{ruddervardir}/inventories/received
|
||
mkdir -p %{buildroot}%{rudderlogdir}/apache2/
|
||
mkdir -p %{buildroot}/etc/apache2/vhosts.d/
|
||
mkdir -p %{buildroot}%{rudderlogdir}/%{apache}/
|
||
mkdir -p %{buildroot}/etc/%{apache}/vhosts.d/
|
||
cp %{SOURCE1} %{buildroot}%{rudderdir}/etc/
|
||
cp %{_sourcedir}/source/rudder/rudder-core/src/main/resources/ldap/bootstrap.ldif %{buildroot}%{rudderdir}/share/
|
||
... | ... | |
cp -rf %{_sourcedir}/source/rudder/rudder-web/src/main/resources/load-page %{buildroot}%{rudderdir}/share/
|
||
cp %{_sourcedir}/source/rudder/rudder-core/src/test/resources/script/cfe-red-button.sh %{buildroot}%{rudderdir}/bin/
|
||
cp %{_sourcedir}/source/rudder/rudder-core/src/main/resources/reportsInfo.xml %{buildroot}%{rudderdir}/etc/
|
||
cp %{_sourcedir}/source/rudder/rudder-web/src/main/resources/apache2-default.conf %{buildroot}/etc/apache2/vhosts.d/
|
||
cp %{_sourcedir}/source/rudder/rudder-web/src/main/resources/apache2-default.conf %{buildroot}/etc/%{apache}/vhosts.d/
|
||
cp %{SOURCE2} %{buildroot}%{rudderdir}/jetty7/contexts/
|
||
%pre -n rudder-webapp
|
||
... | ... | |
#=================================================
|
||
echo "Setting apache2 as a boot service"
|
||
/sbin/chkconfig --add apache2
|
||
/sbin/chkconfig --add %{apache}
|
||
echo "Reloading syslogd ..."
|
||
/etc/init.d/syslog reload
|
||
/etc/init.d/apache2 stop
|
||
/etc/init.d/%{apache} stop
|
||
# a2dissite default
|
||
# Do this ONLY at first install
|
||
if [ $1 -eq 1 ]
|
||
then
|
||
echo 'APACHE_MODULES="${APACHE_MODULES} rewrite dav dav_fs proxy proxy_http"' >> /etc/sysconfig/apache2
|
||
echo 'DAVLockDB /tmp/davlock.db' >> /etc/apache2/conf.d/dav_mod.conf
|
||
echo 'APACHE_MODULES="${APACHE_MODULES} rewrite dav dav_fs proxy proxy_http"' >> /etc/sysconfig/%{apache}
|
||
echo 'DAVLockDB /tmp/davlock.db' >> /etc/%{apache}/conf.d/dav_mod.conf
|
||
mkdir -p /var/rudder/configuration-repository
|
||
mkdir -p /var/rudder/configuration-repository/shared-files
|
||
... | ... | |
chmod 755 -R %{rudderdir}/share/tools
|
||
chmod 655 -R %{rudderdir}/share/load-page
|
||
htpasswd2 -bc %{rudderdir}/etc/htpasswd-webdav rudder rudder
|
||
/etc/init.d/apache2 start
|
||
/etc/init.d/%{apache} start
|
||
# Migrate from 2.3.0 format policy-template store: /var/rudder/policy-templates
|
||
if [ -d /var/rudder/policy-templates -a ! -d /var/rudder/configuration-repository ]; then
|
||
... | ... | |
%{rudderdir}/share
|
||
%{ruddervardir}/inventories/incoming
|
||
%{ruddervardir}/inventories/received
|
||
%{rudderlogdir}/apache2/
|
||
/etc/apache2/vhosts.d/
|
||
%{rudderlogdir}/%{apache}/
|
||
/etc/%{apache}/vhosts.d/
|
||
#=================================================
|