CC-4956: Merge nginx + apache install full scripts
-fixed
This commit is contained in:
parent
d79dc800b0
commit
d35c8050cf
2 changed files with 46 additions and 137 deletions
|
@ -2,6 +2,9 @@
|
||||||
#
|
#
|
||||||
# Auto install script for airtime on Ubuntu
|
# Auto install script for airtime on Ubuntu
|
||||||
#
|
#
|
||||||
|
# NGINX changes are contributed by Eugene MechanisM
|
||||||
|
# Link to the post:
|
||||||
|
# http://forum.sourcefabric.org/discussion/13563/first-step-to-run-airtime-via-nginx-based-on-airtime-2.0-beta-files
|
||||||
|
|
||||||
exec > >(tee install_log.txt)
|
exec > >(tee install_log.txt)
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
@ -11,6 +14,8 @@ if [ "$(id -u)" != "0" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
server="$1"
|
||||||
|
|
||||||
#Current dir
|
#Current dir
|
||||||
# Absolute path to this script, e.g. /home/user/bin/foo.sh
|
# Absolute path to this script, e.g. /home/user/bin/foo.sh
|
||||||
SCRIPT=`readlink -f $0`
|
SCRIPT=`readlink -f $0`
|
||||||
|
@ -60,7 +65,6 @@ pwgen libfaad2
|
||||||
#of Debian, where these packages are unauthorized)
|
#of Debian, where these packages are unauthorized)
|
||||||
apt-get -y --force-yes install libmp3lame-dev lame icecast2
|
apt-get -y --force-yes install libmp3lame-dev lame icecast2
|
||||||
|
|
||||||
|
|
||||||
#Debian Squeeze only has zendframework package. Newer versions of Ubuntu have zend-framework package.
|
#Debian Squeeze only has zendframework package. Newer versions of Ubuntu have zend-framework package.
|
||||||
#Ubuntu Lucid has both zendframework and zend-framework. Difference appears to be that zendframework is for
|
#Ubuntu Lucid has both zendframework and zend-framework. Difference appears to be that zendframework is for
|
||||||
#1.10 and zend-framework is 1.11
|
#1.10 and zend-framework is 1.11
|
||||||
|
@ -70,33 +74,59 @@ else
|
||||||
apt-get -y --force-yes install libzend-framework-php
|
apt-get -y --force-yes install libzend-framework-php
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#get the "timeout" unix command
|
||||||
if [ "$code" = "lucid" ]; then
|
if [ "$code" = "lucid" ]; then
|
||||||
apt-get -y --force-yes install timeout
|
apt-get -y --force-yes install timeout
|
||||||
else
|
else
|
||||||
apt-get -y --force-yes install coreutils
|
apt-get -y --force-yes install coreutils
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#Install Sourcefabric's custom Liquidsoap debian package
|
#Install Sourcefabric's custom Liquidsoap debian package
|
||||||
apt-get -y --force-yes install sourcefabric-keyring
|
apt-get -y --force-yes install sourcefabric-keyring
|
||||||
apt-get -y --force-yes install liquidsoap
|
apt-get -y --force-yes install liquidsoap
|
||||||
apt-get -y --force-yes install silan
|
apt-get -y --force-yes install silan
|
||||||
|
|
||||||
|
if [ "$server" = "nginx" ]; then
|
||||||
|
# NGINX Config File
|
||||||
|
echo "----------------------------------------------------"
|
||||||
|
echo "2.1 NGINX Config File"
|
||||||
|
echo "----------------------------------------------------"
|
||||||
|
if [ ! -f /etc/nginx/sites-available/airtime ]; then
|
||||||
|
cp $SCRIPTPATH/../nginx/airtime-vhost /etc/nginx/sites-available/airtime
|
||||||
|
ln -s /etc/nginx/sites-available/airtime /etc/nginx/sites-enabled/airtime
|
||||||
|
service nginx reload
|
||||||
|
else
|
||||||
|
echo "NGINX config for Airtime already exists..."
|
||||||
|
fi
|
||||||
|
|
||||||
# Apache Config File
|
# php-fpm Airtime pool file
|
||||||
echo "----------------------------------------------------"
|
echo "----------------------------------------------------"
|
||||||
echo "2. Apache Config File"
|
echo "2.2 Airtime php pool file"
|
||||||
echo "----------------------------------------------------"
|
echo "----------------------------------------------------"
|
||||||
if [ ! -f /etc/apache2/sites-available/airtime ]; then
|
if [ ! -f /etc/php5/fpm/pool.d/airtime.conf ]; then
|
||||||
cp $SCRIPTPATH/../apache/airtime-vhost /etc/apache2/sites-available/airtime
|
cp $SCRIPTPATH/../php5-fpm/airtime.conf /etc/php5/fpm/pool.d/airtime.conf
|
||||||
a2dissite default
|
service php5-fpm reload
|
||||||
a2ensite airtime
|
else
|
||||||
a2enmod rewrite php5
|
echo "Airtime php pool file already exists..."
|
||||||
service apache2 restart
|
fi
|
||||||
else
|
else
|
||||||
echo "Apache config for Airtime already exists..."
|
# Apache Config File
|
||||||
|
echo "----------------------------------------------------"
|
||||||
|
echo "2. Apache Config File"
|
||||||
|
echo "----------------------------------------------------"
|
||||||
|
if [ ! -f /etc/apache2/sites-available/airtime ]; then
|
||||||
|
cp $SCRIPTPATH/../apache/airtime-vhost /etc/apache2/sites-available/airtime
|
||||||
|
a2dissite default
|
||||||
|
a2ensite airtime
|
||||||
|
a2enmod rewrite php5
|
||||||
|
service apache2 restart
|
||||||
|
else
|
||||||
|
echo "Apache config for Airtime already exists..."
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Enable Icecast
|
# Enable Icecast
|
||||||
echo "----------------------------------------------------"
|
echo "----------------------------------------------------"
|
||||||
echo "3. Enable Icecast"
|
echo "3. Enable Icecast"
|
||||||
|
|
|
@ -1,131 +1,10 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash
|
||||||
#
|
# Auto install script for airtime + nginx
|
||||||
# Auto install script for airtime on Ubuntu
|
|
||||||
#
|
|
||||||
# NGINX changes are contributed by Eugene MechanisM
|
|
||||||
# Link to the post:
|
|
||||||
# http://forum.sourcefabric.org/discussion/13563/first-step-to-run-airtime-via-nginx-based-on-airtime-2.0-beta-files
|
|
||||||
|
|
||||||
exec > >(tee install_log.txt)
|
|
||||||
exec 2>&1
|
|
||||||
|
|
||||||
if [ "$(id -u)" != "0" ]; then
|
|
||||||
echo "Please run as root user."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Current dir
|
|
||||||
# Absolute path to this script, e.g. /home/user/bin/foo.sh
|
# Absolute path to this script, e.g. /home/user/bin/foo.sh
|
||||||
SCRIPT=`readlink -f $0`
|
SCRIPT=`readlink -f $0`
|
||||||
# Absolute path this script is in, thus /home/user/bin
|
# Absolute path this script is in, thus /home/user/bin
|
||||||
SCRIPTPATH=`dirname $SCRIPT`
|
SCRIPTPATH=`dirname $SCRIPT`
|
||||||
|
|
||||||
#Prerequisite
|
$SCRIPTPATH/airtime-full-install nginx
|
||||||
echo "----------------------------------------------------"
|
|
||||||
echo " 1. Install Packages"
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
|
|
||||||
dist=`lsb_release -is`
|
|
||||||
code=`lsb_release -cs`
|
|
||||||
|
|
||||||
#enable squeeze backports to get lame packages
|
|
||||||
if [ "$dist" = "Debian" -a "$code" = "squeeze" ]; then
|
|
||||||
grep "deb http://backports.debian.org/debian-backports squeeze-backports main" /etc/apt/sources.list
|
|
||||||
if [ "$?" -ne "0" ]; then
|
|
||||||
echo "deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
apt-get update
|
|
||||||
|
|
||||||
# Updated package list
|
|
||||||
apt-get -y --force-yes install tar gzip curl nginx php5-pgsql php5-fpm \
|
|
||||||
php-pear php5-gd postgresql odbc-postgresql python libsoundtouch-ocaml \
|
|
||||||
libtaglib-ocaml libao-ocaml libmad-ocaml ecasound \
|
|
||||||
libesd0 libportaudio2 libsamplerate0 rabbitmq-server patch \
|
|
||||||
php5-curl mpg123 monit python-virtualenv multitail libcamomile-ocaml-data \
|
|
||||||
libpulse0 vorbis-tools lsb-release lsof sudo mp3gain vorbisgain flac vorbis-tools \
|
|
||||||
pwgen libfaad2
|
|
||||||
|
|
||||||
#install packages with --force-yes option (this is useful in the case
|
|
||||||
#of Debian, where these packages are unauthorized)
|
|
||||||
apt-get -y --force-yes install libmp3lame-dev lame icecast2
|
|
||||||
|
|
||||||
#Debian Squeeze only has zendframework package. Newer versions of Ubuntu have zend-framework package.
|
|
||||||
#Ubuntu Lucid has both zendframework and zend-framework. Difference appears to be that zendframework is for
|
|
||||||
#1.10 and zend-framework is 1.11
|
|
||||||
if [ "$dist" = "Debian" ]; then
|
|
||||||
apt-get -y install --force-yes zendframework
|
|
||||||
else
|
|
||||||
apt-get -y install --force-yes libzend-framework-php
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$code" = "lucid" ]; then
|
|
||||||
apt-get -y install --force-yes timeout
|
|
||||||
else
|
|
||||||
apt-get -y install --force-yes coreutils
|
|
||||||
fi
|
|
||||||
|
|
||||||
# NGINX Config File
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
echo "2.1 NGINX Config File"
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
if [ ! -f /etc/nginx/sites-available/airtime ]; then
|
|
||||||
cp $SCRIPTPATH/../nginx/airtime-vhost /etc/nginx/sites-available/airtime
|
|
||||||
ln -s /etc/nginx/sites-available/airtime /etc/nginx/sites-enabled/airtime
|
|
||||||
service nginx reload
|
|
||||||
else
|
|
||||||
echo "NGINX config for Airtime already exists..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
#Install Sourcefabric's custom Liquidsoap debian package
|
|
||||||
apt-get -y --force-yes install sourcefabric-keyring
|
|
||||||
apt-get -y --force-yes install liquidsoap
|
|
||||||
apt-get -y --force-yes install silan
|
|
||||||
|
|
||||||
# php-fpm Airtime pool file
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
echo "2.2 Airtime php pool file"
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
if [ ! -f /etc/php5/fpm/pool.d/airtime.conf ]; then
|
|
||||||
cp $SCRIPTPATH/../php5-fpm/airtime.conf /etc/php5/fpm/pool.d/airtime.conf
|
|
||||||
service php5-fpm reload
|
|
||||||
else
|
|
||||||
echo "Airtime php pool file already exists..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Enable Icecast
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
echo "3. Enable Icecast"
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
cd /etc/default/
|
|
||||||
sed -i 's/ENABLE=false/ENABLE=true/g' icecast2
|
|
||||||
set +e
|
|
||||||
service icecast2 start
|
|
||||||
set -e
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Enable Monit
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
echo "4. Enable Monit"
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
cd /etc/default/
|
|
||||||
sed -i 's/startup=0/startup=1/g' monit
|
|
||||||
|
|
||||||
set +e
|
|
||||||
grep -q "include /etc/monit/conf.d" /etc/monit/monitrc
|
|
||||||
RETVAL=$?
|
|
||||||
set -e
|
|
||||||
if [ $RETVAL -ne 0 ] ; then
|
|
||||||
mkdir -p /etc/monit/conf.d
|
|
||||||
echo "include /etc/monit/conf.d/*" >> /etc/monit/monitrc
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Run Airtime Install
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
echo "5. Run Airtime Install"
|
|
||||||
echo "----------------------------------------------------"
|
|
||||||
cd $SCRIPTPATH/../../install_minimal
|
|
||||||
./airtime-install
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue