Thứ Tư, 10 tháng 9, 2014

Guide install Nginx + PHP

cd SETUP/

tar -xzf zlib-1.2.8.tar.gz
tar -xzf pcre-8.33.tar.gz

#openssl
tar -xzf openssl-1.0.1h.tar.gz
cd openssl-1.0.1h
CFLAGS=-fPIC ./config shared --prefix=<home dir>/env/openssl-1.0.1h
make -j4
make install
cd ..



#Nginx
tar -xzf nginx-1.6.1.tar.gz
cd nginx-1.6.1
./configure --prefix=<home dir>/nginx --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre=../pcre-8.33 --with-zlib=../zlib-1.2.8 --with-http_ssl_module  --with-openssl=../openssl-1.0.1h
make -j4
make install
cd ..


tar -xzf php-5.5.16.tar.gz
cd php-5.5.16
./configure --prefix=<home dir>/php --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-calendar --enable-soap --with-curl --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir=/usr/lib --with-freetype-dir=/usr/include/freetype2/  --enable-exif --enable-zip  --enable-mbstring   --with-openssl=<home dir>/env/openssl-1.0.1h  --enable-fpm  --enable-opcache  --with-mcrypt  --enable-soap
make -j4
make install
cd ..


###memcached
tar -xf memcache-2.2.7.tar
cd memcache-2.2.7
<home dir>/php/bin/phpize
./configure --with-php-config=<home dir>/php/bin/php-config
make -j4
make install

tar -xf ssh2-0.12.tar
cd ssh2-0.12
<home dir>/php/bin/phpize
./configure --with-php-config=<home dir>/php/bin/php-config
make -j4
make install


#copy fpm config. Change dir "Need change"
#<home dir>/php/etc/php-fpm.conf

#copy nginx config. Change dir "Need change"
#<home dir>/nginx/conf

#create php.ini

#killall -9 php-fpm;php/sbin/php-fpm

#insert to php.ini:
#extension=memcache.so




mkdir nginx/ssl
cd nginx/ssl
openssl genrsa -des3 -out self-ssl.key 1024
#(pass: 123456)
openssl req -new -key self-ssl.key -out self-ssl.csr
openssl x509 -req -days 3650 -in self-ssl.csr -signkey self-ssl.key -out self-ssl.crt

cp self-ssl.key self-ssl.key.org
openssl rsa -in self-ssl.key.org -out self-ssl.key

Không có nhận xét nào:

Đăng nhận xét