Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
#!/bin/bash # web server stack (script by angel333) # ( http://ondrejsimek.com/2009/08/nginx-php-php-fpm-apc-memcached-stack/ ) # # contains # - nginx # - php # - apc # - php-fpm # - memcache extension # - memcached PREFIX=`pwd` mkdir sources cd sources # download all sources echo 'downloading nginx..' wget -c http://sysoev.ru/nginx/nginx-0.8.9.tar.gz -q echo 'downloading php..' wget -c http://php.net/get/php-5.3.0.tar.gz/from/us.php.net -q echo 'downloading php-fpm..' wget -c http://php-fpm.org/downloads/php-5.3.0-fpm-0.5.12.diff.gz -q echo 'downloading apc..' wget -c http://pecl.php.net/get/APC-3.1.3p1.tgz -q echo 'downloading memcache php extension' wget -c http://pecl.php.net/get/memcache-2.2.5.tgz echo 'downloading memcached..' wget -c http://memcached.googlecode.com/files/memcached-1.4.0.tar.gz -q # .. extract.. echo 'extracting all sources..' tar xzf nginx-0.8.9.tar.gz tar xzf php-5.3.0.tar.gz tar xzf APC-3.1.3p1.tgz tar xzf memcache-2.2.5.tgz tar xzf memcached-1.4.0.tar.gz # php echo 'applying php-fpm patch..' gzip -cd php-5.3.0-fpm-0.5.12.diff.gz | patch -d php-5.3.0 -p1 > /dev/null cd php-5.3.0 echo 'configuring php..' ./configure \ --prefix=$PREFIX \ --enable-mbstring \ --enable-fpm \ --without-sqlite \ --without-sqlite3 \ --without-pdo-sqlite \ --with-mysql=shared \ --with-mysqli=shared \ --with-gd=shared \ --with-mhash \ > /dev/null echo 'compiling php..' make > /dev/null echo 'installing php..' make install > /dev/null echo 'extension=mysql.so' >> ../../lib/php.ini echo 'extension=mysqli.so' >> ../../lib/php.ini echo 'extension=gd.so' >> ../../lib/php.ini cd .. # apc cd APC-3.1.3p1 echo 'phpizing apc..' ../../bin/phpize echo 'configuring apc..' ./configure \ --with-php-config=../../bin/php-config \ --enable-apc \ > /dev/null echo 'compiling apc..' make > /dev/null echo 'installing apc..' make install > /dev/null echo 'extension=apc.so' >> ../../lib/php.ini cd .. # memcache php extension cd memcache-2.2.5 echo 'phpizing memcache pecl extension..' ../../bin/phpize echo 'configuring memcache pecl extension..' ./configure \ --with-php-config=../../bin/php-config \ --enable-memcache \ > /dev/null echo 'compiling memcache pecl extension..' make > /dev/null echo 'installing memcache pecl extension..' make install > /dev/null echo 'extension=memcache.so' >> ../../lib/php.ini cd .. # nginx cd nginx-0.8.9 echo 'configuring nginx..' ./configure \ --prefix=$PREFIX \ --conf-path=$PREFIX/etc/nginx/nginx.conf \ --http-client-body-temp-path=$PREFIX/tmp/nginx/client_body_temp \ --http-proxy-temp-path=$PREFIX/tmp/nginx/proxy_temp \ --http-fastcgi-temp-path=$PREFIX/tmp/nginx/fastcgi_temp \ --without-http_charset_module \ --without-http_ssi_module \ --without-http_userid_module \ --without-http_autoindex_module \ --without-http_geo_module \ --without-http_referer_module \ --without-http_proxy_module \ --without-http_memcached_module \ --without-http_limit_zone_module \ --without-http_limit_req_module \ --without-http_empty_gif_module \ --without-http_browser_module \ --without-http_upstream_ip_hash_module \ --without-mail_pop3_module \ --without-mail_imap_module \ --without-mail_smtp_module \ --with-pcre \ > /dev/null echo 'compiling nginx..' make > /dev/null echo 'installing nginx..' make install > /dev/null cd .. # memcached cd memcached-1.4.0 echo 'configuring memcached..' ./configure \ --prefix=$PREFIX \ > /dev/null echo 'compiling memcached..' make > /dev/null echo 'installing memcached..' make install > /dev/null cd .. cd .. echo 'tidying up..' rm -rf sources rm -rf man rm -rf share/man rm html/* echo 'modifying nginx configuration' cd etc/nginx rm koi-win win-utf koi-utf *.default sed '/FastCGI server/,/}/ { /location/,/}/ s/#// }' < nginx.conf > out1 sed 's/\(listen *\)80;/\18080;/' < out1 > out2 sed 's/\(index\.html index\.htm\)/\1 index.php/' < out2 > out3 sed 's/\/scripts/\$document_root/' < out3 > out4 mv out4 nginx.conf rm out* cd ../.. mkdir tmp mkdir tmp/nginx # default index file echo 'creating default index file..' echo '<?phpinfo();' > html/index.php echo 'done!'
This paste will be private.
From the Design Piracy series on my blog: