CentOS6.5 Compile and install LNMP environment, CENTOS6.5LNMP
Online search for the following tutorials
Copy the Code code as follows:
Yum-y install gcc gcc-c++ automake autoconf libtool glibc make
Libmcrypt Installation
Mkdir/usr/local/source && Cd/usr/local/source #创建并进入源文件目录
[Root@localhost source]# wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz?modtime=1171868460 &big_mirror=0 #下载libmcrypt
[root@localhost source]# MV Libmcrypt-2.5.7.tar.gz\?modtime\=1171868460\&\;big_mirror\=0 Libmcrypt-2.5.7.tar.gz #重命名
TAR––ZXVF libmcrypt-2.5.7.tar.gz #解压
CD libmcrypt-2.5.7 #进入解压目录
./configure--prefix=/usr/local/libmcrypt && make && make install #安装
Run Rpm–q libmcrypt view installed RPM package Discovery failed because the compilation installation Libmcrypt has been faulted
So I've referenced another article that installs LNMP.
Copy CodeThe code is as follows:
Yum-y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-deve L zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel Curl curl-devel e2fsprogs E2 Fsprogs-devel krb5 krb5-devel libidn libidn-devel OpenSSL openssl-devel openldap openldap-devel Nss_ldap Openldap-clients openldap-servers libxpm* #下载安装编译工具和依赖包
Yum-y Update #更新yum
Download the installation package
Mkdir/tmp/source
Cd/tmp/source
wget http://nginx.org/download/nginx-1.7.8.tar.gz #最新
wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4 stable version because the php5.5 does not support MySQL extension, temporarily without the latest
Wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6
wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz?r=http%3A%2F% 2fsourceforge.net%2fprojects%2fmcrypt%2ffiles%2flibmcrypt%2f2.5.8%2f&ts=1418528625&use_mirror=tcpdiag
MV libmcrypt-2.5.8.tar.gz\?r\=http\:%2f%2fsourceforge.net%2fprojects%2fmcrypt%2ffiles%2flibmcrypt%2f2.5.8%2f Libmcrypt-2.5.8.tar.gz #删除多余参数的文件名
wget https://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz
wget http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz?r=http%3A%2F% 2fsourceforge.net%2fprojects%2fmhash%2ffiles%2fmhash%2f0.9.9.9%2f&ts=1418530194&use_mirror=hivelocity
MV mhash-0.9.9.9.tar.gz\?r\=http\:%2f%2fsourceforge.net%2fprojects%2fmhash%2ffiles%2fmhash%2f0.9.9.9%2f Mhash-0.9.9.9.tar.gz #删除多余参数的文件名
wget http://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz?r=http%3A%2F% 2fsourceforge.net%2fprojects%2fmcrypt%2ffiles%2fmcrypt%2f2.6.8%2f&ts=1418531968&use_mirror= Softlayer-dal
MV mcrypt-2.6.8.tar.gz\?r\=http\:%2f%2fsourceforge.net%2fprojects%2fmcrypt%2ffiles%2fmcrypt%2f2.6.8%2f Mcrypt-2.6.8.tar.gz #删除多余参数的文件名
wget http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz
# # #暂没有下载 Memcache pcre eaccelerator
Installation of Libiconv, Libmcrypt, (#没安装libltdl), Mhash, (#安装make没效果mcrypt), bison
Copy the Code code as follows:
845 Tar zxvf libmcrypt-2.5.8.tar.gz
846 CD libmcrypt-2.5.8
847./configure--prefix=/usr/local/libmcrypt
848 make && make install
836 Tar zxvf libiconv-1.14.tar.gz
837 CD libiconv-1.14
838./configure--prefix=/usr/local
839 make && make install
850 tar zxvf mhash-0.9.9.9.tar.gz
851 CD mhash-0.9.9.9
854./configure--prefix=/usr/mhash
855 Make && make install
Installing CMake
Copy the Code code as follows:
cd/tmp/
Tar zxvf cmake-2.8.3.tar.gz
CD cmake-2.8.3/
./configure--PREFIX=/USR
Gmake
Gmake Install
Preparing users, directories
Copy the Code code as follows:
Groupadd MySQL
useradd-g MySQL MySQL
Groupadd www
Useradd-g www www
Mkdir-p/data/mysql
Chown-r Mysql:mysql/data/mysql
Mkdir-p/data/www
Chown-r www:www/data/www
Install MySQL
Compile:
Copy the Code code as follows:
Tar zxvf mysql-5.6.22.tar.gz
CD mysql-5.6.22
Cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/data/mysql-dwith_innobase_storage_engine=1-dwith_ memory_storage_engine=1-dwith_myisam_storage_engine=1-dsysconfdir=/usr/local/mysql/etc/-dwith_ssl=yes-ddefault _charset=utf8-ddefault_collation=utf8_general_ci-dwith_readline=on
Make && make install
Ln-s/usr/local/mysql/lib/lib*/usr/lib/
Configuration:
Copy the Code code as follows:
/usr/local/mysql/scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/data/mysql/--user=mysql
Self-booting
Copy the Code code as follows:
Cp/opt/mysql/support-files/mysql.server/etc/rc.d/init.d/mysqld
Chkconfig--add mysqld
Chkconfig mysqld on
/etc/rc.d/init.d/mysqld start
cd/opt/mysql/
Bin/mysql_secure_installation #设置mysql账号密码
Install PHP
Compile:
Copy CodeThe code is as follows:
mkdir/usr/local/php
Cd/usr/local/src
Tar zxvf php-5.3.5.tar.gz
CD php-5.3.5
./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--with-mysql=/opt/mysql-- With-mysqli=/usr/local/mysql/bin/mysql_config--with-iconv-dir=/usr/local--with-freetype-dir--with-jpeg-dir-- With-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--disable-safe-mode--enable-bcmath-- Enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl--with-curlwrappers--enable-mbregex-- ENABLE-FPM--enable-mbstring (--with-mcrypt)--with-gd--enable-gd-native-ttf--with-openssl--with-mhash-- Enable-pcntl--enable-sockets (--with-ldap--with-ldap-sasl)--with-xmlrpc--enable-zip--enable-soap
./configure--prefix=/usr/local/php--enable-fpm--with-iconv=/usr/local/bin/libiconv \--with-mcrypt=/usr/local/ Bin/libmcrypt \--enable-mbstring--disable-pdo--with-curl--disable-debug--disable-rpath \-- Enable-inline-optimization--with-bz2--with-zlib--enable-sockets \--enable-sysvsem--enable-sysvshm--enable-pcntl --enable-mbregex \--with-mhash--enable-zip--with-pcre-regex--with-mysql--with-mysqli \--with-gd--with-jpeg-dir
Make && make install
CP Php.ini-development/usr/local/php/etc/php.ini #复制配置文件
Configure PHP-FPM
Copy the Code code as follows:
cd/usr/local/php
CP Etc/php-fpm.conf.default etc/php-fpm.conf
VI etc/php-fpm.conf
PID = Run/php-fpm.pid
Emergency_restart_threshold = 10
Emergency_restart_interval = 1m
Process_control_timeout = 5s
148 149 rows
Copy the Code code as follows:
user = www
Group = www
3) Copy php config file to php default profile path
4) Change the configuration file (set time zone)
Copy the Code code as follows:
Vim/usr/local/php/lib/php.ini
919 Line, time zone changed to PRC, is the People's Republic of China.
Date.timezone = PRC
Installing Nginx
Installing Pcre
Copy the Code code as follows:
wget http://downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz?r=http%3A%2F%2Fsourceforge.net% 2fprojects%2fpcre%2ffiles%2fpcre%2f8.36%2f&ts=1418696677&use_mirror=iwebhttp:// downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz?r=http%3a%2f%2fsourceforge.net%2fprojects% 2fpcre%2ffiles%2fpcre%2f8.36%2f&ts=1418696677&use_mirror=iweb
MV pcre-8.36.tar.gz\?r\=http\:%2f%2fsourceforge.net%2fprojects%2fpcre%2ffiles%2fpcre%2f8.36%2f pcre-8.36.tar.gz
Tar zxvf pcre-8.36.tar.gz
CD pcre-8.36 &&./configure && make && make install
Installing zlib
Copy the Code code as follows:
wget http://zlib.net/zlib-1.2.8.tar.gz
Tar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 &&./configure && make && make install
Installing SSL
Copy the Code code as follows:
wget http://www.openssl.org/source/openssl-1.0.1j.tar.gz
Tar zxvf openssl-1.0.1j.tar.gz
Installing Nginx
Copy the Code code as follows:
Mkdir/usr/local/nginx
Tar zxvf nginx-1.7.8.tar.gz
./configure--user=www--group=www--prefix=/usr/local/nginx--with-http_stub_status_module \--pid-path=/usr/local/ Nginx/nginx.pid--with-http_ssl_module \--with-pcre=/usr/local/src/pcre-8.36 \--with-zlib=/usr/local/src/ zlib-1.2.8 \--with-openssl=/usr/local/src/openssl-1.0.1j && make && make install
Configure Nginx
Copy the Code code as follows:
Vim/usr/local/nginx/conf/nginx.conf
Start the server
Copy the Code code as follows:
/opt/nginx/sbin/nginx
/OPT/PHP/SBIN/PHP-FPM.
http://www.bkjia.com/PHPjc/930485.html www.bkjia.com true http://www.bkjia.com/PHPjc/930485.html techarticle CentOS6.5 Compile and install LNMP environment, CENTOS6.5LNMP Online Search for the following copy code code is as follows: yum-y install gcc gcc-c++ automake autoconf libtool glibc Mak E-Libmcrypt installation ...