前期准备工作@H_301_1@
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* #下载安装编译工具和依赖包@H_301_1@
yum -y update #更新yum@H_301_1@
mkdir /tmp/source@H_301_1@
cd /tmp/source@H_301_1@
wget http://Nginx.org/download/Nginx-1.7.8.tar.gz #最新@H_301_1@
wget http://cn2.PHP.net/distributions/PHP-5.4.35.tar.bz2#PHP5.4稳定版 因为PHP5.5不支持MysqL扩展了,暂时不用最新的@H_301_1@
wget http://dev.MysqL.com/get/Downloads/MysqL-5.6/MysqL-5.6.22.tar.gz #MysqL5.6@H_301_1@
wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt%2F2.5.8%2F&ts=1418528625&use_mirror=tcpdiag@H_301_1@
mv libmcrypt-2.5.8.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt%2F2.5.8%2F libmcrypt-2.5.8.tar.gz #删除多余参数的文件名@H_301_1@
wget https://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz@H_301_1@
wget http://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmhash%2Ffiles%2Fmhash%2F0.9.9.9%2F&ts=1418530194&use_mirror=hivelocity@H_301_1@
mv mhash-0.9.9.9.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fmhash%2Ffiles%2Fmhash%2F0.9.9.9%2F mhash-0.9.9.9.tar.gz #删除多余参数的文件名@H_301_1@
wget http://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FMCrypt%2F2.6.8%2F&ts=1418531968&use_mirror=softlayer-dal@H_301_1@
mv mcrypt-2.6.8.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FMCrypt%2F2.6.8%2F mcrypt-2.6.8.tar.gz #删除多余参数的文件名@H_301_1@
wget http://ftp.gnu.org/gnu/bison/bison-3.0.tar.gz@H_301_1@
###暂没有下载 memcache pcre eaccelerator@H_301_1@
安装libiconv、libmcrypt、(#没安装libltdl)、mhash、(#安装make没效果mcrypt),bison@H_301_1@
@H_301_1@
845 tar zxvf libmcrypt-2.5.8.tar.gz@H_301_1@
846 cd libmcrypt-2.5.8@H_301_1@
847 ./configure --prefix=/usr/local/libmcrypt@H_301_1@
848 make && make install@H_301_1@
836 tar zxvf libiconv-1.14.tar.gz@H_301_1@
837 cd libiconv-1.14@H_301_1@
838 ./configure --prefix=/usr/local@H_301_1@
839 make && make install@H_301_1@
850 tar zxvf mhash-0.9.9.9.tar.gz@H_301_1@
851 cd mhash-0.9.9.9@H_301_1@
854 ./configure --prefix=/usr/mhash@H_301_1@
855 make && make install@H_301_1@
安装cmake@H_301_1@
@H_301_1@
@H_301_1@
cd /tmp/@H_301_1@
tar zxvf cmake-2.8.3.tar.gz@H_301_1@
cd cmake-2.8.3/@H_301_1@
./configure --prefix=/usr@H_301_1@
gmake@H_301_1@
gmake install@H_301_1@
@H_301_1@
@H_301_1@
useradd -g MysqL MysqL@H_301_1@
groupadd www@H_301_1@
useradd -g www www@H_301_1@
chown -R MysqL:MysqL /data/MysqL@H_301_1@
mkdir -p /data/www@H_301_1@
chown -R www:www /data/www@H_301_1@
@H_301_1@
@H_301_1@
@H_301_1@
@H_301_1@
编译:@H_301_1@
@H_301_1@
@H_301_1@
tar zxvf MysqL-5.6.22.tar.gz@H_301_1@
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/MysqL -DMysqL_DATADIR=/data/MysqL -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DSYSCONFDIR=/usr/local/MysqL/etc/ -DWITH_SSL=yes -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_READLINE=on@H_301_1@
make && make install@H_301_1@
ln -s /usr/local/MysqL/lib/lib* /usr/lib/@H_301_1@
配置:@H_301_1@
@H_301_1@
@H_301_1@
/usr/local/MysqL/scripts/MysqL_install_db --basedir=/usr/local/MysqL --datadir=/data/MysqL/ --user=MysqL@H_301_1@
自启动@H_301_1@
@H_301_1@
@H_301_1@
cp /opt/MysqL/support-files/MysqL.server /etc/rc.d/init.d/MysqLd@H_301_1@
chkconfig --add MysqLd@H_301_1@
/etc/rc.d/init.d/MysqLd start@H_301_1@
bin/MysqL_secure_installation #设置MysqL账号密码@H_301_1@
@H_301_1@
@H_301_1@
前期准备@H_301_1@
yum install gcc gcc-c++ libxml2 libxml2-devel libjpeg-devel libpng-devel freetype-devel openssl-devel libcurl-devel libmcrypt-devel@H_301_1@
编译:@H_301_1@
@H_301_1@
@H_301_1@
cd /usr/local/src@H_301_1@
tar zxvf PHP-5.3.5.tar.gz@H_301_1@
./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@H_301_1@
./configure --prefix=/usr/local/PHP --enable-fpm --with-iconv=/usr/local/bin/libiconv \--with-mcrypt=/usr/local/bin/libmcrypt \--enable-mbstring --disable-pdo --with-curl --disable-debug --disable-rpath \--enable-inline-optimization --with-bz2 --with-zlib --enable-sockets \--enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex \--with-mhash --enable-zip --with-pcre-regex --with-MysqL --with-MysqLi \--with-gd --with-jpeg-dir@H_301_1@
make && make install@H_301_1@
cp PHP.ini-development /usr/local/PHP/etc/PHP.ini #复制配置文件@H_301_1@
@H_301_1@
@H_301_1@
cp etc/PHP-fpm.conf.default etc/PHP-fpm.conf@H_301_1@
pid = run/PHP-fpm.pid@H_301_1@
emergency_restart_threshold = 10@H_301_1@
emergency_restart_interval = 1m@H_301_1@
process_control_timeout = 5s@H_301_1@
148 149行@H_301_1@
@H_301_1@
@H_301_1@
user = www@H_301_1@
group = www@H_301_1@
3)拷贝PHP配置文件 到PHP默认的配置文件路径@H_301_1@
@H_301_1@
@H_301_1@
@H_301_1@
vim /usr/local/PHP/lib/PHP.ini@H_301_1@
919 行,时区改为PRC,就是中华人民共和国。@H_301_1@
@H_301_1@
date.timezone = PRC@H_301_1@
@H_301_1@
@H_301_1@
@H_301_1@
@H_301_1@
安装PCRE@H_301_1@
@H_301_1@
@H_301_1@
wget http://downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F&ts=1418696677&use_mirror=iwebhttp://downloads.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F&ts=1418696677&use_mirror=iweb@H_301_1@
mv pcre-8.36.tar.gz\?r\=http\:%2F%2Fsourceforge.net%2Fprojects%2Fpcre%2Ffiles%2Fpcre%2F8.36%2F pcre-8.36.tar.gz@H_301_1@
tar zxvf pcre-8.36.tar.gz@H_301_1@
cd pcre-8.36 && ./configure && make && make install@H_301_1@
安装zlib@H_301_1@
@H_301_1@
@H_301_1@
wget http://zlib.net/zlib-1.2.8.tar.gz@H_301_1@
tar zxvf zlib-1.2.8.tar.gz && cd zlib-1.2.8 && ./configure && make && make install@H_301_1@
安装ssl@H_301_1@
@H_301_1@
@H_301_1@
wget http://www.openssl.org/source/openssl-1.0.1j.tar.gz@H_301_1@
tar zxvf openssl-1.0.1j.tar.gz@H_301_1@
@H_301_1@
@H_301_1@
mkdir /usr/local/Nginx@H_301_1@
tar zxvf Nginx-1.7.8.tar.gz@H_301_1@
./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@H_301_1@
@H_301_1@
@H_301_1@
vim /usr/local/Nginx/conf/Nginx.conf@H_301_1@
启动服务器@H_301_1@
@H_301_1@
@H_301_1@