lnmp=linux+nginx+mysql+php
Install Nginx
//Install dependent packages# yum Install OpenSSL openssl-devel zlib-devel//Installing Pcre# wget http://exim.mirror.fr/pcre/pcre-8.01.tar.gz# tar xf pcre-8.01.tar.gz-c/usr/local/web/# cd/usr/local/web/ pcre-8.01/#./configure # make; Make install//Installing LIBMD5http://ftp.mirrorservice.org/sites/ftp.wiretapped.net/pub/security/cryptography/libraries/libeay/# Tar XF Libmd5-0.8.2b.tar.gz-c/usr/local/web/# ls/usr/local/web/md5/makefile asm md5.c md5.h md5_dgst.c md5_locl.h md5_on E.C md5s.cpp md5test.c ranlib.sh//Installing Nginx# wget http://nginx.org/download/nginx-1.10.1.tar.gz# tar xf nginx-1.10.1.tar.gz-c/usr/local/web/# cd/usr/local/ web/nginx-1.10.1/# useradd nginx# ID nginxuid=502 (nginx) gid=502 (nginx) groups=502 (nginx) #./configure \--user=nginx --group=nginx--with-http_realip_module \--with-http_stub_status_module--with-http_gzip_static_module--with-md5= /USR/LOCAL/WEB/MD5--WITH-SHA1=AUTO/LIB/SHA1--with-pcre=/usr/local/web/pcre-8.01--without-select_module-- Without-poll_module--without-http_ssi_module--without-http_userid_module--without-http_geo_module-- Without-http_map_module--without-http_memcached_module--without-mail_pop3_module--without-mail_imap_module-- Without-mail_smtp_module--prefix=/usr/local/nginx-1.10.1 # Make;make Install
--with-Http_realip_module This module supports the display of real source IP addresses, mainly used for nginx front-end load balancer server. -with-Http_stub_status_module This module can get some nginx running state,--with-Http_gzip_static_module This module checks if a compressed file that ends with ". Gz" is already present before a pre-compressed file is transferred to the client that has gzip compression turned on, which prevents the file from being repeatedly compressed. --with-md5=/soft/md5/set MD5 library file path--with-sha1=auto/lib/SHA1 setting SHA1 library file path--with-pcre=/soft/pcre-8.01Setting the Pcre library path--without-Select_module standard connection mode. By default, the method is automatically compiled. You can enable or disable by using the-select_module and without-select_module configuration Parameters This module--without-Poll_module do not use poll modules--without-Http_ssi_module does not use the Ngx_http_ssi_module module, which handles the processing of server-side Include files (SSI).--without-http_userid_module do not use Ngx_http_userid_module modules--without-Http_geo_module This module creates some Ngx_http_geoip_module variables based on the IP address of the client and matches the Maxmindgeoip file, which is used only for0.7.63 and 0.8after the. 6 release. But the effect is not ideal, for the city's IP record is not particularly accurate, but for the site's source access to the area of the analysis of a certain reference. --without-http_map_module do not use Ngx_http_map_module modules--without-http_memcached_module do not use Ngx_http_memcached_module modules--without-mail_pop3_module not allow Ngx_mail_pop3_module module--without-mail_imap_module not allow Ngx_mail_imap_module module--without-mail_smtp_module not allow Ngx_mail_smtp_module module
Ngnix Compilation Parameters detailed
Install PHP
//Installing PHP dependencies①libxml2-2.7.7.tar.gz# cd/data/soft/#tar XF libxml2-2.7.7.tar.gz–c tmp/# CD tmp/libxml2-2.7.7/#./configure--prefix=/ Usr/local/services >/dev/null#make >/dev/null && make install >/dev/null②curl-7.21.4.tar.gz# cd/data /soft/# Tar XF curl-7.21.4.tar.gz-c tmp/# cd tmp/curl-7.21.4/#./configure--prefix=/usr/local/services >/dev/null# Make >/dev/null && make install >/dev/null③jpegsrc.v8b.tar.gz# cd/data/soft/#tar XF jpegsrc.v8b.tar.gz–c tmp/#cd tmp/jpeg-8b/#./configure--prefix=/usr/local/services >/dev/null#make >/dev/null && make Install >/dev/null④libpng-1.4.3.tar.gz# cd/data/soft/# tar XF libpng-1.4.3.tar.gz-c tmp/# CD tmp/libpng-1.4.3/#./ Configure--prefix=/usr/local/services >/dev/null#make >/dev/null && make install >/dev/ null⑤freetype-2.4.1.tar.gz# cd/data/soft/# Tar XF freetype-2.4.1.tar.gz-c tmp/# CD tmp/freetype-2.4.1/#./configure-- Prefix=/usr/local/services >/dev/null#make >/dev/null &&Make install >/dev/null⑥libevent-2.0.10-stable.tar.gz# cd/data/soft/# tar xf libevent-2.0.10-stable.tar.gz–c tmp/# CD tmp/libevent-2.0.10-stable/#./configure--prefix=/usr/local/services--disable-debug-mode >/dev/null#make >/dev/null && make install >/dev/null⑦re2c-0.13.5.tar.gz# cd/data/soft/# tar xf re2c-0.13.5.tar.gz-c tmp/ # CD Tmp/re2c-0.13.5/#./configure--prefix=/usr/local/services >/dev/null#make >/dev/null && make Install >/dev/null⑧libmcrypt-2.5.8.tar.gz# cd/data/soft/# tar XF libmcrypt-2.5.8.tar.bz2-c tmp/# CD tmp/libmcrypt-2 .5.8/#./configure--prefix=/usr/local/services >/dev/null#make >/dev/null && make install >/dev/null # CD libltdl/#./configure--prefix=/usr/local/services--enable-ltdl-install >/dev/null#make >/dev/null & & Make Install >/dev/null
//Install PHP#wget http://php.net/distributions/php-5.3.13.tar.gz# cd/data/soft/# Tar xf php-5.3.13.tar.gz-c tmp/#cd tmp/ php-5.3.13/#./configure--enable-zend-multibyte--enable-mbstring--enable-sockets--enable-pdo--enable-zip-- ENABLE-FPM--with-gd--with-fpm-user=user_00--with-fpm-group=user_00--with-zlib--with-config-file-path=/usr/ Local/services/php-5.3.13/etc--with-libxml-dir=/usr/local/services--with-curl=/usr/local/services-- With-png-dir=/usr/local/services--with-jpeg-dir=/usr/local/services--with-freetype-dir=/usr/local/services-- with-mysql=/usr/local/services/mysql-5.1.49--with-pdo-mysql=/usr/local/services/mysql-5.1.49--WITH-MYSQLI=/USR /local/services/mysql-5.1.49/bin/mysql_config--prefix=/usr/local/services/php-5.3.13 # Make >/dev/null & & make install >/dev/null Compile error Resolution:/var/lib/mysql/mysql.sockconfigure:error:cannot Find Libmysqlclient under/usr . Note that the MySQL client library isn't bundled anymore! workaround: cp-rp/usr/lib64/mysql/libmysqlclient.so.16.0.0/usr/lib/libmysqlclient.so
//Installing PHP extensions①eaccelerator-0.9.6.1.tar.bz2# cd/data/soft/#tar XF eaccelerator-0.9.6.1.tar.bz2-c tmp/#cd tmp/eaccelerator-0.9.6.1 /#/usr/local/php-5.3.13/bin/phpize configuring for:php API Version:20090626zend Module API No:20090626zend Extension Api no:220090626#./configure--prefix=/usr/local/services/eaccelerator-0.9.6.1--enable-eaccelerator-- With-php-config=/usr/local/services/php-5.3.13/bin/php-config >/dev/null#make # make installInstalling shared Extensions:/usr/local/php-5.3.13/lib/php/extensions/no-debug-non-zts-20090626/#mkdir/tmp/eaccelerator#chmod 777 /tmp/eaccelerator②memcached-1.4.13.tar.gz (server side to install before, the following compilation extension to use) # cd/data/soft/#tar XF memcached-1.4.13.tar.gz-c tmp/# CD tmp/memcached-1.4.13/#./configure--enable-64bit--with-libevent=/usr/local/services--prefix=/usr/local/ services/memcached-1.4.13 >/dev/null# make >/dev/null && make install >/dev/ null③libmemcached-0.48.tar.gz# cd/data/soft/#tar XF libmemcached-0.48.tar.gz-c tmp/#cdtmp/libmemcached-0.48/#CONFOPTS = "--disable-libinnodb--without-libinnodb-prefix--with-libevent-prefix=/usr/ Local/services--with-memcached=/usr/local/services/memcached-1.4.13/bin/memcached--prefix=/usr/local/services " #./configure $CONFOPTS >/dev/null#make >/dev/null && make install >/dev/null④igbinary-1.0.2.tgz# CD/ data/soft/# Tar xf igbinary-1.0.2.tar.gz-c tmp/#cd tmp/igbinary-1.0.2/#/usr/local/php-5.3.13/bin/phpize Configuring for:php API Version:20090626zend Module API no:20090626zend Extension API No:220090626#./configure--ena Ble-igbinary--with-php-config=/usr/local/services/php-5.3.13/bin/php-config >/dev/null#make >/dev/null && make install >/dev/null# make installinstalling shared extensions:/usr/local/php-5.3.13/lib/php/extensi Ons/no-debug-non-zts-20090626/installing header files:/usr/local/php-5.3.13/include/php/⑤memcache-3.0.5.tgz # CD /data/soft/# Tar xf memcache-3.0.5.tgz-c tmp/#cd tmp/memcache-3.0.5/#/usr/local/services/php-5.3.13/bin/phpize#confopts= "--enable-memcache--with-php-config=/usr/local/services /php-5.3.13/bin/php-config "#./configure $CONFOPTS >/dev/null#make >/dev/null && make install >/dev/ NULL⑥MEMCACHED-1.0.2.TGZ (Note the order of installation, igbinary-1.1.1.tgz is a dependent library) # cd/data/soft/# tar XF memcached-1.0.2.tgz-c tmp/# CD tmp/ Memcached-1.0.2/#/usr/local/services/php-5.3.13/bin/phpize#./configure--enable-memcached-- Enable-memcached-igbinary--enable-memcached-json--with-libmemcached-dir=/usr/local/services--with-php-config=/ Usr/local/services/php-5.3.13/bin/php-config--prefix=/usr/local/services #make >/dev/null && make Install >/dev/null⑦owlient-phpredis-2.1.1-1-g90ecd17.tar.gz# cd/data/soft/#tar XF Owlient-phpredis-2.1.1-1-g90ecd17.tar.gz-c tmp/# CD tmp/owlient-phpredis-90ecd17/#/usr/local/services/php-5.3.13/ Bin/phpize #./configure--with-php-config=/usr/local/services/php-5.3.13/bin/php-config >/dev/null#make >/ Dev/null && MakeInstall >/dev/null
// Copy configuration file # cd/usr/local/services/php-5.3.13/etc# CP php-fpm.conf.default php-fpm.conf# cp/soft/php/php-5.3.13/ Php.ini-production php.ini
Install Mysql (click the link to view)
LNMP Environment Configuration