Skip to content

Instantly share code, notes, and snippets.

@tknv
Last active August 29, 2015 14:16
Show Gist options
  • Save tknv/d9abe23372ba2d2ea9fa to your computer and use it in GitHub Desktop.
Save tknv/d9abe23372ba2d2ea9fa to your computer and use it in GitHub Desktop.
--- install_fusionpbx.sh.1 2015-01-11 02:58:46.000000000 +0700
+++ install_fusionpbx-trusty.sh 2015-03-04 13:03:13.508700565 +0700
@@ -31,7 +31,7 @@
#Variables are for the auto installation option.
#for apache set to a, for nginx/php-fpm set to n -> for an auto install, user mode will prompt
-APACHENGINX=n
+APACHENGINX=a
# for mysql set m. for sqlite set s. for postgresql set p
SQLITEMYSQL=p
@@ -56,7 +56,8 @@
#DISTRO=squeeze
#DISTRO=precise
#DISTRO=lucid
-DISTRO=wheezy
+DISTRO=trusty
+#DISTRO=wheezy
#below is a list of modules we want to add to provide functionality for FusionPBX
#don't worry about the applications/mod_ format. This script will find that in modules.conf
@@ -73,9 +74,9 @@
#-------
VERSION="Version - using subversion, no longer keeping track. WAF License"
#latest release
-FPBXBRANCH="http://fusionpbx.googlecode.com/svn/trunk/fusionpbx"
+#FPBXBRANCH="http://fusionpbx.googlecode.com/svn/trunk/fusionpbx"
#dev branch
-#FPBXBRANCH="http://fusionpbx.googlecode.com/svn/branches/dev/fusionpbx"
+FPBXBRANCH="http://fusionpbx.googlecode.com/svn/branches/dev/fusionpbx"
# Modules_comp_default determined using
# grep -v ^$ /usr/src/freeswitch/modules.conf |grep -v ^# | tr '\n' ' '
# on FreeSWITCH version FreeSWITCH Version 1.0.head (git-8f2ee97 2010-12-05 17-19-28 -0600)
@@ -103,6 +104,8 @@
#used for Apache
#WWW_PATH="/var/www/html"
+# add subdomain
+PBXDOMAIN=$3
GUI_NAME=fusionpbx
INST_FPBX=svn
@@ -147,7 +150,7 @@
[pP])
#tell FS about the postgresql database...
echo " Please type in the password for the freeswitch database you configured below."
- read -p "Password: " FSDBPASS
+ read -p "Password:(postgres) " FSDBPASS
FPATH="/var/www/fusionpbx/resources/templates/conf"
/bin/echo "setting switch.conf.xml"
@@ -772,6 +775,9 @@
esac
+
+
+
#---------------------
# ENVIRONMENT CHECKS
#---------------------
@@ -828,7 +834,7 @@
wheezy)
DISTRO=wheezy
/bin/echo "OK you're running Debian Wheezy. This script is known to work"
- /bin/echo " with apache/nginx and sqlite|postgres9.4 options"
+ /bin/echo " with apache/nginx and sqlite|postgres9.2 options"
/bin/echo " Please consider providing feedback on whether or not this works."
/bin/echo
@@ -844,6 +850,16 @@
/bin/echo " works fine."
/bin/echo
CONTINUE=YES
+# fi
+ ;;
+# lsb_release -c |grep -i trusty > /dev/null
+# if [ $? -eq 0 ]; then
+ trusty)
+ DISTRO=trusty
+ /bin/echo "OK you're running Ubuntu 12.04 LTS [trusty]. This script is"
+ /bin/echo " works fine."
+ /bin/echo
+ CONTINUE=YES
;;
# else
*)
@@ -919,7 +935,7 @@
/usr/bin/apt-get update
/usr/bin/apt-get -y upgrade
- if [ $DISTRO == "precise" ]; then
+ if [ $DISTRO == "precise" ] || [ $DISTRO == "trusty" ]; then
/usr/bin/apt-get -y install ssh vim git-core libjpeg-dev subversion build-essential \
autoconf automake devscripts gawk g++ git-core libtool make libncurses5-dev \
python-dev pkg-config libtiff4-dev php5-curl php5-imap php5-mcrypt lame \
@@ -1027,6 +1043,13 @@
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
/usr/bin/apt-get update
/usr/bin/apt-get -y install postgresql-9.4 libpq-dev
+ elif [ $DISTRO = "trusty" ]; then
+ POSTGRES9=9
+ #update repository for postgres 9.4 ...
+ /bin/echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list
+ wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
+ /usr/bin/apt-get update
+ /usr/bin/apt-get -y install postgresql-9.4 libpq-dev
elif [ $DISTRO = "wheezy" ]; then
POSTGRES9=9
#update repository for postgres 9.4 ...
@@ -1985,13 +2008,29 @@
/bin/cat >> /etc/apache2/sites-available/$GUI_NAME <<DELIM
<VirtualHost *:80>
ServerAdmin webmaster@localhost
- ServerName $FQDN
- DocumentRoot $WWW_PATH/$GUI_NAME
+ ServerName $PBXDOMAIN
+
+ Redirect permanent / https://$PBXDOMAIN/
+</VirtualHost>
+
+<VirtualHost *:443>
+ ServerName $PBXDOMAIN
+
+ SSLEngine on
+ SSLProtocol ALL -SSLv2 -SSLv3
+ SSLHonorCipherOrder On
+ SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
+ SSLCertificateFile /etc/ssl/certs/wildcard_public_cert.crt
+ SSLCertificateKeyFile /etc/ssl/private/wildcard_private.key
+ SSLCACertificateFile /etc/ssl/certs/wildcard_ca.pem
+ Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
+
+ DocumentRoot /var/www/fusionpbx
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
- <Directory $WWW_PATH/$GUI_NAME/>
+ <Directory /var/www/fusionpbx/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
@@ -2136,7 +2175,7 @@
elif [ $DISTRO = "precise" ]; then
#included in main repo we have nginx [nginx-full] and php5-fpm
- echo "already in 12.04 LTS [precise], nothing to add."
+ echo "already in 12.04 LTS [precise], nothing to add. Of course trusty too."
else
#add-apt-repository ppa:brianmercer/php // apt-get -y install python-software-properties
#Add php5-fpm ppa to the list
@@ -2480,6 +2519,9 @@
elif [ $DISTRO = "precise" ]; then
#already there...
/usr/bin/apt-get -y install php5-pgsql
+ elif [ $DISTRO = "trusty" ]; then
+ #already there...
+ /usr/bin/apt-get -y install php5-pgsql
elif [ $DISTRO = "wheezy" ]; then
POSTGRES9=9
#update repository for postgres 9.4 ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment