关参考资源
http://www.lnmp.org/index.html \\LNMP一键安装包
http://www.howtocn.org/nginx \\Nginx模块参考手册中文版
http://blog.s135.com/nginx_php_v6/ \\张宴写的nginx文章
http://www.nginx.com.cn/ \\nginx中文网
如下为我写的。。。。。。
yum -y remove httpd* yum -y remove mysql* yum -y remove php*
时间同步 |
yum –enablerepo=remi -y install gcc gcc-c++ automake autoconf libtool |
yum -y –enablerepo=remi install gd freetype gd-devel.x86_64 freetype.x86_64 \ freetype-devel.x86_64 libjpeg.x86_64 libjpeg-devel.x86_64 \ libpng.x86_64 libpng-devel.x86_64 libxml2.x86_64 libxml2-devel.x86_64 \ zlib.x86_64 zlib-devel.x86_64 libevent.x86_64 libevent-devel.x86_64 \ bzip2.x86_64 bzip2-devel.x86_64 glib.x86_64 glib-devel.x86_64 glib2.x86_64 glib2-devel.x86_64 |
yum –enablerepo=remi -y install libc-client.x86_64 libc-client-devel.x86_64 |
yum –enablerepo=remi -y install net-snmp.x86_64 net-snmp-devel.x86_64 \ net-snmp-libs.x86_64 net-snmp-utils.x86_64 net-snmp-perl.x86_64 |
ln -s /usr/lib64/libpng.so /usr/lib/ ln -s /usr/lib64/libc-client.a /usr/lib/ 我的是64位系统所以要做这一步 |
相关软件包的下载,有必要时可到链接处找最新的安装包
Install
cd /usr/local/src/lnmp;cur_dir=$(pwd) cd $cur_dir; tar zxvf libiconv-1.13.tar.gz cd libiconv-1.13/ ./configure –prefix=/usr/local make && make install
cd $cur_dir cd $cur_dir ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la cd $cur_dir |
Mysql的安装
cd $cur_dir tar -zxvf mysql-5.1.53.tar.gz cd mysql-5.1.53/ groupadd mysql useradd -g mysql mysql ./configure –prefix=/usr/local/mysql –sysconfdir=/etc \ –with-extra-charsets=all \ –with-charset=utf8 \ –with-plugins=all \ –with-big-tables \ –with-embedded-server \ –enable-local-infile \ –enable-assembler \ –with-mysqld-user=mysql
###如果报configure: error: No curses/termcap library found make && make install |
php+fast-cgi的安装, 5.3.3 源码中开始包含 php-fpm,不用专门再打补丁了,只需要解开源码直接configure,关于php-fpm的编译参数有 –enable-fpm –with-fpm-user=www –with-fpm-group=www –with-libevent-dir=libevent位置。
cd $cur_dir tar zxvf php-5.3.3.tar.gz cd php-5.3.3 ./configure –prefix=/usr/local/php \ –with-config-file-path=/usr/local/php/etc \ –with-mysql=/usr/local/mysql \ –with-mysqli=/usr/local/mysql/bin/mysql_config \ –with-gd \ –with-freetype-dir \ –with-jpeg-dir \ –with-png-dir \ –with-zlib \ –with-imap \ –with-kerberos \ –with-imap-ssl \ –with-mhash \ –with-mcrypt \ –with-curl \ –with-curlwrappers \ –with-openssl \ –with-gettext \ –with-iconv-dir \ –with-libxml-dir \ –enable-fpm \ –with-fpm-user=www \ –with-fpm-group=www \ –with-libevent-dir \ –enable-inline-optimization \ –enable-mbstring \ –enable-ftp \ –enable-gd-native-ttf \ –enable-zip \ –enable-sockets
#Kerberos libraries not found ,解决方法是,ln -s /usr/lib64/ /usr/kerberos/lib make ZEND_EXTRA_LIBS=’-liconv’ cd $cur_dir cd $cur_dir cd $cur_dir sed -i ‘s/;date.timezone =/date.timezone = Asia\/Shanghai/g’ /usr/local/php5/etc/php.ini #————————-编辑php.ini文件做如下修改————————————-# [eaccelerator] #————————–配置php-fpm.conf,如下操作————————————–# [global] groupadd www |
cd $cur_dir tar zxvf pcre-8.10.tar.gz cd pcre-8.10/ ./configure make && make install cd ../
tar zxvf nginx-0.9.1.tar.gz |
cat >/var/www/html/phpinfo.php<<eof <?php phpinfo(); ?> eof |
给PHP加速,eAccelerator配置和使用指南
http://www.toplee.com/blog/100.html#pp2
http://eaccelerator.net/wiki/InstallFromSource //安装文档
http://eaccelerator.net/wiki/Settings //配置说明
php-fpm管理
kill -SIGINT `cat /usr/local/php/var/run/php-fpm.pid` //终止
/usr/local/php5/sbin/php-fpm //启动
kill -SIGUSR2 `cat /usr/local/php/var/run/php-fpm.pid` //重启
kill -SIGUSR1 `cat /usr/local/php/var/run/php-fpm.pid` //日志
nginx管理
/usr/local/nginx/sbin/nginx //启动
/usr/local/nginx/sbin/nginx -s reload //平滑重启
/usr/local/nginx/sbin/nginx -t //测试
Others
nginx0.8.52+php5.3.3
http://addcn.blogbus.com/tag/php5.3.3/