From d372ee7af9a6a21335d45d704482c5c3d7b77748 Mon Sep 17 00:00:00 2001 From: Richard Neese Date: Tue, 31 May 2016 20:01:33 -0500 Subject: [PATCH] moved dir --- README.md | 12 +- {debian => debian-pkgs}/install.sh | 2 +- .../resources/debian-repos.sh | 0 {debian => debian-pkgs}/resources/fail2ban.sh | 0 .../resources/fail2ban/freeswitch-dos.conf | 0 .../resources/fail2ban/freeswitch-ip.conf | 0 .../resources/fail2ban/freeswitch.conf | 0 .../resources/fail2ban/fusionpbx.conf | 0 .../resources/fail2ban/jail.package | 0 .../resources/fail2ban/jail.source | 0 .../resources/fail2ban/nginx-404.conf | 0 .../resources/fail2ban/nginx-dos.conf | 0 {debian => debian-pkgs}/resources/finish.sh | 56 +-- .../resources/freeswitch}/package-all.sh | 0 .../resources/freeswitch}/package-master.sh | 66 ++-- .../resources/freeswitch}/package-release.sh | 0 .../resources/freeswitch}/source-release.sh | 74 ++-- .../resources/fusionpbx-packages.sh | 0 .../resources/fusionpbx.sh | 0 {debian => debian-pkgs}/resources/iptables.sh | 0 {debian => debian-pkgs}/resources/logging.sh | 0 {debian => debian-pkgs}/resources/nginx.sh | 0 .../resources/nginx/fusionpbx | 356 +++++++++--------- .../resources/postgres-client.sh | 0 .../resources/postgres-server.sh | 0 .../resources/provision.sh | 0 26 files changed, 286 insertions(+), 280 deletions(-) rename {debian => debian-pkgs}/install.sh (97%) rename {debian => debian-pkgs}/resources/debian-repos.sh (100%) rename {debian => debian-pkgs}/resources/fail2ban.sh (100%) rename {debian => debian-pkgs}/resources/fail2ban/freeswitch-dos.conf (100%) rename {debian => debian-pkgs}/resources/fail2ban/freeswitch-ip.conf (100%) rename {debian => debian-pkgs}/resources/fail2ban/freeswitch.conf (100%) rename {debian => debian-pkgs}/resources/fail2ban/fusionpbx.conf (100%) rename {debian => debian-pkgs}/resources/fail2ban/jail.package (100%) rename {debian => debian-pkgs}/resources/fail2ban/jail.source (100%) rename {debian => debian-pkgs}/resources/fail2ban/nginx-404.conf (100%) rename {debian => debian-pkgs}/resources/fail2ban/nginx-dos.conf (100%) rename {debian => debian-pkgs}/resources/finish.sh (95%) rename {debian/resources/switch => debian-pkgs/resources/freeswitch}/package-all.sh (100%) rename {debian/resources/switch => debian-pkgs/resources/freeswitch}/package-master.sh (98%) rename {debian/resources/switch => debian-pkgs/resources/freeswitch}/package-release.sh (100%) rename {debian/resources/switch => debian-pkgs/resources/freeswitch}/source-release.sh (98%) rename {debian => debian-pkgs}/resources/fusionpbx-packages.sh (100%) rename {debian => debian-pkgs}/resources/fusionpbx.sh (100%) rename {debian => debian-pkgs}/resources/iptables.sh (100%) rename {debian => debian-pkgs}/resources/logging.sh (100%) rename {debian => debian-pkgs}/resources/nginx.sh (100%) rename {debian => debian-pkgs}/resources/nginx/fusionpbx (96%) rename {debian => debian-pkgs}/resources/postgres-client.sh (100%) rename {debian => debian-pkgs}/resources/postgres-server.sh (100%) rename {debian => debian-pkgs}/resources/provision.sh (100%) diff --git a/README.md b/README.md index e2782ac..1653f67 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ fusionpbx-install.sh -------------------------------------- -This install script that has been designed to be an fast, simple, and modular way to to install FusionPBX. Start with a minimal install of Debian 8 with SSH enabled. Run the following commands under root. It installs FusionPBX, FreeSWITCH release package and its dependencies, IPTables, Fail2ban, NGINX, PHP FPM, and PostgresQL. +This install script that has been designed to be an fast, simple, and modular way to to install FusionPBX. +Start with a minimal install of Debian 8 with SSH enabled. Run the following commands under root. It installs +FusionPBX, FreeSWITCH release package and its dependencies, IPTables, Fail2ban, NGINX, PHP FPM, and PostgresQL. ```bash apt-get update && apt-get upgrade && apt-get install -y git @@ -12,9 +14,13 @@ cd /usr/src/fusionpbx-install.sh/debian ./install.sh ``` -At the end of the install it will instruct you to go to the ip address of the server in your web browser to finish the install. It will also provide a random database password for you to use during the web based phase of the install. The install script builds the fusionpbx database so you will not need to use the create database username and password on the last page of the web based install. +At the end of the install it will instruct you to go to the ip address of the server in your web browser to finish the install. +It will also provide a random database password for you to use during the web based phase of the install. The install script +builds the fusionpbx database so you will not need to use the create database username and password on the last page of the +web based install. -After you have completed the install you can login with the username and password you chose during the install. After you login go to them menu then Advanced -> Upgrade select the checkbox for App defaults. +After you have completed the install you can login with the username and password you chose during the install. After you login +go to them menu then Advanced -> Upgrade select the checkbox for App defaults. ```bash systemctl daemon-reload diff --git a/debian/install.sh b/debian-pkgs/install.sh similarity index 97% rename from debian/install.sh rename to debian-pkgs/install.sh index 575da54..f7f8106 100644 --- a/debian/install.sh +++ b/debian-pkgs/install.sh @@ -36,7 +36,7 @@ apt-get -y install ntp service ntp res #FreeSWITCH -resources/switch/./package-release.sh +resources/freeswitch/./package-release.sh #resources/switch/./package-master.sh #resources/switch/./source-release.sh diff --git a/debian/resources/debian-repos.sh b/debian-pkgs/resources/debian-repos.sh similarity index 100% rename from debian/resources/debian-repos.sh rename to debian-pkgs/resources/debian-repos.sh diff --git a/debian/resources/fail2ban.sh b/debian-pkgs/resources/fail2ban.sh similarity index 100% rename from debian/resources/fail2ban.sh rename to debian-pkgs/resources/fail2ban.sh diff --git a/debian/resources/fail2ban/freeswitch-dos.conf b/debian-pkgs/resources/fail2ban/freeswitch-dos.conf similarity index 100% rename from debian/resources/fail2ban/freeswitch-dos.conf rename to debian-pkgs/resources/fail2ban/freeswitch-dos.conf diff --git a/debian/resources/fail2ban/freeswitch-ip.conf b/debian-pkgs/resources/fail2ban/freeswitch-ip.conf similarity index 100% rename from debian/resources/fail2ban/freeswitch-ip.conf rename to debian-pkgs/resources/fail2ban/freeswitch-ip.conf diff --git a/debian/resources/fail2ban/freeswitch.conf b/debian-pkgs/resources/fail2ban/freeswitch.conf similarity index 100% rename from debian/resources/fail2ban/freeswitch.conf rename to debian-pkgs/resources/fail2ban/freeswitch.conf diff --git a/debian/resources/fail2ban/fusionpbx.conf b/debian-pkgs/resources/fail2ban/fusionpbx.conf similarity index 100% rename from debian/resources/fail2ban/fusionpbx.conf rename to debian-pkgs/resources/fail2ban/fusionpbx.conf diff --git a/debian/resources/fail2ban/jail.package b/debian-pkgs/resources/fail2ban/jail.package similarity index 100% rename from debian/resources/fail2ban/jail.package rename to debian-pkgs/resources/fail2ban/jail.package diff --git a/debian/resources/fail2ban/jail.source b/debian-pkgs/resources/fail2ban/jail.source similarity index 100% rename from debian/resources/fail2ban/jail.source rename to debian-pkgs/resources/fail2ban/jail.source diff --git a/debian/resources/fail2ban/nginx-404.conf b/debian-pkgs/resources/fail2ban/nginx-404.conf similarity index 100% rename from debian/resources/fail2ban/nginx-404.conf rename to debian-pkgs/resources/fail2ban/nginx-404.conf diff --git a/debian/resources/fail2ban/nginx-dos.conf b/debian-pkgs/resources/fail2ban/nginx-dos.conf similarity index 100% rename from debian/resources/fail2ban/nginx-dos.conf rename to debian-pkgs/resources/fail2ban/nginx-dos.conf diff --git a/debian/resources/finish.sh b/debian-pkgs/resources/finish.sh similarity index 95% rename from debian/resources/finish.sh rename to debian-pkgs/resources/finish.sh index d19f00a..29e0ca5 100644 --- a/debian/resources/finish.sh +++ b/debian-pkgs/resources/finish.sh @@ -1,28 +1,28 @@ -#!/bin/bash -echo "Waiting for config.php to exist." -seconds=0 -while [ ! -f /tmp/test.txt ] && [ ! -f /tmp/test2.txt ] -do - echo -ne "$seconds\033[o\r" - sleep 1 - seconds=$((seconds+1)) -done - -if [ -f /tmp/test.txt ] || [ -f /tmp/test2.txt ] -then - echo "The config.php has been found." -fi - -echo "Waiting 30 more seconds before continuing." -seconds=0 -while [ $seconds -lt 30 ] -do - echo -ne "$seconds\033[o\r" - sleep 1 - seconds=$((seconds+1)) -done - -#restart freeswitch -/bin/systemctl daemon-reload -/bin/systemctl restart freeswitch - +#!/bin/bash +echo "Waiting for config.php to exist." +seconds=0 +while [ ! -f /tmp/test.txt ] && [ ! -f /tmp/test2.txt ] +do + echo -ne "$seconds\033[o\r" + sleep 1 + seconds=$((seconds+1)) +done + +if [ -f /tmp/test.txt ] || [ -f /tmp/test2.txt ] +then + echo "The config.php has been found." +fi + +echo "Waiting 30 more seconds before continuing." +seconds=0 +while [ $seconds -lt 30 ] +do + echo -ne "$seconds\033[o\r" + sleep 1 + seconds=$((seconds+1)) +done + +#restart freeswitch +/bin/systemctl daemon-reload +/bin/systemctl restart freeswitch + diff --git a/debian/resources/switch/package-all.sh b/debian-pkgs/resources/freeswitch/package-all.sh similarity index 100% rename from debian/resources/switch/package-all.sh rename to debian-pkgs/resources/freeswitch/package-all.sh diff --git a/debian/resources/switch/package-master.sh b/debian-pkgs/resources/freeswitch/package-master.sh similarity index 98% rename from debian/resources/switch/package-master.sh rename to debian-pkgs/resources/freeswitch/package-master.sh index e00a34f..90a549e 100644 --- a/debian/resources/switch/package-master.sh +++ b/debian-pkgs/resources/freeswitch/package-master.sh @@ -1,33 +1,33 @@ -#!/bin/sh -apt-get update && apt-get install -y --force-yes curl memcached haveged -curl https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add - -echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list -echo "deb http://files.freeswitch.org/repo/deb/debian-unstable/ jessie main" >> /etc/apt/sources.list.d/freeswitch.list -apt-get update && apt-get install -y --force-yes freeswitch-all freeswitch-all-dbg gdb -#apt-get remove freeswitch-all freeswitch-all-dbg -#rm /etc/apt/sources.list.d/freeswitch.list - -#set the file permissions -chown -R freeswitch:freeswitch /var/lib/freeswitch -chmod -R g+s /var/lib/freeswitch -setfacl -R -m u:www-data:rwx,g:www-data:rwx /var/lib/freeswitch -setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /var/lib/freeswitch - -chown -R freeswitch:freeswitch /usr/share/freeswitch -chmod -R g+s /usr/share/freeswitch -setfacl -R -m u:www-data:rwx,g:www-data:rwx /usr/share/freeswitch -setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /usr/share/freeswitch - -chown -R freeswitch:freeswitch /etc/freeswitch -chmod -R g+s /etc/freeswitch -setfacl -R -m u:www-data:rwx,g:www-data:rwx /etc/freeswitch -setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /etc/freeswitch - -chown -R freeswitch:freeswitch /var/log/freeswitch -setfacl -R -m u:www-data:rwx,g:www-data:rwx /var/log/freeswitch -setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /var/log/freeswitch - -chown -R freeswitch:freeswitch /usr/share/freeswitch/sounds -chmod -R g+s /usr/share/freeswitch/sounds -setfacl -R -m u:www-data:rwx,g:www-data:rwx /usr/share/freeswitch/sounds -setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /usr/share/freeswitch/sounds +#!/bin/sh +apt-get update && apt-get install -y --force-yes curl memcached haveged +curl https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add - +echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list +echo "deb http://files.freeswitch.org/repo/deb/debian-unstable/ jessie main" >> /etc/apt/sources.list.d/freeswitch.list +apt-get update && apt-get install -y --force-yes freeswitch-all freeswitch-all-dbg gdb +#apt-get remove freeswitch-all freeswitch-all-dbg +#rm /etc/apt/sources.list.d/freeswitch.list + +#set the file permissions +chown -R freeswitch:freeswitch /var/lib/freeswitch +chmod -R g+s /var/lib/freeswitch +setfacl -R -m u:www-data:rwx,g:www-data:rwx /var/lib/freeswitch +setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /var/lib/freeswitch + +chown -R freeswitch:freeswitch /usr/share/freeswitch +chmod -R g+s /usr/share/freeswitch +setfacl -R -m u:www-data:rwx,g:www-data:rwx /usr/share/freeswitch +setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /usr/share/freeswitch + +chown -R freeswitch:freeswitch /etc/freeswitch +chmod -R g+s /etc/freeswitch +setfacl -R -m u:www-data:rwx,g:www-data:rwx /etc/freeswitch +setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /etc/freeswitch + +chown -R freeswitch:freeswitch /var/log/freeswitch +setfacl -R -m u:www-data:rwx,g:www-data:rwx /var/log/freeswitch +setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /var/log/freeswitch + +chown -R freeswitch:freeswitch /usr/share/freeswitch/sounds +chmod -R g+s /usr/share/freeswitch/sounds +setfacl -R -m u:www-data:rwx,g:www-data:rwx /usr/share/freeswitch/sounds +setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /usr/share/freeswitch/sounds diff --git a/debian/resources/switch/package-release.sh b/debian-pkgs/resources/freeswitch/package-release.sh similarity index 100% rename from debian/resources/switch/package-release.sh rename to debian-pkgs/resources/freeswitch/package-release.sh diff --git a/debian/resources/switch/source-release.sh b/debian-pkgs/resources/freeswitch/source-release.sh similarity index 98% rename from debian/resources/switch/source-release.sh rename to debian-pkgs/resources/freeswitch/source-release.sh index 47a8eb5..dc36afa 100644 --- a/debian/resources/switch/source-release.sh +++ b/debian-pkgs/resources/freeswitch/source-release.sh @@ -1,37 +1,37 @@ -#!/bin/sh -echo "Installing the FreeSWITCH source" -DEBIAN_FRONTEND=none APT_LISTCHANGES_FRONTEND=none apt-get install -y --force-yes ntpdate libapache2-mod-log-sql-ssl libfreetype6-dev git-buildpackage doxygen yasm nasm gdb git build-essential automake autoconf 'libtool-bin|libtool' python uuid-dev zlib1g-dev 'libjpeg8-dev|libjpeg62-turbo-dev' libncurses5-dev libssl-dev libpcre3-dev libcurl4-openssl-dev libldns-dev libedit-dev libspeexdsp-dev libspeexdsp-dev libsqlite3-dev perl libgdbm-dev libdb-dev bison libvlc-dev libvlccore-dev vlc-nox pkg-config ccache libpng-dev libvpx-dev libyuv-dev libopenal-dev libbroadvoice-dev libcodec2-dev libflite-dev libg7221-dev libilbc-dev libmongoc-dev libsilk-dev libsoundtouch-dev libmagickcore-dev liblua5.2-dev libopus-dev libsndfile-dev libopencv-dev libavformat-dev libx264-dev erlang-dev libldap2-dev libmemcached-dev libperl-dev portaudio19-dev python-dev libsnmp-dev libyaml-dev libmp4v2-dev -apt-get install -y --force-yes unzip libpq-dev memcached libshout3-dev libvpx-dev libmpg123-dev libmp3lame-dev - -apt-get update && apt-get install -y --force-yes curl haveged -curl https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add - -echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list -apt-get update && apt-get upgrade -apt-get install -y --force-yes freeswitch-video-deps-most - -#git clone https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch -#git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch -cd /usr/src && wget http://files.freeswitch.org/freeswitch-releases/freeswitch-1.6.7.zip -unzip freeswitch-1.6.7.zip -rm -R freeswitch -cp -R freeswitch-1.6.7 freeswitch -cd freeswitch - -#./bootstrap.sh -j -sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_avmd:applications/mod_avmd:' -sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_callcenter:applications/mod_callcenter:' -sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_cidlookup:applications/mod_cidlookup:' -sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_memcache:applications/mod_memcache:' -sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_curl:applications/mod_curl:' -sed -i /usr/src/freeswitch/modules.conf -e s:'#formats/mod_shout:formats/mod_shout:' -#./configure --help -#./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support --enable-system-lua --disable-fhs -./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support -#make mod_shout-install -make -rm -rf /usr/local/freeswitch/{lib,mod,bin}/* -make install -make sounds-install moh-install -make hd-sounds-install hd-moh-install -make cd-sounds-install cd-moh-install -chown -R www-data:www-data /usr/local/freeswitch +#!/bin/sh +echo "Installing the FreeSWITCH source" +DEBIAN_FRONTEND=none APT_LISTCHANGES_FRONTEND=none apt-get install -y --force-yes ntpdate libapache2-mod-log-sql-ssl libfreetype6-dev git-buildpackage doxygen yasm nasm gdb git build-essential automake autoconf 'libtool-bin|libtool' python uuid-dev zlib1g-dev 'libjpeg8-dev|libjpeg62-turbo-dev' libncurses5-dev libssl-dev libpcre3-dev libcurl4-openssl-dev libldns-dev libedit-dev libspeexdsp-dev libspeexdsp-dev libsqlite3-dev perl libgdbm-dev libdb-dev bison libvlc-dev libvlccore-dev vlc-nox pkg-config ccache libpng-dev libvpx-dev libyuv-dev libopenal-dev libbroadvoice-dev libcodec2-dev libflite-dev libg7221-dev libilbc-dev libmongoc-dev libsilk-dev libsoundtouch-dev libmagickcore-dev liblua5.2-dev libopus-dev libsndfile-dev libopencv-dev libavformat-dev libx264-dev erlang-dev libldap2-dev libmemcached-dev libperl-dev portaudio19-dev python-dev libsnmp-dev libyaml-dev libmp4v2-dev +apt-get install -y --force-yes unzip libpq-dev memcached libshout3-dev libvpx-dev libmpg123-dev libmp3lame-dev + +apt-get update && apt-get install -y --force-yes curl haveged +curl https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add - +echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list +apt-get update && apt-get upgrade +apt-get install -y --force-yes freeswitch-video-deps-most + +#git clone https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch +#git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch +cd /usr/src && wget http://files.freeswitch.org/freeswitch-releases/freeswitch-1.6.7.zip +unzip freeswitch-1.6.7.zip +rm -R freeswitch +cp -R freeswitch-1.6.7 freeswitch +cd freeswitch + +#./bootstrap.sh -j +sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_avmd:applications/mod_avmd:' +sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_callcenter:applications/mod_callcenter:' +sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_cidlookup:applications/mod_cidlookup:' +sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_memcache:applications/mod_memcache:' +sed -i /usr/src/freeswitch/modules.conf -e s:'#applications/mod_curl:applications/mod_curl:' +sed -i /usr/src/freeswitch/modules.conf -e s:'#formats/mod_shout:formats/mod_shout:' +#./configure --help +#./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support --enable-system-lua --disable-fhs +./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support +#make mod_shout-install +make +rm -rf /usr/local/freeswitch/{lib,mod,bin}/* +make install +make sounds-install moh-install +make hd-sounds-install hd-moh-install +make cd-sounds-install cd-moh-install +chown -R www-data:www-data /usr/local/freeswitch diff --git a/debian/resources/fusionpbx-packages.sh b/debian-pkgs/resources/fusionpbx-packages.sh similarity index 100% rename from debian/resources/fusionpbx-packages.sh rename to debian-pkgs/resources/fusionpbx-packages.sh diff --git a/debian/resources/fusionpbx.sh b/debian-pkgs/resources/fusionpbx.sh similarity index 100% rename from debian/resources/fusionpbx.sh rename to debian-pkgs/resources/fusionpbx.sh diff --git a/debian/resources/iptables.sh b/debian-pkgs/resources/iptables.sh similarity index 100% rename from debian/resources/iptables.sh rename to debian-pkgs/resources/iptables.sh diff --git a/debian/resources/logging.sh b/debian-pkgs/resources/logging.sh similarity index 100% rename from debian/resources/logging.sh rename to debian-pkgs/resources/logging.sh diff --git a/debian/resources/nginx.sh b/debian-pkgs/resources/nginx.sh similarity index 100% rename from debian/resources/nginx.sh rename to debian-pkgs/resources/nginx.sh diff --git a/debian/resources/nginx/fusionpbx b/debian-pkgs/resources/nginx/fusionpbx similarity index 96% rename from debian/resources/nginx/fusionpbx rename to debian-pkgs/resources/nginx/fusionpbx index 76a39e1..a26b35a 100644 --- a/debian/resources/nginx/fusionpbx +++ b/debian-pkgs/resources/nginx/fusionpbx @@ -1,179 +1,179 @@ -server{ - listen 127.0.0.1:80; - server_name 127.0.0.1; - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - client_max_body_size 10M; - client_body_buffer_size 128k; - - location / { - root /var/www/fusionpbx; - index index.php; - } - - location ~ \.php$ { - fastcgi_pass unix:/var/run/php5-fpm.sock; - #fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name; - } - - # Disable viewing .htaccess & .htpassword & .db - location ~ .htaccess { - deny all; - } - location ~ .htpassword { - deny all; - } - location ~^.+.(db)$ { - deny all; - } -} - -server { - listen 80; - server_name fusionpbx; - if ($uri !~* ^.*provision.*$) { - rewrite ^(.*) https://$host$1 permanent; - break; - } - - #REST api - if ($uri ~* ^.*/api/.*$) { - rewrite ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 last; - break; - } - - #mitel - rewrite "^.*/provision/MN_([A-Fa-f0-9]{12})\.cfg" /app/provision/index.php?mac=$1&file=MN_%7b%24mac%7d.cfg last; - rewrite "^.*/provision/MN_Generic.cfg" /app/provision/index.php?mac=08000f000000&file=MN_Generic.cfg last; - - #grandstream - rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1; - - #aastra - #rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last; - - #yealink common - rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1; - - #yealink mac - rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last; - - #polycom - rewrite "^.*/provision/000000000000.cfg$" "/app/provison/?mac=$1&file={%24mac}.cfg"; - #rewrite "^.*/provision/sip_330(\.(ld))$" /includes/firmware/sip_330.$2; - rewrite "^.*/provision/features.cfg$" /app/provision/?mac=$1&file=features.cfg; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-sip.cfg$" /app/provision/?mac=$1&file=sip.cfg; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-phone.cfg$" /app/provision/?mac=$1; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-registration.cfg$" "/app/provision/?mac=$1&file={%24mac}-registration.cfg"; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-directory.xml$" "/app/provision/?mac=$1&file={%24mac}-directory.xml"; - - #cisco - rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last; - - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - client_max_body_size 10M; - client_body_buffer_size 128k; - - location / { - root /var/www/fusionpbx; - index index.php; - } - - location ~ \.php$ { - fastcgi_pass unix:/var/run/php5-fpm.sock; - #fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name; - } - - # Disable viewing .htaccess & .htpassword & .db - location ~ .htaccess { - deny all; - } - location ~ .htpassword { - deny all; - } - location ~^.+.(db)$ { - deny all; - } -} - -server { - listen 443; - server_name fusionpbx; - ssl on; - ssl_certificate /etc/ssl/certs/nginx.crt; - ssl_certificate_key /etc/ssl/private/nginx.key; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers HIGH:!ADH:!MD5; - - #REST api - if ($uri ~* ^.*/api/.*$) { - rewrite ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 last; - break; - } - - #mitel - rewrite "^.*/provision/MN_([A-Fa-f0-9]{12})\.cfg" /app/provision/index.php?mac=$1&file=MN_%7b%24mac%7d.cfg last; - rewrite "^.*/provision/MN_Generic.cfg" /app/provision/index.php?mac=08000f000000&file=MN_Generic.cfg last; - - #grandstriam - rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1; - - #aastra - #rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last; - - #yealink common - rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1; - - #yealink mac - rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last; - - #polycom - rewrite "^.*/provision/000000000000.cfg$" "/app/provison/?mac=$1&file={%24mac}.cfg"; - #rewrite "^.*/provision/sip_330(\.(ld))$" /includes/firmware/sip_330.$2; - rewrite "^.*/provision/features.cfg$" /app/provision/?mac=$1&file=features.cfg; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-sip.cfg$" /app/provision/?mac=$1&file=sip.cfg; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-phone.cfg$" /app/provision/?mac=$1; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-registration.cfg$" "/app/provision/?mac=$1&file={%24mac}-registration.cfg"; - - #cisco - rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last; - - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - - client_max_body_size 10M; - client_body_buffer_size 128k; - - location / { - root /var/www/fusionpbx; - index index.php; - } - - location ~ \.php$ { - fastcgi_pass unix:/var/run/php5-fpm.sock; - #fastcgi_pass 127.0.0.1:9000; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name; - } - - # Disable viewing .htaccess & .htpassword & .db - location ~ .htaccess { - deny all; - } - location ~ .htpassword { - deny all; - } - location ~^.+.(db)$ { - deny all; - } +server{ + listen 127.0.0.1:80; + server_name 127.0.0.1; + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + client_max_body_size 10M; + client_body_buffer_size 128k; + + location / { + root /var/www/fusionpbx; + index index.php; + } + + location ~ \.php$ { + fastcgi_pass unix:/var/run/php5-fpm.sock; + #fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name; + } + + # Disable viewing .htaccess & .htpassword & .db + location ~ .htaccess { + deny all; + } + location ~ .htpassword { + deny all; + } + location ~^.+.(db)$ { + deny all; + } +} + +server { + listen 80; + server_name fusionpbx; + if ($uri !~* ^.*provision.*$) { + rewrite ^(.*) https://$host$1 permanent; + break; + } + + #REST api + if ($uri ~* ^.*/api/.*$) { + rewrite ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 last; + break; + } + + #mitel + rewrite "^.*/provision/MN_([A-Fa-f0-9]{12})\.cfg" /app/provision/index.php?mac=$1&file=MN_%7b%24mac%7d.cfg last; + rewrite "^.*/provision/MN_Generic.cfg" /app/provision/index.php?mac=08000f000000&file=MN_Generic.cfg last; + + #grandstream + rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1; + + #aastra + #rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last; + + #yealink common + rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1; + + #yealink mac + rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last; + + #polycom + rewrite "^.*/provision/000000000000.cfg$" "/app/provison/?mac=$1&file={%24mac}.cfg"; + #rewrite "^.*/provision/sip_330(\.(ld))$" /includes/firmware/sip_330.$2; + rewrite "^.*/provision/features.cfg$" /app/provision/?mac=$1&file=features.cfg; + rewrite "^.*/provision/([A-Fa-f0-9]{12})-sip.cfg$" /app/provision/?mac=$1&file=sip.cfg; + rewrite "^.*/provision/([A-Fa-f0-9]{12})-phone.cfg$" /app/provision/?mac=$1; + rewrite "^.*/provision/([A-Fa-f0-9]{12})-registration.cfg$" "/app/provision/?mac=$1&file={%24mac}-registration.cfg"; + rewrite "^.*/provision/([A-Fa-f0-9]{12})-directory.xml$" "/app/provision/?mac=$1&file={%24mac}-directory.xml"; + + #cisco + rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last; + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + client_max_body_size 10M; + client_body_buffer_size 128k; + + location / { + root /var/www/fusionpbx; + index index.php; + } + + location ~ \.php$ { + fastcgi_pass unix:/var/run/php5-fpm.sock; + #fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name; + } + + # Disable viewing .htaccess & .htpassword & .db + location ~ .htaccess { + deny all; + } + location ~ .htpassword { + deny all; + } + location ~^.+.(db)$ { + deny all; + } +} + +server { + listen 443; + server_name fusionpbx; + ssl on; + ssl_certificate /etc/ssl/certs/nginx.crt; + ssl_certificate_key /etc/ssl/private/nginx.key; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!ADH:!MD5; + + #REST api + if ($uri ~* ^.*/api/.*$) { + rewrite ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 last; + break; + } + + #mitel + rewrite "^.*/provision/MN_([A-Fa-f0-9]{12})\.cfg" /app/provision/index.php?mac=$1&file=MN_%7b%24mac%7d.cfg last; + rewrite "^.*/provision/MN_Generic.cfg" /app/provision/index.php?mac=08000f000000&file=MN_Generic.cfg last; + + #grandstriam + rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1; + + #aastra + #rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last; + + #yealink common + rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1; + + #yealink mac + rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last; + + #polycom + rewrite "^.*/provision/000000000000.cfg$" "/app/provison/?mac=$1&file={%24mac}.cfg"; + #rewrite "^.*/provision/sip_330(\.(ld))$" /includes/firmware/sip_330.$2; + rewrite "^.*/provision/features.cfg$" /app/provision/?mac=$1&file=features.cfg; + rewrite "^.*/provision/([A-Fa-f0-9]{12})-sip.cfg$" /app/provision/?mac=$1&file=sip.cfg; + rewrite "^.*/provision/([A-Fa-f0-9]{12})-phone.cfg$" /app/provision/?mac=$1; + rewrite "^.*/provision/([A-Fa-f0-9]{12})-registration.cfg$" "/app/provision/?mac=$1&file={%24mac}-registration.cfg"; + + #cisco + rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last; + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + client_max_body_size 10M; + client_body_buffer_size 128k; + + location / { + root /var/www/fusionpbx; + index index.php; + } + + location ~ \.php$ { + fastcgi_pass unix:/var/run/php5-fpm.sock; + #fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name; + } + + # Disable viewing .htaccess & .htpassword & .db + location ~ .htaccess { + deny all; + } + location ~ .htpassword { + deny all; + } + location ~^.+.(db)$ { + deny all; + } } \ No newline at end of file diff --git a/debian/resources/postgres-client.sh b/debian-pkgs/resources/postgres-client.sh similarity index 100% rename from debian/resources/postgres-client.sh rename to debian-pkgs/resources/postgres-client.sh diff --git a/debian/resources/postgres-server.sh b/debian-pkgs/resources/postgres-server.sh similarity index 100% rename from debian/resources/postgres-server.sh rename to debian-pkgs/resources/postgres-server.sh diff --git a/debian/resources/provision.sh b/debian-pkgs/resources/provision.sh similarity index 100% rename from debian/resources/provision.sh rename to debian-pkgs/resources/provision.sh