转载链接:http://blog.csdn.net/staricqxyz/article/details/17012329

  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 ssse2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers gettext-devel libXpm-devel libtool libevent libevent-devel gd-devel gd libmcrypt libmcrypt-devel pcre pcre-devel
  1. [root@lnmp software]# tar zxvf libiconv-1.14.tar.gz
  2. [root@lnmp software]# cd libiconv-1.14
  3. [root@lnmp libiconv-1.14]# ./configure --prefix=/service/libiconv
  4. [root@lnmp libiconv-1.14]# make && make install
  1. [root@lnmp software]# tar zxvf GD-2.50.tar.gz
  2. [root@lnmp software]# cd GD-2.50
  3. [root@lnmp GD-2.50]# perl Makefile.PL
  4. [root@lnmp GD-2.50]# make && make install

安装MySQL

  1. [root@lnmp software]# tar zxvf mysql-5.5.34.tar.gz
  2. [root@lnmp software]# cd mysql-5.5.34
  3. [root@lnmp mysql-5.5.34]# groupadd mysql
  4. [root@lnmp mysql-5.5.34]# useradd -g mysql -s /sbin/nologin mysql
  5. [root@lnmp mysql-5.5.34]# cmake . -DCMAKE_INSTALL_PREFIX=/service/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/service/mysql -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_EXAMPLE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_TCP_PORT=30307 -DCOMPILATION_COMMENT=ZWC -DWITH_DEBUG=0
  6. [root@lnmp mysql-5.5.34]# make && make install
  7. [root@lnmp mysql-5.5.34]# cp support-files/my-large.cnf /service/mysql/my.cnf
  8. [root@lnmp mysql-5.5.34]# chown -R mysql:mysql /data/mysql /service/mysql
  9. [root@lnmp mysql-5.5.34]# /service/mysql/bin/mysqld_safe --defaults-file=/service/mysql/my.cnf --basedir=/service/mysql --datadir=/data/mysql --user=mysql &

安装PHP,PHP5.5中自带了mysqlnd,MySQL不是必须安装的

  1. [root@lnmp software]# tar zxvf php-5.5.6.tar.gz
  2. [root@lnmp software]# cd php-5.5.6
  3. [root@lnmp php-5.5.6]# groupadd webroot
  4. [root@lnmp php-5.5.6]# useradd -g webroot -s /sbin/nologin webroot
  5. [root@lnmp php-5.5.6]# ./configure --prefix=/service/php --with-config-file-path=/service/php/etc --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --with-jpeg-dir --with-png-dir --with-freetype-dir --with-mcrypt --with-zlib-dir --with-xpm-dir --enable-xml --with-curl --with-zlib --enable-exif --with-zlib-dir --with-bz2 --with-libxml-dir --enable-mbstring --enable-sockets --enable-zip --enable-ftp --with-iconv-dir=/service/libiconv --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --with-fpm-user=webroot --with-fpm-group=webroot  --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --with-libdir=lib64
  6. [root@lnmp php-5.5.6]# make && make install
  7. Installing shared extensions:     /service/php/lib/php/extensions/no-debug-non-zts-20121212/
  8. Installing PHP CLI binary:        /service/php/bin/
  9. Installing PHP CLI man page:      /service/php/php/man/man1/
  10. Installing PHP FPM binary:        /service/php/sbin/
  11. Installing PHP FPM config:        /service/php/etc/
  12. Installing PHP FPM man page:      /service/php/php/man/man8/
  13. Installing PHP FPM status page:      /service/php/php/fpm/
  14. Installing PHP CGI binary:        /service/php/bin/
  15. Installing PHP CGI man page:      /service/php/php/man/man1/
  16. Installing build environment:     /service/php/lib/php/build/
  17. Installing header files:          /service/php/include/php/
  18. Installing helper programs:       /service/php/bin/
  19. program: phpize
  20. program: php-config
  21. Installing man pages:             /service/php/php/man/man1/
  22. page: phpize.1
  23. page: php-config.1
  24. Installing PEAR environment:      /service/php/lib/php/
  25. [PEAR] Archive_Tar    - installed: 1.3.11
  26. [PEAR] Console_Getopt - installed: 1.3.1
  27. warning: pear/PEAR requires package "pear/Structures_Graph" (recommended version 1.0.4)
  28. warning: pear/PEAR requires package "pear/XML_Util" (recommended version 1.2.1)
  29. [PEAR] PEAR           - installed: 1.9.4
  30. Wrote PEAR system config file at: /service/php/etc/pear.conf
  31. You may want to add: /service/php/lib/php to your php.ini include_path
  32. [PEAR] Structures_Graph- installed: 1.0.4
  33. [PEAR] XML_Util       - installed: 1.2.1
  34. /service/software/php-5.5.6/build/shtool install -c ext/phar/phar.phar /service/php/bin
  35. ln -s -f /service/php/bin/phar.phar /service/php/bin/phar
  36. Installing PDO headers:          /service/php/include/php/ext/pdo/
  37. [root@lnmp php-5.5.6]# cp php.ini-production /service/php/etc/php.ini
  38. [root@lnmp php-5.5.6]# cp /service/php/etc/php-fpm.conf.default /service/php/etc/php-fpm.conf
  39. [root@lnmp php-5.5.6]# /service/php/sbin/php-fpm
  40. [root@lnmp php-5.5.6]# netstat -lanp|grep php-fpm
  41. tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      5483/php-fpm.conf)
  42. unix  3      [ ]         STREAM     CONNECTED     459737 5483/php-fpm.conf)
  43. unix  3      [ ]         STREAM     CONNECTED     459736 5483/php-fpm.conf)
  44. [root@lnmp php-5.5.6]# ps -ef|grep php
  45. root      5483     1  0 23:19 ?        00:00:00 php-fpm: master process (/service/php/etc/php-fpm.conf)
  46. webroot   5484  5483  0 23:19 ?        00:00:00 php-fpm: pool www
  47. webroot   5485  5483  0 23:19 ?        00:00:00 php-fpm: pool www
  48. root      5497 24209  0 23:21 pts/0    00:00:00 grep php

安装nginx

  1. [root@lnmp software]# tar zxvf nginx-1.4.4.tar.gz
  2. [root@lnmp software]# cd nginx-1.4.4
  3. [root@lnmp nginx-1.4.4]# ./configure --prefix=/service/nginx --with-http_ssl_module --with-pcre --with-http_spdy_module --with-http_stub_status_module --with-pcre --user=webroot --group=webroot
  4. ........................
  5. Configuration summary
  6. + using system PCRE library
  7. + using system OpenSSL library
  8. + md5: using OpenSSL library
  9. + sha1: using OpenSSL library
  10. + using system zlib library
  11. nginx path prefix: "/service/nginx"
  12. nginx binary file: "/service/nginx/sbin/nginx"
  13. nginx configuration prefix: "/service/nginx/conf"
  14. nginx configuration file: "/service/nginx/conf/nginx.conf"
  15. nginx pid file: "/service/nginx/logs/nginx.pid"
  16. nginx error log file: "/service/nginx/logs/error.log"
  17. nginx http access log file: "/service/nginx/logs/access.log"
  18. nginx http client request body temporary files: "client_body_temp"
  19. nginx http proxy temporary files: "proxy_temp"
  20. nginx http fastcgi temporary files: "fastcgi_temp"
  21. nginx http uwsgi temporary files: "uwsgi_temp"
  22. nginx http scgi temporary files: "scgi_temp"
  23. [root@lnmp nginx-1.4.4]# make && make install

配置nginx

  1. [root@lnmp conf]# cat /service/nginx/conf/nginx.conf
  2. user  webroot webroot;
  3. worker_processes  1;
  4. events {
  5. worker_connections  1024;
  6. }
  7. http {
  8. include       mime.types;
  9. default_type  application/octet-stream;
  10. sendfile        on;
  11. keepalive_timeout  65;
  12. server {
  13. listen       80;
  14. server_name  localhost;
  15. index index.php index.html index.shtml index.htm;
  16. root /service/nginx/html;
  17. location / {
  18. try_files $uri $uri/ /index.php?$args;
  19. }
  20. location ~ .*\.(php)?$
  21. {
  22. expires -1s;
  23. try_files $uri =404;
  24. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  25. include fastcgi_params;
  26. fastcgi_param PATH_INFO $fastcgi_path_info;
  27. fastcgi_index index.php;
  28. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  29. fastcgi_pass 127.0.0.1:9000;
  30. #fastcgi_pass unix:/var/run/phpfpm.sock;
  31. #php-fpm.conf listen = /var/run/phpfpm.sock##
  32. }
  33. error_page   500 502 503 504  /50x.html;
  34. location = /50x.html {
  35. root   html;
  36. }
  37. }
  38. }
  39. [root@lnmp conf]# /service/nginx/sbin/nginx -t
  40. nginx: the configuration file /service/nginx/conf/nginx.conf syntax is ok
  41. nginx: configuration file /service/nginx/conf/nginx.conf test is successful

启动nginx

  1. [root@lnmp conf]# /service/nginx/sbin/nginx
  2. [root@lnmp conf]# netstat -lanp|grep nginx
  3. tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      9867/nginx
  4. unix  3      [ ]         STREAM     CONNECTED     465408 9867/nginx
  5. unix  3      [ ]         STREAM     CONNECTED     465407 9867/nginx


CentOS5安装Nginx1.4+PHP5.5 FastCGI相关推荐

  1. centos php 开启libgdgd_CentOS6.5安装Nginx1+MySQL5+PHP5

    准备篇 一.配置防火墙,开启80端口,3306端口 [root@localhost~]# vim /etc/sysconfig/iptables -A INPUT -m state --state N ...

  2. Ubuntu14.04 64bit 编译安装nginx1.7+php5.4+mysql5.6

    我的操作系统是Ubuntu14.04,其它linux系统的操作流程类似. 主要安装的软件是nginx1.7+php5.4+mysql5.6 1. 创建必要目录 sudo mkdir ~/setup s ...

  3. CentOS6.3编译安装Nginx1.4.7 + MySQL5.5.25a + PHP5.3.28

    2019独角兽企业重金招聘Python工程师标准>>> [准备工作] 01 #在编译安装lnmp之前,首先先卸载已存在的rpm包. 02 rpm -e httpd 03 rpm -e ...

  4. CentOS 6.3编译安装Nginx1.2.2+MySQL5.5.25a+PHP5.4.5

    CentOS 6.3编译安装Nginx1.2.2+MySQL5.5.25a+PHP5.4.5 准备篇: 一.配置好IP.DNS .网关,确保使用远程连接工具能够连接服务器       CentOS 设 ...

  5. centos 6.2 编译安装mysql_CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13

    CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13 2013-10-24 15:31:12 标签:服务器 防火墙 file 配置文件 written 一.配置 ...

  6. CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13+博客系统WordPress3.3.2

    说明: 操作系统:CentOS 6.2 32位 系统安装教程:CentOS 6.2安装(超级详细图解教程): http://www.osyunwei.com/archives/1537.html 准备 ...

  7. linux编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14

    linux编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14的方法对于 我这个小菜菜来讲是非常的复杂的还好有这篇文章,下面一起来看看吧. 一.使用系统镜像文件配置本地yum源 1 ...

  8. CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13

    CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13 2013-10-24 15:31:12 标签:服务器 防火墙 file 配置文件 written 一.配置 ...

  9. mysql 1.6安装_centos 6.6编译安装nginx1.6.2+mysql5.6.21+php5.6.3.docx

    centos 6.6编译安装nginx1.6.2+mysql5.6.21+php5.6.3.docx 还剩 12页未读, 继续阅读 下载文档到电脑,马上远离加班熬夜! 亲,喜欢就下载吧,价低环保! 内 ...

最新文章

  1. MC-21-B高精度电阻箱初步测试
  2. 02 基本序列以及序列表示
  3. 推荐一个C++练手项目,面试也可用
  4. 快学Scala习题解答—第二章 控制结构和函数
  5. Android 命名规范 (提高代码可以读性) 转
  6. Framework学习(一)深入Android 系统架构
  7. Python+sklearn使用朴素贝叶斯算法识别中文垃圾邮件
  8. python使用相对路径创建文件夹
  9. tf卡可以自己裁剪成nm卡_这些年Surface 3用过的TF卡与购买心得
  10. CEF加载PPAPI插件
  11. w10恢复出厂设置_笔记本电脑w10怎么恢复出厂设置
  12. Unity3d报错:Error building Player: Win32Exception: ApplicationName='xxxxxx/zipalign.exe'
  13. 如何管理NVivo的查询结果
  14. html 5与css 3权威指南 第2版 pdf,html5与css3权威指南
  15. magic3是鸿蒙系统吗,如果荣耀Magic3搭载屏下镜头和鸿蒙系统,你会做第一批吗?...
  16. 大疆精灵4多光谱无人机P4M影像辐射定标方法(二)
  17. Guacamole会话记录屏幕录像
  18. android studio开发十一 Library第三方类库源码, Jar包和SO库
  19. Zigzag小整数压缩算法
  20. int a是神么意思

热门文章

  1. oracle 实时查询最耗CPU资源的SQL语句
  2. linux下生成源程序控制流图,Linux下控制(统计)文件的生成的C代码实现
  3. wopi php,Office Online Server WOPI 接口
  4. ubuntu查看gpu使用率_如何监控GPU卡的使用率(Linux)
  5. 斐波那契数列c++代码_轮到你了,斐波那契数列!
  6. c语言固定长度的字符串,【分享】C语言动态长度字符串
  7. 可做fft分析吗_小吃店生意好做吗,小吃业行情分析
  8. java 创建日程到期提醒_日程管理工具—Things 3
  9. 12个 Linux 中 grep 命令的超级用法实例
  10. netflix_Netflix播放按钮剖析