The previous Web servers were built with Yum, and it was inconvenient to add new modules or update some software (reaching!). )。 Therefore, it is now ready to change the environment to source code compilation and installation, so that easy to adjust, performance will be much better than the Yum way. Here are my installation steps, my system is CentOS 6.3 64 bit.
Note: This article is therefore configured to be based on the software version downloaded in the second step, and the installation of other versions is not guaranteed to succeed
Recommended reading:
Production environment Practical LNMP Architecture of the compilation installation +SSL encryption implementation http://www.linuxidc.com/Linux/2013-05/85099.htm
LNMP full feature compilation install for CentOS 6.3 Note http://www.linuxidc.com/Linux/2013-05/83788.htm
CentOS 6.3 Installation Lnmp (PHP 5.4,myysql5.6) http://www.linuxidc.com/Linux/2013-04/82069.htm
2 problems with Nginx startup failure encountered while deploying LNMP http://www.linuxidc.com/Linux/2013-03/81120.htm
Ubuntu installs Nginx php5-fpm MySQL (LNMP Environment Building) http://www.linuxidc.com/Linux/2012-10/72458.htm
One: Install dependent packages
Yum install cmake make gcc gcc-c++ libjpeg libjpeg-devel libpng \
Libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc \
Glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl \
Curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel OpenSSL expat expat-devel \
Openssl-devel nss_ldap openldap openldap-devel openldap-clients openldap-servers unixodbc-devel \
Libxslt-devel libevent-devel Libtool-ltdl Bison libtool pcre-devel zip unzip gmp-devel gd Gd-devel
II: Download the software required for LNMP
wget http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.19.tar.gz
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
wget http://iweb.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
wget http://iweb.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
wget http://vps.googlecode.com/files/mcrypt-2.6.8.tar.gz
wget http://download-euro.oldapps.com/PHP/php-5.3.18.tar.bz2
wget HTTP://SUPERB-DCA2.DL.SOURCEFORGE.NET/PROJECT/EACCELERATOR/EACCELERATOR/EACCELERATOR%200.9.6.1/ eaccelerator-0.9.6.1.tar.bz2
wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
wget http://pecl.php.net/get/memcache-2.2.7.tgz
wget http://www.imagemagick.org/download/legacy/ImageMagick-6.8.3-10.tar.gz
wget http://pecl.php.net/get/imagick-3.0.1.tgz
wget http://pecl.php.net/get/pecl_http-1.7.5.tgz
wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.33/pcre-8.33.tar.gz
wget http://nginx.org/download/nginx-1.2.9.tar.gz
wget http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download
wget http://pecl.php.net/get/igbinary-1.1.1.tgz
wget Https://github.com/nicolasff/phpredis/archive/master.zip
Third, install MySQL
Tar zxf mysql-5.5.19.tar.gz
CD mysql-5.5.19
Groupadd MySQL
Useradd-g mysql-s/sbin/nologin-m MySQL
CMake \
-dcmake_install_prefix=/usr/local/mysql \
-dsysconfdir=/etc/mysql \
-dmysql_unix_addr=/usr/local/mysql/tmp/mysql.sock \
-dwith_readline=1 \
-dwith_embedded_server=1 \
-dmysql_datadir=/usr/local/mysql/data \
-dmysql_user=mysql \
-dmysql_tcp_port=3306
Make && make install
Chown-r Mysql.mysql/usr/local/mysql
Cd..
Because there is a dedicated MySQL server, so MySQL installs to this end. If you want to run MySQL locally, there are other configurations to make. such as my.cnf configuration file, MySQL startup script and so on.
Four: Install PHP
Install PHP (FastCGI)
# # # Install PHP Support Library # # #
Tar zxf libiconv-1.14.tar.gz
CD libiconv-1.14
./configure--prefix=/usr/local
Make
Make install
Cd..
Tar zxf libmcrypt-2.5.8.tar.gz
CD libmcrypt-2.5.8
./configure && make && make install
/sbin/ldconfig
CD libltdl/
./configure--enable-ltdl-install
Make && make install
Cd.. /.. /
Tar zxf mhash-0.9.9.9.tar.gz
CD mhash-0.9.9.9/
./configure
Make
Make install
Cd.. /
Tar zxf mcrypt-2.6.8.tar.gz
CD mcrypt-2.6.8/
./configure
Make
Make install
Cd.. /
Tar zxf re2c-0.13.5.tar.gz
CD re2c-0.13.5
./configure
Make && make install
Cd..
Before installing the main PHP program, you need to make some adjustments, otherwise there will be various errors.
echo "/usr/local/lib" >/etc/ld.so.conf.d/local.conf
echo "/usr/lib64" >>/etc/ld.so.conf.d/local.conf
ln-sv/usr/lib64/libldap*/usr/lib/
Ln-sv/usr/include/sqlext.h/usr/local/include/sqlext.h
Ln-sv/usr/local/mysql/bin/mysql_config/usr/bin/mysql_config
ln-sv/usr/local/mysql/lib/libmysqlclient.so.18/usr/lib64/
Ln-sv/lib64/libexpat.*/lib/
Ln-sv/usr/lib64/libexpat.*/usr/lib/
Ldconfig
Install PHP now
Tar jxf php-5.3.18.tar.bz2
CD php-5.3.18
Groupadd Nginx
Useradd-m-s/sbin/nologin-g Nginx
./configure \
--prefix=/usr/local/php--with-config-file-path=/etc--with-config-file-scan-dir=/etc/php.d \
--with-pic--with-bz2--with-gettext--with-gmp--with-iconv--with-openssl \
--with-zlib--with-layout=gnu--with-kerberos--with-mhash--with-pcre-regex--enable-exif \
--enable-magic-quotes--enable-sockets--enable-ucd-snmp-hack--enable-shmop--enable-calendar \
--enable-mbstring \
--enable-xml--enable-fpm--enable-gd-native-ttf--enable-exif--enable-soap--with-gd--with-curl \
--with-mcrypt \
--with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config--with-pdo-mysql \
--WITH-UNIXODBC \
--ENABLE-WDDX--with-libexpat-dir--with-xmlrpc--with-xsl--with-ldap--enable-bcmath \
--enable-dom--without-gdbm--disable-debug--disable-rpath--disable-fileinfo--without-pspell \
--disable-posix--disable-sysvmsg--disable-sysvshm--disable-sysvsem
Make zend_extra_libs= '-liconv '
Make install
Copy configuration files and startup scripts
CP Php.ini-production/etc/php.ini
CP SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM
chmod +x/etc/init.d/php-fpm
Chkconfig--add PHP-FPM
Chkconfig PHP-FPM on
Cd.. /
Install the PHP extension module, do not forget to open the module in the configuration file, or white installed ha
# # # Install expansion Module # # #
Tar zxf memcache-2.2.7.tgz
CD memcache-2.2.7/
/usr/local/php/bin/phpize
./configure--enable-memcache--with-php-config=/usr/local/php/bin/php-config
Make
Make install
Cd.. /
Tar jxf eaccelerator-0.9.6.1.tar.bz2
CD EACCELERATOR-0.9.6.1/
/usr/local/php/bin/phpize
./configure--enable-eaccelerator=shared--with-php-config=/usr/local/php/bin/php-config
Make
Make install
Mkdir/tmp/cache/eaccelerator
chmod 0777/tmp/cache/eaccelerator
Cd.. /
Tar zxf pdo_mysql-1.0.2.tgz
CD PDO_MYSQL-1.0.2/
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config--with-pdo-mysql=/usr/local/mysql
Make
Make install
Cd.. /
Tar zxf igbinary-1.1.1.tgz
CD igbinary-1.1.1
/usr/local/php/bin/phpize
./configure--enable-igbinary--with-php-config=/usr/local/php/bin/php-config
Make && make install
Cd..
Unzip Master
CD Phpredis-master
/usr/local/php/bin/phpize
./configure--enable-redis--enable-redis-igbinary--with-php-config=/usr/local/php/bin/php-config
Make && make install
Cd..
Tar zxvf imagemagick-6.8.3-10.tar.gz
CD imagemagick-6.8.3-10/
./configure
Make
Make install
Cd.. /
Tar zxvf imagick-3.0.1.tgz
CD IMAGICK-3.0.1/
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config
Ln-s/usr/local/include/imagemagick-6/usr/local/include/imagemagick
Export Pkg_config_path=/usr/local/lib/pkgconfig
Make
Make install
Cd.. /
To this PHP environment configuration is complete, then install the famous nginx. It's good we don't say, everybody knows ha.
Build a Web server based on linux6.3+nginx1.2+php5+mysql5.5----reprint of the whole process