Files
fusionpbx-install.sh/centos/resources/nginx.sh
erxspin 5a2f3521cb Bug fix exec permissions CentOS - part 1 (#89)
* added CentOS, Fedora, RHEL choices with minimal version check (recommited)

* fixed small typos

* added special option --use-php5-package

* parse options and export new environment variable USE_PHP5_PACKAGE

* added choice between php5* or php7.0* packages (recommited)

* fixed php*-fpm service name and php.ini file path (recommited)

* prepare socket name for nginx to work with php5-fpm or php7.0-fpm (recommited)

* added ppa:ondrej/php5-compat repo

* added dependency ppa:ondrej/php repo and package software-properties-common

* added execute permissions to ./centos/*.sh files
2017-03-17 17:44:14 -06:00

25 lines
936 B
Bash
Executable File

#!/bin/sh
#move to script directory so all relative paths work
cd "$(dirname "$0")"
. ./colors.sh
. ./arguments.sh
verbose "Installing nginx"
#install dependencies
yum -y install nginx php-fpm php-gd php-pgsql php-odbc php-curl php-imap php-mcrypt php-opcache php-common php-pdo php-soap php-xml php-xmlrpc php-cli
#setup nginx
mkdir -p /etc/nginx/sites-available
mkdir -p /etc/nginx/sites-enabled
#enable fusionpbx nginx config
cp ./nginx/fusionpbx /etc/nginx/sites-available/fusionpbx.conf
ln -s /etc/nginx/sites-available/fusionpbx.conf /etc/nginx/sites-enabled/fusionpbx.conf
awk '/server *{/ {c=1 ; next} c && /{/{c++} c && /}/{c--;next} !c' /etc/nginx/nginx.conf > /etc/nginx/nginx.tmp && mv -f /etc/nginx/nginx.tmp /etc/nginx/nginx.conf && rm -f /etc/nginx/nginx.tmp
sed -i '/include \/etc\/nginx\/conf\.d\/\*\.conf\;/a \ include \/etc\/nginx\/sites-enabled\/\*\.conf\;' /etc/nginx/nginx.conf
verbose "nginx installed"