电玩888棋牌运营中心-2019年2月时政新闻政治

首页

AD联系:507867812

电玩888棋牌运营中心

时间:2019-11-19 09:19:12 作者:888真人集团备用网址 浏览量:24660

电玩888棋牌运营中心

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

,见下图

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境,见下图

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

,如下图

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

如下图

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

,如下图

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

,见图

电玩888棋牌运营中心

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境。

CentOS6.5 编译安装lnmp环境

电玩888棋牌运营中心

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

1.

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境

2.

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

3.CentOS6.5 编译安装lnmp环境。

CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

4.

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境CentOS6.5 编译安装lnmp环境。电玩888棋牌运营中心

展开全文
相关文章
澳门室内除甲醛加盟费

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

官方下载dafa888 公司 联系

CentOS6.5 编译安装lnmp环境....

澳门赌注网游戏-皇冠真人赌场

网上搜来的教程如下

复制代码 代码如下:yum -y install gcc gcc-c++ automake autoconf libtool glibc makelibmcrypt安装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 #安装

因为编译安装libmcrypt一直出错,运行rpm –q libmcrypt 查看安装的rpm包 发现失败

所以参考了另一篇安装lnmp的文章

复制代码 代码如下:yum -y install gcc gcc-c++ autoconf 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 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers libXpm* #下载安装编译工具和依赖包yum -y update #更新yum下载安装包mkdir /tmp/sourcecd /tmp/sourcewget http://nginx.org/download/nginx-1.7.8.tar.gz #最新wget http://cn2.php.net/distributions/php-5.4.35.tar.bz2#php5.4稳定版 因为php5.5不支持mysql扩展了,暂时不用最新的wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz #mysql5.6wget 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=tcpdiagmv 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=hivelocitymv 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-dalmv 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

安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison复制代码 代码如下: 845 tar zxvf libmcrypt-2.5.8.tar.gz 846 cd libmcrypt-2.5.8 847 ./configure --prefix=/usr/local/libmcrypt 848 make && make install836 tar zxvf libiconv-1.14.tar.gz 837 cd libiconv-1.14838 ./configure --prefix=/usr/local839 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

安装cmake

复制代码 代码如下:cd /tmp/ tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3/ ./configure --prefix=/usr gmake gmake install

准备用户、目录

复制代码 代码如下: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

安装mysql

编译:

复制代码 代码如下:tar zxvf mysql-5.6.22.tar.gzcd mysql-5.6.22cmake -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=onmake && make installln -s /usr/local/mysql/lib/lib* /usr/lib/

配置:

复制代码 代码如下:/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

自启动

复制代码 代码如下: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账号密码

安装php

编译:

复制代码 代码如下:mkdir /usr/local/phpcd /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-dirmake && make installcp php.ini-development /usr/local/php/etc/php.ini #复制配置文件

配置php-fpm

复制代码 代码如下:cd /usr/local/php cp etc/php-fpm.conf.default etc/php-fpm.conf vi etc/php-fpm.confpid = run/php-fpm.pidemergency_restart_threshold = 10emergency_restart_interval = 1mprocess_control_timeout = 5s

148 149行

复制代码 代码如下:user = wwwgroup = www

3)拷贝php配置文件 到php默认的配置文件路径

4)更改配制文件(设置时区)

复制代码 代码如下:vim /usr/local/php/lib/php.ini

919 行,时区改为PRC,就是中华人民共和国。

date.timezone = PRC

安装nginx安装PCRE

复制代码 代码如下: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=iwebmv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gztar zxvf pcre-8.36.tar.gzcd pcre-8.36 && ./configure && make && make install

安装zlib

复制代码 代码如下:wget http://zlib.net/zlib-1.2.8.tar.gztar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install

安装ssl

复制代码 代码如下:wget http://www.openssl.org/source/openssl-1.0.1j.tar.gztar zxvf openssl-1.0.1j.tar.gz

安装nginx

复制代码 代码如下:mkdir /usr/local/nginxtar 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

配置nginx

复制代码 代码如下:vim /usr/local/nginx/conf/nginx.conf

启动服务器

复制代码 代码如下:/opt/nginx/sbin/nginx/opt/php/sbin/php-fpm。

....

澳门学什么技术好厂家

CentOS6.5 编译安装lnmp环境....

澳门新濠影汇最新招聘信息

CentOS6.5 编译安装lnmp环境....

相关资讯
热门资讯