#!/bin/bash BASEURL=http://ukr.pw # Random TCP port for php-fpm PORT=$(($RANDOM+9000)) # Interface to the Internet - i.e. the one default gateway is reachable through IF=`ip route show | grep default | cut -d' ' -f 5` # IP address of the Internet interface, will be used as a hostname IP=`ifconfig $IF | grep "inet addr" | cut -d':' -f 2 | cut -d' ' -f 1` cat > /etc/yum.repos.d/nginx.repo << EOF [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/ gpgcheck=0 enabled=1 EOF yum -y install nginx pushd cd /etc/nginx/ wget -q -O - $BASEURL/nginx/antiddos.conf.txt | sed -e "s/59038/$PORT/" -e "s/localhost/$IP/" > nginx.conf rm -rf conf.d sites* naxsi* scgi_params uwsgi_params wget -O static.conf $BASEURL/nginx/static.conf.txt service nginx start yum -y install http://mirror.webtatic.com/yum/el6/latest.rpm yum -y install php55w-fpm php55w-mysqlnd php55w-mbstring php55w-opcache yum -y install epel-release yum -y install fcgi cd /etc/php-fpm.d rm -f *.conf wget -q -O - $BASEURL/nginx/xxx.conf.txt | sed -e "s/59038/$PORT/" > xxx.conf service php-fpm start # Install a simple script which shows php status from command line wget -q -O - $BASEURL/nginx/sf.txt | sed -e "s/59038/$PORT/" > /bin/sf chmod 755 /bin/sf # Create /www/pma directory , distro-independent if [ ! -d /www/pma ]; then mkdir -p /www/pma; fi cd /www/pma # Create empty index.html, so http://IP/ shows blank page touch index.html popd