LNMP=Linux+Nginx+Mysql+PHP

Install Nginx

//安装依赖包
# yum install openssl openssl-devel zlib-devel //安装pcre
# wget http://exim.mirror.fr/pcre/pcre-8.01.tar.gz
# tar xf pcre-8.01.tar.gz -C /usr/local/web/
# cd /usr/local/web/pcre-8.01/
# ./configure
# make ; make install //安装libmd5
http://ftp.mirrorservice.org/sites/ftp.wiretapped.net/pub/security/cryptography/libraries/libeay/
# tar xf libmd5-0.8.2b.tar.gz -C /usr/local/web/
# ls /usr/local/web/md5/
Makefile asm md5.c md5.h md5_dgst.c md5_locl.h md5_one.c md5s.cpp md5test.c ranlib.sh //安装Nginx
# wget http://nginx.org/download/nginx-1.10.1.tar.gz
# tar xf nginx-1.10.1.tar.gz -C /usr/local/web/
# cd /usr/local/web/nginx-1.10.1/
# useradd nginx
# id nginx
uid=502(nginx) gid=502(nginx) groups=502(nginx)
# ./configure \
--user=nginx \
--group=nginx \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-md5=/usr/local/web/md5 \
--with-sha1=auto/lib/sha1 \
--with-pcre=/usr/local/web/pcre-8.01 \
--without-select_module \
--without-poll_module \
--without-http_ssi_module \
--without-http_userid_module \
--without-http_geo_module \
--without-http_map_module \
--without-http_memcached_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--prefix=/usr/local/nginx-1.10.1
# make;make install
--with-http_realip_module
此模块支持显示真实来源IP地址,主要用于NGINX做前端负载均衡服务器使用。 -with-http_stub_status_module
这个模块可以取得一些nginx的运行状态, --with-http_gzip_static_module
这个模块在一个预压缩文件传送到开启Gzip压缩的客户端之前检查是否已经存在以“.gz”结尾的压缩文件,这样可以防止文件被重复压缩。 --with-md5=/soft/md5/
设定md5库文件路径 --with-sha1=auto/lib/sha1
设定sha1库文件路径
--with-pcre=/soft/pcre-8.01
设定PCRE库路径 --without-select_module
标准连接模式。默认情况下自动编译方式。您可以启用或禁用通过使用-select_module和不带- select_module配置参数这个模块 --without-poll_module
不使用poll模块 --without-http_ssi_module
不使用ngx_http_ssi_module模块,此模块处理服务器端包含文件(ssi)的处理. --without-http_userid_module
不使用ngx_http_userid_module模块 --without-http_geo_module
这个模块基于客户端的IP地址创建一些ngx_http_geoip_module变量,并与MaxMindGeoIP文件进行匹配,该模块仅用于 0.7.63和0..6版本之后。但效果不太理想,对于城市的IP记录并不是特别准确,不过对于网站的来源访问区域的分析大致有一定参考性

--without-http_map_module
不使用ngx_http_map_module模块 --without-http_memcached_module
不使用ngx_http_memcached_module模块 --without-mail_pop3_module
不允许ngx_mail_pop3_module模块 --without-mail_imap_module
不允许ngx_mail_imap_module模块 --without-mail_smtp_module
不允许ngx_mail_smtp_module模块

Ngnix编译参数详解

Install PHP

//安装PHP依赖
①libxml2-2.7.7.tar.gz
# cd /data/soft/
#tar xf libxml2-2.7.7.tar.gz –C tmp/
# cd tmp/libxml2-2.7.7/
#./configure --prefix=/usr/local/services >/dev/null
#make >/dev/null && make install >/dev/null ②curl-7.21.4.tar.gz
# cd /data/soft/
# tar xf curl-7.21.4.tar.gz -C tmp/
# cd tmp/curl-7.21.4/
#./configure --prefix=/usr/local/services >/dev/null
#make >/dev/null && make install >/dev/null ③jpegsrc.v8b.tar.gz
# cd /data/soft/
#tar xf jpegsrc.v8b.tar.gz –C tmp/
#cd tmp/jpeg-8b/
#./configure --prefix=/usr/local/services >/dev/null
#make >/dev/null && make install >/dev/null ④libpng-1.4.3.tar.gz
# cd /data/soft/
# tar xf libpng-1.4.3.tar.gz -C tmp/
# cd tmp/libpng-1.4.3/
#./configure --prefix=/usr/local/services >/dev/null
#make >/dev/null && make install >/dev/null ⑤freetype-2.4.1.tar.gz
# cd /data/soft/
# tar xf freetype-2.4.1.tar.gz -C tmp/
# cd tmp/freetype-2.4.1/
#./configure --prefix=/usr/local/services >/dev/null
#make >/dev/null && make install >/dev/null ⑥libevent-2.0.10-stable.tar.gz
# cd /data/soft/
# tar xf libevent-2.0.10-stable.tar.gz –C tmp/
# cd tmp/libevent-2.0.10-stable/
#./configure --prefix=/usr/local/services --disable-debug-mode >/dev/null
#make >/dev/null && make install >/dev/null ⑦re2c-0.13.5.tar.gz
# cd /data/soft/
# tar xf re2c-0.13.5.tar.gz -C tmp/
# cd tmp/re2c-0.13.5/
#./configure --prefix=/usr/local/services >/dev/null
#make >/dev/null && make install >/dev/null ⑧libmcrypt-2.5.8.tar.gz
# cd /data/soft/
# tar xf libmcrypt-2.5.8.tar.bz2 -C tmp/
# cd tmp/libmcrypt-2.5.8/
#./configure --prefix=/usr/local/services >/dev/null
#make >/dev/null && make install >/dev/null
# cd libltdl/
# ./configure --prefix=/usr/local/services --enable-ltdl-install >/dev/null
#make >/dev/null && make install >/dev/null
//安装php
#wget http://php.net/distributions/php-5.3.13.tar.gz
# cd /data/soft/
# tar xf php-5.3.13.tar.gz -C tmp/
#cd tmp/php-5.3.13/
# ./configure \
--enable-zend-multibyte \
--enable-mbstring \
--enable-sockets \
--enable-pdo \
--enable-zip \
--enable-fpm \
--with-gd \
--with-fpm-user=user_00 \
--with-fpm-group=user_00 \
--with-zlib \
--with-config-file-path=/usr/local/services/php-5.3.13/etc \
--with-libxml-dir=/usr/local/services \
--with-curl=/usr/local/services \
--with-png-dir=/usr/local/services \
--with-jpeg-dir=/usr/local/services \
--with-freetype-dir=/usr/local/services \
--with-mysql=/usr/local/services/mysql-5.1.49 \
--with-pdo-mysql=/usr/local/services/mysql-5.1.49 \
--with-mysqli=/usr/local/services/mysql-5.1.49/bin/mysql_config \
--prefix=/usr/local/services/php-5.3.13 # make >/dev/null && make install >/dev/null 编译错误解决:
/var/lib/mysql/mysql.sock
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!
解决方法:
cp -rp /usr/lib64/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so
//安装php扩展
①eaccelerator-0.9.6.1.tar.bz2
# cd /data/soft/
#tar xf eaccelerator-0.9.6.1.tar.bz2 -C tmp/
#cd tmp/eaccelerator-0.9.6.1/
# /usr/local/php-5.3.13/bin/phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
#./configure --prefix=/usr/local/services/eaccelerator-0.9.6.1 --enable-eaccelerator --with-php-config=/usr/local/services/php-5.3.13/bin/php-config > /dev/null
#make
# make install
Installing shared extensions: /usr/local/php-5.3.13/lib/php/extensions/no-debug-non-zts-20090626/
#mkdir /tmp/eaccelerator
#chmod 777 /tmp/eaccelerator ②memcached-1.4.13.tar.gz
(服务器端要前安装,下面的编译扩展模块要用到)
# cd /data/soft/
#tar xf memcached-1.4.13.tar.gz -C tmp/
# cd tmp/memcached-1.4.13/
#./configure --enable-64bit --with-libevent=/usr/local/services --prefix=/usr/local/services/memcached-1.4.13 >/dev/null
# make >/dev/null && make install >/dev/null ③libmemcached-0.48.tar.gz
# cd /data/soft/
#tar xf libmemcached-0.48.tar.gz -C tmp/
#cd tmp/libmemcached-0.48/
#CONFOPTS="
--disable-libinnodb
--without-libinnodb-prefix
--with-libevent-prefix=/usr/local/services
--with-memcached=/usr/local/services/memcached-1.4.13/bin/memcached
--prefix=/usr/local/services
"
#./configure $CONFOPTS >/dev/null
#make >/dev/null && make install >/dev/null ④igbinary-1.0.2.tgz
# cd /data/soft/
# tar xf igbinary-1.0.2.tar.gz -C tmp/
#cd tmp/igbinary-1.0.2/
# /usr/local/php-5.3.13/bin/phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
#./configure --enable-igbinary --with-php-config=/usr/local/services/php-5.3.13/bin/php-config >/dev/null
#make >/dev/null && make install >/dev/null
# make install
Installing shared extensions: /usr/local/php-5.3.13/lib/php/extensions/no-debug-non-zts-20090626/
Installing header files: /usr/local/php-5.3.13/include/php/ ⑤memcache-3.0.5.tgz
# cd /data/soft/
# tar xf memcache-3.0.5.tgz -C tmp/
#cd tmp/memcache-3.0.5/
#/usr/local/services/php-5.3.13/bin/phpize
#CONFOPTS=" \
--enable-memcache \
--with-php-config=/usr/local/services/php-5.3.13/bin/php-config \
"
#./configure $CONFOPTS >/dev/null
#make >/dev/null && make install >/dev/null ⑥memcached-1.0.2.tgz(注意安装的顺序,igbinary-1.1.1.tgz是依赖库)
# cd /data/soft/
# tar xf memcached-1.0.2.tgz -C tmp/
# cd tmp/memcached-1.0.2/
#/usr/local/services/php-5.3.13/bin/phpize
#./configure \
--enable-memcached \
--enable-memcached-igbinary \
--enable-memcached-json \
--with-libmemcached-dir=/usr/local/services \
--with-php-config=/usr/local/services/php-5.3.13/bin/php-config \
--prefix=/usr/local/services \
#make >/dev/null && make install >/dev/null ⑦owlient-phpredis-2.1.1-1-g90ecd17.tar.gz
# cd /data/soft/
#tar xf owlient-phpredis-2.1.1-1-g90ecd17.tar.gz -C tmp/
# cd tmp/owlient-phpredis-90ecd17/
#/usr/local/services/php-5.3.13/bin/phpize
#./configure --with-php-config=/usr/local/services/php-5.3.13/bin/php-config >/dev/null
#make >/dev/null && make install >/dev/null
//拷贝配置文件
# cd /usr/local/services/php-5.3.13/etc
# cp php-fpm.conf.default php-fpm.conf
# cp /soft/php/php-5.3.13/php.ini-production php.ini

Install Mysql(点击链接查看)

[LNMP]——LNMP环境配置的更多相关文章

  1. VM虚拟机 Centos7 lnmp环境 配置域名问题 windows浏览器访问的问题

    CentOS7  ip地址为 192.168.0.155 搭有 LNMP集成环境 执行 lnmp vhost add 配置服务器 指定目录的域名 mark.com 这时windows 机器的 浏览器想 ...

  2. CentOS 下 LNMP 环境配置

    安装配置 Nginx 安装配置 MySQL 安装配置 PHP Nginx 与 PHP-FPM 集成 环境配置验证   LNMP 环境代表 Linux 系统下 Nginx + MySQL + PHP 网 ...

  3. LNMP(linux+nginx+mysql+php)服务器环境配置【转载】

    本文转载自 园友David_Tang的博客,如有侵权请联系本人及时删除,原文地址: http://www.cnblogs.com/mchina/archive/2012/05/17/2507102.h ...

  4. Mac OSX 下配置 LNMP开发环境

    不久前负责了一个项目需要配置PHP7的开发环境,因为之前所有的项目用的是PHP5的,所以研究了这些东西,但是很遗憾,电脑出了问题,不得已重装了系统,然后你懂得...什么都没有了,要重新来过.. 虽然本 ...

  5. linux--->阿里云centos6.9环境配置安装lnmp

    阿里云centos6.9环境配置安装lnmp mysql安装 本人博客:http://www.cnblogs.com/frankltf/p/8615418.html PHP安装 1.安装依赖关系 yu ...

  6. 图文详解如何快捷搭建LNMP服务环境

    上一篇与大家一起学习了下如何搭建LAMP环境的知识,今天小编再和大家分享下如何快捷地搭建LNMP环境,并搭建起一个网站.Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/S ...

  7. LNMP搭建环境遇到的N多坑

    最近配置开发用的lnmp环境,环境配置完成后,爆500错误,查看nginx错误日志 open_basedir 将 PHP 所能打开的文件限制在指定的目录树,包括文件本身 错误日志显示,访问脚本不在 o ...

  8. LNMP + Apache 架构配置

    从事前端开发已3年有余,越来越发现前端开发要学习的知识已不仅仅是html+css+js那么简单了,2017年市场上就有了大前端的概念,可以说对前端工程师的要求也越来越高了,从招聘的要求中可以看到熟悉一 ...

  9. CentOS7 LNMP+phpmyadmin环境搭建(三、安装phpmyadmin)

    之前我们已经安装了lnmp的环境,现在让我们来安装phpmyadmin. 跟前一样,yum默认的库里是没有phpmyadmin的,我们需要从epel库里进行安装,之前已经安装过epel的朋友就可以直接 ...

  10. 使用Docker 一键部署 LNMP+Redis 环境

    使用Docker 部署 LNMP+Redis 环境 Docker 简介 Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linu ...

随机推荐

  1. Verilog MIPS32 CPU(四)-- RAM

    Verilog MIPS32 CPU(一)-- PC寄存器 Verilog MIPS32 CPU(二)-- Regfiles Verilog MIPS32 CPU(三)-- ALU Verilog M ...

  2. 数独高阶技巧之八——SDC

    在本系列的第四篇“简单异数链”中,向大家介绍了XY-Wing等一系列Wing类技巧,并提到可以用(拐弯的)数组的观念来理解这些结构,经过第六篇ALS的学习之后,大家回过头再去看Wing,应该可以发现相 ...

  3. C# usb设备的自动退出

    using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServi ...

  4. .net core session cookie操作

    配置Session Cookie注意

  5. C# TinyIOC简单用法

    先添加一个接口 namespace IContract { public interface IBase { void ShowMessage(); } } 再添加两个实现类 namespace Co ...

  6. hdu Surround the Trees

    题目链接:戳我 凸包模板 #include<iostream> #include<cstdio> #include<cstring> #include<alg ...

  7. Mayor's posters 线段树区间覆盖

    题目链接 http://poj.org/problem?id=2528 Description The citizens of Bytetown, AB, could not stand that t ...

  8. leetcode 42. 接雨水 JAVA

    题目: 给定 n 个非负整数表示每个宽度为 1 的柱子的高度图,计算按此排列的柱子,下雨之后能接多少雨水. 上面是由数组 [0,1,0,2,1,0,1,3,2,1,2,1] 表示的高度图,在这种情况下 ...

  9. 标题title出现不规则背景

    Html代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...

  10. kvm虚拟化之kvm虚拟机克隆

    kvm虚拟机的克隆分为两种情况,本文也就通过以下两种情况进行克隆,克隆虚拟机为OEL5.8X64. (1) KVM主机本机虚拟机直接克隆. (2) 通过复制配置文件与磁盘文件的虚拟机复制克隆(适用于异 ...