Forked from simkimsia/installation-12-10-ubuntu.sh
Last active
December 30, 2015 18:29
-
-
Save aikchun/7868339 to your computer and use it in GitHub Desktop.
Revisions
-
aikchun revised this gist
May 4, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ # Ubuntu 12.10 based web server installation script # Run this by executing the following from a fresh install of Ubuntu 12.10 server: # # bash -c "$(curl -fsSL https://gist.githubusercontent.com/AikChun/7868339/raw/installation-12-10-ubuntu.sh)" <mysqlPassword> # # Be sure to replace <mysqlPassword> with your intended MySQL Password. # Also, run this as root, unless you enjoy failing. -
aikchun revised this gist
May 4, 2014 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -80,7 +80,6 @@ apt-get install \ php5-cli \ php5-common \ php5-curl \ php5-fpm \ php5-gd \ php5-geoip \ -
aikchun revised this gist
Dec 9, 2013 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ # a server doesn't disrupt the installation process. If you want to do this, just # do the following before running the main bash command: # # apt-get install screen --force-yes -y # screen # # To recover your session if you are disconnected, ssh to your server as root again, @@ -48,27 +48,27 @@ export DEBIAN_FRONTEND=noninteractive ## System Updates ######################################## apt-get update -y apt-get dist-upgrade --force-yes -y --fix-missing apt-get install \ curl \ aptitude \ --force-yes -y --fix-missing apt-get upgrade --force-yes -y --fix-missing ######################################## ## Tools and Utilities ######################################## apt-get install git-core --force-yes -y --fix-missing apt-get install xclip --force-yes -y --fix-missing ######################################## ## MySQL ######################################## apt-get install \ mysql-client \ mysql-server \ --force-yes -y --fix-missing mysqladmin -u root password $MYSQLPASS @@ -94,7 +94,7 @@ apt-get install \ php-apc \ php-pear \ php5-xdebug \ --force-yes -y --fix-missing ######################################## ## Install PHPUnit via PEAR @@ -171,7 +171,7 @@ echo "$FILECONTENT" > /etc/php5/fpm/pool.d/www.conf ######################################## apt-get install \ nginx \ --force-yes -y --fix-missing ## CakePHP Configuration read -r -d '' FILECONTENT <<'ENDFILECONTENT' @@ -376,4 +376,4 @@ chsh -s /bin/bash www-data ######################################## ## Remove any unwanted packages ######################################## apt-get autoremove --force-yes -y --fix-missing -
simkimsia revised this gist
Dec 6, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ # Ubuntu 12.10 based web server installation script # Run this by executing the following from a fresh install of Ubuntu 12.10 server: # # bash -c "$(curl -fsSL https://gist.github.com/simkimsia/4372049/raw/e95e752256543f82e0633edf125e42000237eca2/installation-12-10-ubuntu.sh)" <mysqlPassword> # # Be sure to replace <mysqlPassword> with your intended MySQL Password. # Also, run this as root, unless you enjoy failing. -
simkimsia revised this gist
Nov 24, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -102,6 +102,7 @@ apt-get install \ ### upgrade pear pear upgrade pear pear config-set auto_discover 1 ### install phpunit dependencies pear channel-discover pear.phpunit.de @@ -114,7 +115,7 @@ pear install --alldeps phpunit/PHPUnit ## Install PHPQATools courtesy of http://phpqatools.org/ via PEAR ######################################## ##pear config-set auto_discover 1 if you haven't done it already pear install pear.phpqatools.org/phpqatools ######################################## -
simkimsia revised this gist
Jun 10, 2013 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -366,9 +366,11 @@ git clone -b 2.4 git://github.com/cakephp/cakephp.git cakephp-2.4 "' ######################################## ## Add www-data to sudoers and do other www-data related commands ######################################## adduser www-data sudo ## this is to change the shell for www-data because www-data default shell is /bin/sh chsh -s /bin/bash www-data ######################################## ## Remove any unwanted packages -
simkimsia revised this gist
Jun 7, 2013 . 1 changed file with 2 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -59,12 +59,8 @@ apt-get upgrade -y ######################################## ## Tools and Utilities ######################################## apt-get install git-core -y apt-get install xclip -y ######################################## ## MySQL -
simkimsia revised this gist
Mar 9, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,7 +47,8 @@ export DEBIAN_FRONTEND=noninteractive ######################################## ## System Updates ######################################## apt-get update -y apt-get dist-upgrade -y apt-get install \ curl \ aptitude \ -
simkimsia revised this gist
Mar 9, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -317,7 +317,7 @@ server { listen 80; client_max_body_size 2M; server_name cakephpsite.com; root /var/virtual/cakephp-2.4/cakephpsite.com/webroot; access_log /var/log/nginx/cakephpsite.com-access.log; include common.conf; include cakephp.conf; @@ -365,7 +365,7 @@ mkdir -p /var/www chown www-data:www-data /var/virtual /var/www su www-data -c 'bash -c " cd /var/virtual git clone -b 2.4 git://github.com/cakephp/cakephp.git cakephp-2.4 "' ######################################## -
simkimsia revised this gist
Feb 7, 2013 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -315,6 +315,7 @@ echo "$FILECONTENT" > /etc/nginx/sites-available/default read -r -d '' FILECONTENT <<'ENDFILECONTENT' server { listen 80; client_max_body_size 2M; server_name cakephpsite.com; root /var/virtual/cakephp-2.3/cakephpsite.com/webroot; access_log /var/log/nginx/cakephpsite.com-access.log; @@ -323,6 +324,7 @@ server { } server { listen 80; client_max_body_size 2M; server_name www.cakephpsite.com; rewrite ^ http://cakephpsite.com$uri permanent; } @@ -334,6 +336,7 @@ echo "$FILECONTENT" > /etc/nginx/sites-available/cakephp.example read -r -d '' FILECONTENT <<'ENDFILECONTENT' server { listen 80; client_max_body_size 2M; server_name phpsite.com; root /var/virtual/phpsite.com; access_log /var/log/nginx/phpsite.com-access.log; @@ -342,6 +345,7 @@ server { } server { listen 80; client_max_body_size 2M; server_name www.phpsite.com; rewrite ^ http://phpsite.com$uri permanent; } -
simkimsia revised this gist
Jan 21, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -135,6 +135,7 @@ pear install cakephp/CakePHP_CodeSniffer ######################################## ## Install apigen ######################################## pear channel-discover pear.apigen.org pear install pear.apigen.org/apigen ######################################## -
simkimsia revised this gist
Jan 21, 2013 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -132,6 +132,11 @@ pear install phing/phing pear channel-discover pear.cakephp.org pear install cakephp/CakePHP_CodeSniffer ######################################## ## Install apigen ######################################## pear install pear.apigen.org/apigen ######################################## ## Configure PHP-FPM ######################################## -
simkimsia revised this gist
Jan 19, 2013 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -126,6 +126,12 @@ pear install pear.phpqatools.org/phpqatools pear channel-discover pear.phing.info pear install phing/phing ######################################## ## Install cakephp codesniffer ######################################## pear channel-discover pear.cakephp.org pear install cakephp/CakePHP_CodeSniffer ######################################## ## Configure PHP-FPM ######################################## -
simkimsia revised this gist
Jan 16, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -96,6 +96,7 @@ apt-get install \ php5-mysql \ php-apc \ php-pear \ php5-xdebug \ -y ######################################## -
simkimsia revised this gist
Jan 15, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -123,7 +123,7 @@ pear install pear.phpqatools.org/phpqatools ## Install Phing courtesy of http://www.phing.info/docs/guide/stable/ via PEAR ######################################## pear channel-discover pear.phing.info pear install phing/phing ######################################## ## Configure PHP-FPM -
simkimsia revised this gist
Jan 15, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -110,14 +110,14 @@ pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear channel-discover pear.symfony.com pear install --alldeps phpunit/PHPUnit ######################################## ## Install PHPQATools courtesy of http://phpqatools.org/ via PEAR ######################################## pear config-set auto_discover 1 pear install pear.phpqatools.org/phpqatools ######################################## ## Install Phing courtesy of http://www.phing.info/docs/guide/stable/ via PEAR -
simkimsia revised this gist
Jan 15, 2013 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -110,7 +110,6 @@ pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear channel-discover pear.symfony.com pear install --alldeps phpunit/PHPUnit -y ######################################## -
simkimsia revised this gist
Jan 14, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,7 @@ if [ $# -ne $EXPECTEDARGS -o "x$0" == "x" -o $0 == "bash" ]; then exit 1 fi MYSQLPASS=$0 export DEBIAN_FRONTEND=noninteractive -
simkimsia revised this gist
Jan 14, 2013 . 1 changed file with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export DEBIAN_FRONTEND=noninteractive ######################################## ## System Updates ######################################## apt-get update && apt-get dist-upgrade -y apt-get install \ curl \ aptitude \ @@ -355,4 +355,9 @@ git clone -b 2.3 git://github.com/cakephp/cakephp.git cakephp-2.3 ######################################## ## Add www-data to sudoers ######################################## adduser www-data sudo ######################################## ## Remove any unwanted packages ######################################## apt-get autoremove -y -
simkimsia revised this gist
Jan 14, 2013 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -110,21 +110,21 @@ pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear channel-discover pear.symfony.com pear install pear.symfony.com/Yaml -y pear install --alldeps phpunit/PHPUnit -y ######################################## ## Install PHPQATools courtesy of http://phpqatools.org/ via PEAR ######################################## pear config-set auto_discover 1 pear install pear.phpqatools.org/phpqatools -y ######################################## ## Install Phing courtesy of http://www.phing.info/docs/guide/stable/ via PEAR ######################################## pear channel-discover pear.phing.info pear install phing/phing -y ######################################## ## Configure PHP-FPM -
simkimsia revised this gist
Jan 9, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,6 +61,7 @@ apt-get upgrade -y apt-get install \ git-core \ subversion \ xclip -y -
simkimsia revised this gist
Jan 4, 2013 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -349,4 +349,9 @@ chown www-data:www-data /var/virtual /var/www su www-data -c 'bash -c " cd /var/virtual git clone -b 2.3 git://github.com/cakephp/cakephp.git cakephp-2.3 "' ######################################## ## Add www-data to sudoers ######################################## adduser www-data sudo -
simkimsia revised this gist
Dec 27, 2012 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -119,6 +119,12 @@ pear install --alldeps phpunit/PHPUnit pear config-set auto_discover 1 pear install pear.phpqatools.org/phpqatools ######################################## ## Install Phing courtesy of http://www.phing.info/docs/guide/stable/ via PEAR ######################################## pear channel-discover pear.phing.info pear install phing/phing ######################################## ## Configure PHP-FPM ######################################## -
simkimsia revised this gist
Dec 26, 2012 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -112,6 +112,13 @@ pear channel-discover pear.symfony.com pear install pear.symfony.com/Yaml pear install --alldeps phpunit/PHPUnit ######################################## ## Install PHPQATools courtesy of http://phpqatools.org/ via PEAR ######################################## pear config-set auto_discover 1 pear install pear.phpqatools.org/phpqatools ######################################## ## Configure PHP-FPM ######################################## -
simkimsia renamed this gist
Dec 25, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
simkimsia revised this gist
Dec 25, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -290,7 +290,7 @@ read -r -d '' FILECONTENT <<'ENDFILECONTENT' server { listen 80; server_name cakephpsite.com; root /var/virtual/cakephp-2.3/cakephpsite.com/webroot; access_log /var/log/nginx/cakephpsite.com-access.log; include common.conf; include cakephp.conf; -
simkimsia revised this gist
Dec 25, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -108,6 +108,8 @@ pear upgrade pear pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear channel-discover pear.symfony.com pear install pear.symfony.com/Yaml pear install --alldeps phpunit/PHPUnit ######################################## -
simkimsia renamed this gist
Dec 25, 2012 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ ### # # forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea # Copyright (c) 2011 Cake Development Corporation (http//cakedc.com) # # Ubuntu 12.10 based web server installation script # Run this by executing the following from a fresh install of Ubuntu 12.10 server: @@ -332,6 +332,6 @@ mkdir -p /var/virtual mkdir -p /var/www chown www-data:www-data /var/virtual /var/www su www-data -c 'bash -c " cd /var/virtual git clone -b 2.3 git://github.com/cakephp/cakephp.git cakephp-2.3 "' -
simkimsia revised this gist
Dec 25, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ # Ubuntu 12.10 based web server installation script # Run this by executing the following from a fresh install of Ubuntu 12.10 server: # # bash -c "$(curl -fsSL https://raw.github.com/gist/4372049)" <mysqlPassword> # # Be sure to replace <mysqlPassword> with your intended MySQL Password. # Also, run this as root, unless you enjoy failing. -
simkimsia created this gist
Dec 25, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,337 @@ #!/bin/bash ### # # forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea # Copyright (c) 2011 Cake Development Corporation (http://cakedc.com) # # Ubuntu 12.10 based web server installation script # Run this by executing the following from a fresh install of Ubuntu 12.10 server: # # bash -c "$(curl -fsSL https://raw.github.com/gist/2598935)" <mysqlPassword> # # Be sure to replace <mysqlPassword> with your intended MySQL Password. # Also, run this as root, unless you enjoy failing. # # Its handy to install 'screen' if you want to ensure your remote connection to # a server doesn't disrupt the installation process. If you want to do this, just # do the following before running the main bash command: # # apt-get install screen -y # screen # # To recover your session if you are disconnected, ssh to your server as root again, # and type: # # screen -x # # Dependencies: # - curl # # Todo: # - SSL Configuration # ### EXPECTEDARGS=0 if [ $# -ne $EXPECTEDARGS -o "x$0" == "x" -o $0 == "bash" ]; then echo "Usage:" echo " Parameter 1: MySQL root password" exit 1 fi MYSQLPASS=$1 export DEBIAN_FRONTEND=noninteractive ######################################## ## System Updates ######################################## apt-get update apt-get install \ curl \ aptitude \ -y apt-get upgrade -y ######################################## ## Tools and Utilities ######################################## apt-get install \ git-core \ subversion \ -y ######################################## ## MySQL ######################################## apt-get install \ mysql-client \ mysql-server \ -y mysqladmin -u root password $MYSQLPASS ######################################## ## PHP ######################################## apt-get install \ php5 \ php5-cli \ php5-common \ php5-curl \ php5-ffmpeg \ php5-fpm \ php5-gd \ php5-geoip \ php5-gmp \ php5-imagick \ php5-intl \ php5-json \ php5-mcrypt \ php5-memcached \ php5-mysql \ php-apc \ php-pear \ -y ######################################## ## Install PHPUnit via PEAR ######################################## ### upgrade pear pear upgrade pear ### install phpunit dependencies pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear install --alldeps phpunit/PHPUnit ######################################## ## Configure PHP-FPM ######################################## read -r -d '' FILECONTENT <<'ENDFILECONTENT' [www] listen = 127.0.0.1:9000 listen.allowed_clients = 127.0.0.1 user = www-data group = www-data pm = dynamic pm.max_children = 50 pm.start_servers = 25 pm.min_spare_servers = 5 pm.max_spare_servers = 35 pm.max_requests = 2500 pm.status_path = /php-status slowlog = log/$pool.log.slow chdir = / ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected] ;php_flag[display_errors] = off ;php_admin_value[error_log] = /var/log/fpm-php.www.log ;php_admin_flag[log_errors] = on ;php_admin_value[memory_limit] = 32M ENDFILECONTENT cp /etc/php5/fpm/pool.d/www.conf /etc/php5/fpm/pool.d/www.conf.original echo "$FILECONTENT" > /etc/php5/fpm/pool.d/www.conf /etc/init.d/php5-fpm restart ######################################## ## Nginx ######################################## apt-get install \ nginx \ -y ## CakePHP Configuration read -r -d '' FILECONTENT <<'ENDFILECONTENT' include php.conf; location / { try_files $uri $uri/ /index.php?$uri&$args; expires max; access_log off; } ENDFILECONTENT echo "$FILECONTENT" > /etc/nginx/cakephp.conf ## Common Configuration read -r -d '' FILECONTENT <<'ENDFILECONTENT' index index.html; location ~ /\.ht { deny all; } ENDFILECONTENT echo "$FILECONTENT" > /etc/nginx/common.conf ## FastCGI Configuration read -r -d '' FILECONTENT <<'ENDFILECONTENT' fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param HTTPS $ssl_session_id; fastcgi_index index.php; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; fastcgi_connect_timeout 60; fastcgi_read_timeout 180; fastcgi_send_timeout 180; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; fastcgi_intercept_errors on; ENDFILECONTENT echo "$FILECONTENT" > /etc/nginx/fastcgi_params ## Nginx Main Configuration read -r -d '' FILECONTENT <<'ENDFILECONTENT' user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 768; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 2; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; gzip_disable "msie6"; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } ENDFILECONTENT echo "$FILECONTENT" > /etc/nginx/nginx.conf ## PHP Configuration read -r -d '' FILECONTENT <<'ENDFILECONTENT' location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; } index index.php; ENDFILECONTENT echo "$FILECONTENT" > /etc/nginx/php.conf ## Default Site Configuration read -r -d '' FILECONTENT <<'ENDFILECONTENT' server { listen 80; ## listen for ipv4; this line is default and implied root /usr/share/nginx/www; index index.html index.htm; server_name localhost; location / { try_files $uri $uri/ /index.html; } location /doc { root /usr/share; autoindex on; allow 127.0.0.1; deny all; } location /images { root /usr/share; autoindex off; } } ENDFILECONTENT echo "$FILECONTENT" > /etc/nginx/sites-available/default ## Example CakePHP Site read -r -d '' FILECONTENT <<'ENDFILECONTENT' server { listen 80; server_name cakephpsite.com; root /var/virtual/cakephp-2.0/cakephpsite.com/webroot; access_log /var/log/nginx/cakephpsite.com-access.log; include common.conf; include cakephp.conf; } server { listen 80; server_name www.cakephpsite.com; rewrite ^ http://cakephpsite.com$uri permanent; } ENDFILECONTENT echo "$FILECONTENT" > /etc/nginx/sites-available/cakephp.example ## Example Plain PHP Site read -r -d '' FILECONTENT <<'ENDFILECONTENT' server { listen 80; server_name phpsite.com; root /var/virtual/phpsite.com; access_log /var/log/nginx/phpsite.com-access.log; include common.conf; include php.conf; } server { listen 80; server_name www.phpsite.com; rewrite ^ http://phpsite.com$uri permanent; } ENDFILECONTENT echo "$FILECONTENT" > /etc/nginx/sites-available/php.example /etc/init.d/nginx restart ######################################## ## CakePHP and Sites ######################################## mkdir -p /var/virtual mkdir -p /var/www chown www-data:www-data /var/virtual /var/www su www-data -c 'bash -c " cd /var/virtual git clone -b 2.0 git://github.com/cakephp/cakephp.git cakephp-2.0 "'