moved dir
This commit is contained in:
parent
44bc066a26
commit
d372ee7af9
12
README.md
12
README.md
|
|
@ -1,7 +1,9 @@
|
||||||
fusionpbx-install.sh
|
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
|
```bash
|
||||||
apt-get update && apt-get upgrade && apt-get install -y git
|
apt-get update && apt-get upgrade && apt-get install -y git
|
||||||
|
|
@ -12,9 +14,13 @@ cd /usr/src/fusionpbx-install.sh/debian
|
||||||
./install.sh
|
./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
|
```bash
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ apt-get -y install ntp
|
||||||
service ntp res
|
service ntp res
|
||||||
|
|
||||||
#FreeSWITCH
|
#FreeSWITCH
|
||||||
resources/switch/./package-release.sh
|
resources/freeswitch/./package-release.sh
|
||||||
#resources/switch/./package-master.sh
|
#resources/switch/./package-master.sh
|
||||||
#resources/switch/./source-release.sh
|
#resources/switch/./source-release.sh
|
||||||
|
|
||||||
|
|
@ -1,28 +1,28 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "Waiting for config.php to exist."
|
echo "Waiting for config.php to exist."
|
||||||
seconds=0
|
seconds=0
|
||||||
while [ ! -f /tmp/test.txt ] && [ ! -f /tmp/test2.txt ]
|
while [ ! -f /tmp/test.txt ] && [ ! -f /tmp/test2.txt ]
|
||||||
do
|
do
|
||||||
echo -ne "$seconds\033[o\r"
|
echo -ne "$seconds\033[o\r"
|
||||||
sleep 1
|
sleep 1
|
||||||
seconds=$((seconds+1))
|
seconds=$((seconds+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -f /tmp/test.txt ] || [ -f /tmp/test2.txt ]
|
if [ -f /tmp/test.txt ] || [ -f /tmp/test2.txt ]
|
||||||
then
|
then
|
||||||
echo "The config.php has been found."
|
echo "The config.php has been found."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Waiting 30 more seconds before continuing."
|
echo "Waiting 30 more seconds before continuing."
|
||||||
seconds=0
|
seconds=0
|
||||||
while [ $seconds -lt 30 ]
|
while [ $seconds -lt 30 ]
|
||||||
do
|
do
|
||||||
echo -ne "$seconds\033[o\r"
|
echo -ne "$seconds\033[o\r"
|
||||||
sleep 1
|
sleep 1
|
||||||
seconds=$((seconds+1))
|
seconds=$((seconds+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
#restart freeswitch
|
#restart freeswitch
|
||||||
/bin/systemctl daemon-reload
|
/bin/systemctl daemon-reload
|
||||||
/bin/systemctl restart freeswitch
|
/bin/systemctl restart freeswitch
|
||||||
|
|
||||||
|
|
@ -1,33 +1,33 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
apt-get update && apt-get install -y --force-yes curl memcached haveged
|
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 -
|
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/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
|
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 update && apt-get install -y --force-yes freeswitch-all freeswitch-all-dbg gdb
|
||||||
#apt-get remove freeswitch-all freeswitch-all-dbg
|
#apt-get remove freeswitch-all freeswitch-all-dbg
|
||||||
#rm /etc/apt/sources.list.d/freeswitch.list
|
#rm /etc/apt/sources.list.d/freeswitch.list
|
||||||
|
|
||||||
#set the file permissions
|
#set the file permissions
|
||||||
chown -R freeswitch:freeswitch /var/lib/freeswitch
|
chown -R freeswitch:freeswitch /var/lib/freeswitch
|
||||||
chmod -R g+s /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 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
|
setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /var/lib/freeswitch
|
||||||
|
|
||||||
chown -R freeswitch:freeswitch /usr/share/freeswitch
|
chown -R freeswitch:freeswitch /usr/share/freeswitch
|
||||||
chmod -R g+s /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 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
|
setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /usr/share/freeswitch
|
||||||
|
|
||||||
chown -R freeswitch:freeswitch /etc/freeswitch
|
chown -R freeswitch:freeswitch /etc/freeswitch
|
||||||
chmod -R g+s /etc/freeswitch
|
chmod -R g+s /etc/freeswitch
|
||||||
setfacl -R -m u:www-data:rwx,g:www-data:rwx /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
|
setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /etc/freeswitch
|
||||||
|
|
||||||
chown -R freeswitch:freeswitch /var/log/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 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
|
setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /var/log/freeswitch
|
||||||
|
|
||||||
chown -R freeswitch:freeswitch /usr/share/freeswitch/sounds
|
chown -R freeswitch:freeswitch /usr/share/freeswitch/sounds
|
||||||
chmod -R g+s /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 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
|
setfacl -R -m d:u:www-data:rwx,d:g:www-data:rwx /usr/share/freeswitch/sounds
|
||||||
|
|
@ -1,37 +1,37 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo "Installing the FreeSWITCH source"
|
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
|
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 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
|
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 -
|
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/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
|
||||||
apt-get update && apt-get upgrade
|
apt-get update && apt-get upgrade
|
||||||
apt-get install -y --force-yes freeswitch-video-deps-most
|
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 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
|
#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
|
cd /usr/src && wget http://files.freeswitch.org/freeswitch-releases/freeswitch-1.6.7.zip
|
||||||
unzip freeswitch-1.6.7.zip
|
unzip freeswitch-1.6.7.zip
|
||||||
rm -R freeswitch
|
rm -R freeswitch
|
||||||
cp -R freeswitch-1.6.7 freeswitch
|
cp -R freeswitch-1.6.7 freeswitch
|
||||||
cd freeswitch
|
cd freeswitch
|
||||||
|
|
||||||
#./bootstrap.sh -j
|
#./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_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_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_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_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:'#applications/mod_curl:applications/mod_curl:'
|
||||||
sed -i /usr/src/freeswitch/modules.conf -e s:'#formats/mod_shout:formats/mod_shout:'
|
sed -i /usr/src/freeswitch/modules.conf -e s:'#formats/mod_shout:formats/mod_shout:'
|
||||||
#./configure --help
|
#./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 --enable-system-lua --disable-fhs
|
||||||
./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support
|
./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support
|
||||||
#make mod_shout-install
|
#make mod_shout-install
|
||||||
make
|
make
|
||||||
rm -rf /usr/local/freeswitch/{lib,mod,bin}/*
|
rm -rf /usr/local/freeswitch/{lib,mod,bin}/*
|
||||||
make install
|
make install
|
||||||
make sounds-install moh-install
|
make sounds-install moh-install
|
||||||
make hd-sounds-install hd-moh-install
|
make hd-sounds-install hd-moh-install
|
||||||
make cd-sounds-install cd-moh-install
|
make cd-sounds-install cd-moh-install
|
||||||
chown -R www-data:www-data /usr/local/freeswitch
|
chown -R www-data:www-data /usr/local/freeswitch
|
||||||
|
|
@ -1,179 +1,179 @@
|
||||||
server{
|
server{
|
||||||
listen 127.0.0.1:80;
|
listen 127.0.0.1:80;
|
||||||
server_name 127.0.0.1;
|
server_name 127.0.0.1;
|
||||||
access_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
error_log /var/log/nginx/error.log;
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
client_max_body_size 10M;
|
client_max_body_size 10M;
|
||||||
client_body_buffer_size 128k;
|
client_body_buffer_size 128k;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /var/www/fusionpbx;
|
root /var/www/fusionpbx;
|
||||||
index index.php;
|
index index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||||
#fastcgi_pass 127.0.0.1:9000;
|
#fastcgi_pass 127.0.0.1:9000;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Disable viewing .htaccess & .htpassword & .db
|
# Disable viewing .htaccess & .htpassword & .db
|
||||||
location ~ .htaccess {
|
location ~ .htaccess {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~ .htpassword {
|
location ~ .htpassword {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~^.+.(db)$ {
|
location ~^.+.(db)$ {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name fusionpbx;
|
server_name fusionpbx;
|
||||||
if ($uri !~* ^.*provision.*$) {
|
if ($uri !~* ^.*provision.*$) {
|
||||||
rewrite ^(.*) https://$host$1 permanent;
|
rewrite ^(.*) https://$host$1 permanent;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#REST api
|
#REST api
|
||||||
if ($uri ~* ^.*/api/.*$) {
|
if ($uri ~* ^.*/api/.*$) {
|
||||||
rewrite ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 last;
|
rewrite ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 last;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mitel
|
#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_([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;
|
rewrite "^.*/provision/MN_Generic.cfg" /app/provision/index.php?mac=08000f000000&file=MN_Generic.cfg last;
|
||||||
|
|
||||||
#grandstream
|
#grandstream
|
||||||
rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1;
|
rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1;
|
||||||
|
|
||||||
#aastra
|
#aastra
|
||||||
#rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last;
|
#rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last;
|
||||||
|
|
||||||
#yealink common
|
#yealink common
|
||||||
rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1;
|
rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1;
|
||||||
|
|
||||||
#yealink mac
|
#yealink mac
|
||||||
rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last;
|
rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last;
|
||||||
|
|
||||||
#polycom
|
#polycom
|
||||||
rewrite "^.*/provision/000000000000.cfg$" "/app/provison/?mac=$1&file={%24mac}.cfg";
|
rewrite "^.*/provision/000000000000.cfg$" "/app/provison/?mac=$1&file={%24mac}.cfg";
|
||||||
#rewrite "^.*/provision/sip_330(\.(ld))$" /includes/firmware/sip_330.$2;
|
#rewrite "^.*/provision/sip_330(\.(ld))$" /includes/firmware/sip_330.$2;
|
||||||
rewrite "^.*/provision/features.cfg$" /app/provision/?mac=$1&file=features.cfg;
|
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})-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})-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})-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";
|
rewrite "^.*/provision/([A-Fa-f0-9]{12})-directory.xml$" "/app/provision/?mac=$1&file={%24mac}-directory.xml";
|
||||||
|
|
||||||
#cisco
|
#cisco
|
||||||
rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last;
|
rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last;
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
error_log /var/log/nginx/error.log;
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
client_max_body_size 10M;
|
client_max_body_size 10M;
|
||||||
client_body_buffer_size 128k;
|
client_body_buffer_size 128k;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /var/www/fusionpbx;
|
root /var/www/fusionpbx;
|
||||||
index index.php;
|
index index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||||
#fastcgi_pass 127.0.0.1:9000;
|
#fastcgi_pass 127.0.0.1:9000;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Disable viewing .htaccess & .htpassword & .db
|
# Disable viewing .htaccess & .htpassword & .db
|
||||||
location ~ .htaccess {
|
location ~ .htaccess {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~ .htpassword {
|
location ~ .htpassword {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~^.+.(db)$ {
|
location ~^.+.(db)$ {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 443;
|
listen 443;
|
||||||
server_name fusionpbx;
|
server_name fusionpbx;
|
||||||
ssl on;
|
ssl on;
|
||||||
ssl_certificate /etc/ssl/certs/nginx.crt;
|
ssl_certificate /etc/ssl/certs/nginx.crt;
|
||||||
ssl_certificate_key /etc/ssl/private/nginx.key;
|
ssl_certificate_key /etc/ssl/private/nginx.key;
|
||||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||||
ssl_ciphers HIGH:!ADH:!MD5;
|
ssl_ciphers HIGH:!ADH:!MD5;
|
||||||
|
|
||||||
#REST api
|
#REST api
|
||||||
if ($uri ~* ^.*/api/.*$) {
|
if ($uri ~* ^.*/api/.*$) {
|
||||||
rewrite ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 last;
|
rewrite ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 last;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mitel
|
#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_([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;
|
rewrite "^.*/provision/MN_Generic.cfg" /app/provision/index.php?mac=08000f000000&file=MN_Generic.cfg last;
|
||||||
|
|
||||||
#grandstriam
|
#grandstriam
|
||||||
rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1;
|
rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1;
|
||||||
|
|
||||||
#aastra
|
#aastra
|
||||||
#rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last;
|
#rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last;
|
||||||
|
|
||||||
#yealink common
|
#yealink common
|
||||||
rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1;
|
rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1;
|
||||||
|
|
||||||
#yealink mac
|
#yealink mac
|
||||||
rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last;
|
rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last;
|
||||||
|
|
||||||
#polycom
|
#polycom
|
||||||
rewrite "^.*/provision/000000000000.cfg$" "/app/provison/?mac=$1&file={%24mac}.cfg";
|
rewrite "^.*/provision/000000000000.cfg$" "/app/provison/?mac=$1&file={%24mac}.cfg";
|
||||||
#rewrite "^.*/provision/sip_330(\.(ld))$" /includes/firmware/sip_330.$2;
|
#rewrite "^.*/provision/sip_330(\.(ld))$" /includes/firmware/sip_330.$2;
|
||||||
rewrite "^.*/provision/features.cfg$" /app/provision/?mac=$1&file=features.cfg;
|
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})-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})-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})-registration.cfg$" "/app/provision/?mac=$1&file={%24mac}-registration.cfg";
|
||||||
|
|
||||||
#cisco
|
#cisco
|
||||||
rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last;
|
rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last;
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
error_log /var/log/nginx/error.log;
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
client_max_body_size 10M;
|
client_max_body_size 10M;
|
||||||
client_body_buffer_size 128k;
|
client_body_buffer_size 128k;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /var/www/fusionpbx;
|
root /var/www/fusionpbx;
|
||||||
index index.php;
|
index index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||||
#fastcgi_pass 127.0.0.1:9000;
|
#fastcgi_pass 127.0.0.1:9000;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME /var/www/fusionpbx$fastcgi_script_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Disable viewing .htaccess & .htpassword & .db
|
# Disable viewing .htaccess & .htpassword & .db
|
||||||
location ~ .htaccess {
|
location ~ .htaccess {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~ .htpassword {
|
location ~ .htpassword {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
location ~^.+.(db)$ {
|
location ~^.+.(db)$ {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue