Don't run the airtime-install script if Apache has not been configured [#CC-5020]
This commit is contained in:
parent
e68e6d9160
commit
c33b0cb980
|
@ -1,8 +1,21 @@
|
||||||
|
airtime (2.4.0-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* Nightly development snapshot of Airtime 2.4.x series
|
||||||
|
|
||||||
|
-- Daniel James <daniel@64studio.com> Tue, 19 Mar 2013 16:39:23 +0000
|
||||||
|
|
||||||
|
airtime (2.3.0-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Don't run the airtime-install script if the user has chosen not to
|
||||||
|
set up Apache
|
||||||
|
|
||||||
|
-- Daniel James <daniel@64studio.com> Tue, 19 Mar 2013 16:39:23 +0000
|
||||||
|
|
||||||
airtime (2.3.0-1) unstable; urgency=low
|
airtime (2.3.0-1) unstable; urgency=low
|
||||||
|
|
||||||
* Nightly development snapshot of Airtime 2.3.x
|
* Upstream 2.3.0 release
|
||||||
|
|
||||||
-- Daniel James <daniel@64studio.com> Tue, 22 Jan 2013 11:44:57 +0000
|
-- Daniel James <daniel@64studio.com> Tue, 12 Feb 2013 11:44:57 +0000
|
||||||
|
|
||||||
airtime (2.2.1-1) unstable; urgency=low
|
airtime (2.2.1-1) unstable; urgency=low
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ includefile="${configdir}/apache.conf"
|
||||||
a2tplfile="${configdir}/apache.vhost.tpl"
|
a2tplfile="${configdir}/apache.vhost.tpl"
|
||||||
phpinifile="${configdir}/airtime.ini"
|
phpinifile="${configdir}/airtime.ini"
|
||||||
OLDVERSION="$2"
|
OLDVERSION="$2"
|
||||||
NEWVERSION="2.3.0"
|
NEWVERSION="2.4.0"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
configure|reconfigure)
|
configure|reconfigure)
|
||||||
|
@ -20,39 +20,30 @@ case "$1" in
|
||||||
webserver="apache2"
|
webserver="apache2"
|
||||||
php="php5"
|
php="php5"
|
||||||
|
|
||||||
# clean up previous configurations
|
|
||||||
if [ -L /etc/$webserver/conf.d/airtime.conf ]; then
|
|
||||||
rm -f /etc/$webserver/conf.d/airtime.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /etc/$webserver/sites-available/airtime-vhost ]; then
|
|
||||||
a2dissite airtime-vhost
|
|
||||||
fi
|
|
||||||
|
|
||||||
# this file in 1.8.2 is a directory path in 1.9.3
|
# this file in 1.8.2 is a directory path in 1.9.3
|
||||||
if [ -f /var/www/airtime/utils/airtime-import ]; then
|
if [ -f /var/www/airtime/utils/airtime-import ]; then
|
||||||
rm -f /var/www/airtime/utils/airtime-import
|
rm -f /var/www/airtime/utils/airtime-import
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# APACHE config
|
# do we set up a virtual host?
|
||||||
echo "Setting up apache2..."
|
|
||||||
|
|
||||||
# create the document root if it doesn't exist
|
|
||||||
if [ ! -d $wwwdir/public/ ]; then
|
|
||||||
install -d -m755 $wwwdir/public/
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set up the virtual host
|
|
||||||
db_get airtime/apache-setup
|
db_get airtime/apache-setup
|
||||||
if [ "$RET" == "system-wide (all vhosts)" ]; then
|
APACHESETUP=$RET
|
||||||
if [ ! -d /etc/$webserver/conf.d/ ]; then
|
if [ "${APACHESETUP}" == "no thanks" ]; then
|
||||||
install -d -m755 /etc/$webserver/conf.d/
|
echo "Not setting up ${webserver} and ${php}..."
|
||||||
fi
|
|
||||||
if [ ! -e /etc/$webserver/conf.d/airtime.conf ]; then
|
elif [ "${APACHESETUP}" == "dedicated v-host" ]; then
|
||||||
ln -s ${includefile} /etc/$webserver/conf.d/airtime.conf
|
echo "Setting up ${webserver}..."
|
||||||
|
|
||||||
|
# create the document root if it doesn't exist
|
||||||
|
if [ ! -d $wwwdir/public/ ]; then
|
||||||
|
install -d -m755 $wwwdir/public/
|
||||||
|
fi
|
||||||
|
|
||||||
|
# temporarily disable an existing virtual host
|
||||||
|
if [ -f /etc/$webserver/sites-available/airtime-vhost ]; then
|
||||||
|
a2dissite airtime-vhost
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif [ "$RET" == "dedicated v-host" ]; then
|
|
||||||
db_get airtime/apache-servername
|
db_get airtime/apache-servername
|
||||||
SN=$RET
|
SN=$RET
|
||||||
db_get airtime/apache-serveradmin
|
db_get airtime/apache-serveradmin
|
||||||
|
@ -69,30 +60,49 @@ case "$1" in
|
||||||
if [ $RETVAL -eq 0 ]; then
|
if [ $RETVAL -eq 0 ]; then
|
||||||
a2ensite airtime-vhost
|
a2ensite airtime-vhost
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# enable the rewrite module
|
# insert a specific hostname, if provided, into API configuration
|
||||||
command -v a2enmod > /dev/null
|
if [ "${SN}" != "localhost" ]; then
|
||||||
RETVAL=$?
|
|
||||||
if [ $RETVAL -eq 0 ]; then
|
|
||||||
a2enmod rewrite
|
|
||||||
fi
|
|
||||||
|
|
||||||
# remove the default site, if requested to
|
# new installs
|
||||||
db_get airtime/apache-deldefault
|
if [ -f /var/lib/airtime/tmp/airtime_mvc/build/airtime.conf -a -f /var/lib/airtime/tmp/python_apps/api_clients/api_client.cfg ]; then
|
||||||
if [ "$RET" == "remove default" ]; then
|
sed -i "s/base_url = localhost/base_url = ${SN}/" /var/lib/airtime/tmp/airtime_mvc/build/airtime.conf
|
||||||
if [ -f /etc/apache2/sites-available/default ]; then
|
sed -i "s/host = 'localhost'/host = '${SN}'/" /var/lib/airtime/tmp/python_apps/api_clients/api_client.cfg
|
||||||
a2dissite default
|
fi
|
||||||
|
|
||||||
|
# upgrades
|
||||||
|
if [ -f /etc/airtime/airtime.conf -a -f /etc/airtime/api_client.cfg ]; then
|
||||||
|
sed -i "s/base_url = localhost/base_url = ${SN}/" /etc/airtime/airtime.conf
|
||||||
|
sed -i "s/host = 'localhost'/host = '${SN}'/" /etc/airtime/api_client.cfg
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# PHP config
|
# enable the rewrite module
|
||||||
echo "Configuring php5..."
|
command -v a2enmod > /dev/null
|
||||||
if [ ! -d /etc/$php/conf.d/ ]; then
|
RETVAL=$?
|
||||||
install -d -m755 /etc/$php/conf.d/
|
if [ $RETVAL -eq 0 ]; then
|
||||||
fi
|
a2enmod rewrite
|
||||||
if [ ! -e /etc/$php/conf.d/airtime.ini ]; then
|
fi
|
||||||
ln -s ${phpinifile} /etc/$php/conf.d/airtime.ini
|
|
||||||
|
# remove the default site, if requested to
|
||||||
|
db_get airtime/apache-deldefault
|
||||||
|
if [ "$RET" == "remove default" ]; then
|
||||||
|
if [ -f /etc/apache2/sites-available/default ]; then
|
||||||
|
a2dissite default
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# PHP config
|
||||||
|
echo "Configuring php5..."
|
||||||
|
if [ ! -d /etc/$php/conf.d/ ]; then
|
||||||
|
install -d -m755 /etc/$php/conf.d/
|
||||||
|
fi
|
||||||
|
if [ ! -e /etc/$php/conf.d/airtime.ini ]; then
|
||||||
|
ln -s ${phpinifile} /etc/$php/conf.d/airtime.ini
|
||||||
|
fi
|
||||||
|
|
||||||
|
# restart apache
|
||||||
|
invoke-rc.d apache2 restart
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# XXX ICECAST XXX
|
# XXX ICECAST XXX
|
||||||
|
@ -186,9 +196,6 @@ case "$1" in
|
||||||
echo "The rabbitmq-server package does not appear to be installed on this server."
|
echo "The rabbitmq-server package does not appear to be installed on this server."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# restart apache
|
|
||||||
invoke-rc.d apache2 restart
|
|
||||||
|
|
||||||
# fix the Liquidsoap symlink if it doesn't point to standard location
|
# fix the Liquidsoap symlink if it doesn't point to standard location
|
||||||
if [ -h /usr/bin/airtime-liquidsoap ]; then
|
if [ -h /usr/bin/airtime-liquidsoap ]; then
|
||||||
SYMLINK_TARGET=`readlink /usr/bin/airtime-liquidsoap`
|
SYMLINK_TARGET=`readlink /usr/bin/airtime-liquidsoap`
|
||||||
|
@ -214,8 +221,12 @@ case "$1" in
|
||||||
echo "Reconfiguration complete."
|
echo "Reconfiguration complete."
|
||||||
else
|
else
|
||||||
|
|
||||||
if [ -n "$OLDVERSION" ] && [[ "${OLDVERSION:0:3}" < "1.9" ]]; then
|
if [ -n "$OLDVERSION" ] && [[ "${OLDVERSION:0:3}" < "2.1" ]]; then
|
||||||
echo "Upgrades from Airtime versions before 1.9.0 are not supported. Please back up your files and perform a clean install."
|
echo "Upgrades from Airtime versions before 2.1.0 are not supported. Please back up your files and perform a clean install."
|
||||||
|
|
||||||
|
elif [ "${APACHESETUP}" == "no thanks" ]; then
|
||||||
|
echo "Please run the ${tmpdir}/install_minimal/airtime-install script after you have set up the web server."
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
mkdir -p /var/log/airtime
|
mkdir -p /var/log/airtime
|
||||||
|
|
Loading…
Reference in New Issue