Wrap text
Report abuse
PREFIX=`pwd`
mkdir sources
cd 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
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
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 ..
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 ..
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 ..
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 ..
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
echo 'creating default index file..'
echo '<?phpinfo();' > html/index.php
echo 'done!'