Skip to content

Instantly share code, notes, and snippets.

@ozeias
ozeias / gist:47048
Created January 14, 2009 20:23
Nginx requirements
railsbox.org:~ ozeias$ apt-get update
railsbox.org:~ ozeias$ apt-get dist-upgrade
railsbox.org:~ ozeias$ apt-get install build-essential
railsbox.org:~ ozeias$ apt-get install vim
railsbox.org:~ ozeias$ apt-get install zlibc openssl libpcre3 libpcre3-dev libcompress-zlib-perl libpcrecpp0 pcregrep
@ozeias
ozeias / gist:47058
Created January 14, 2009 20:35
Build Nginx
railsbox.org:~ ozeias$ wget http://sysoev.ru/nginx/nginx-0.6.34.tar.gz
railsbox.org:~ ozeias$ tar xvf nginx-0.6.34.tar.gz
railsbox.org:~ ozeias$ ./configure
railsbox.org:~ ozeias$ make
railsbox.org:~ ozeias$ sudo make install
@ozeias
ozeias / nginx.conf
Created January 14, 2009 20:55
nginx.conf
## railsbox.org:~ ozeias$ vim /usr/local/nginx/conf/nginx.conf
user www-data;
worker_processes 4;
error_log /usr/local/nginx/logs/error.log;
pid /usr/local/nginx/logs/nginx.pid;
events {
worker_connections 1024;
}
@ozeias
ozeias / nginx.sh
Created January 14, 2009 21:04
starts nginx using start-stop-daemon
## railsbox.org:~ ozeias$ vim /etc/init.d/nginx
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
@ozeias
ozeias / gist:47392
Created January 15, 2009 12:37
Install PHP CGI by apt-get
railsbox.org:~ ozeias$ sudo apt-get install php5-cgi php5-mysql
railsbox.org:~ ozeias$ sudo apt-get install lighttpd
railsbox.org:~ ozeias$ sudo /etc/init.d/lighttpd stop
railsbox.org:~ ozeias$ sudo rm /etc/init.d/lighttpd
railsbox.org:~ ozeias$ sudo update-rc.d lighttpd remove
@ozeias
ozeias / spawn-fcgi.sh
Created January 15, 2009 12:49
starts FastCGI for PHP using start-stop-daemon
## railsbox.org:~ ozeias$ vim /etc/init.d/spawn-fcgi
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts FastCGI for PHP
railsbox.org:~ ozeias$ cd /etc/init.d
railsbox.org:~ ozeias$ sudo update-rc.d spawn-fcgi defaults
@ozeias
ozeias / gist:47413
Created January 15, 2009 14:00
Install PHP CGI using source
railsbox.org:~ ozeias$ sudo apt-get install libtool libltdl3-dev libgd-dev libmcrypt-dev libxml2-dev libmysqlclient15-dev flex m4 awk automake autoconf bison make libbz2-dev libpcre3-dev libssl-dev zlib1g-dev vim re2c
railsbox.org:~ ozeias$ cd /usr/local/src
railsbox.org:~ ozeias$ wget http://it2.php.net/get/php-5.2.6.tar.gz/from/de2.php.net/mirror
railsbox.org:~ ozeias$ tar xzvf php-5.2.6.tar.gz
railsbox.org:~ ozeias$ wget http://php-fpm.anight.org/downloads/archive/php-5.2/php-5.2.6-fpm-0.5.9.diff.gz
railsbox.org:~ ozeias$ gzip -cd php-5.2.6-fpm-0.5.9.diff.gz | patch -d php-5.2.6 -p1
railsbox.org:~ ozeias$ cd php-5.2.6
railsbox.org:~ ozeias$ ./configure --enable-fastcgi --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --with-openssl --with-mysql --with-mysql-sock --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --without-sqlite --disable-pdo --disable-reflection
railsbox.org:~ ozeias$ sudo make all install
railsbox.org:~ ozeias$ sudo strip /usr/local/bin/php-cgi
@ozeias
ozeias / php-fpm.conf
Created January 15, 2009 16:13
choosing the user php-cgi should run
## railsbox.org:~ ozeias$ sudo vim /usr/local/etc/php-fpm.conf
:63
www-data
:66
www-data
railsbox.org:~ ozeias$ cd /etc/init.d
railsbox.org:~ ozeias$ ln -s /usr/local/sbin/php-fpm php-fpm
railsbox.org:~ ozeias$ /usr/sbin/update-rc.d -f php-fpm defaults