centos6.7下编译安装lnmp
很多步骤不说明了,请参照本人的centos6.7下编译安装lamp,这次的架构是nginx+php-fpm一台服务器,mysql一台服务器
(1)首先编译安装nginx:
操作命令: yum -y groupinstall "Development Tools" "Server Platform Development"
yum -y install pcre-devel
useradd -r nginx
mkdir /var/tmp/nginx 事先得创建此目录,不然启动nginx时会报错
tar xf nginx-1.8.1.tar.gz
cd nginx-1.8.1
./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx
--error-log-path=/var/log/nginx/error.log --conf-path=/etc/nginx/nginx.conf
--http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --
user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --http-
client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy/ --http-fastcgi-temp-
path=/var/tmp/nginx/fcgi/ --with-pcre
make && make install
echo "export PATH=/usr/local/nginx/sbin:$PATH" > /etc/profile.d/nginx.sh
exec bash
(2) 编译安装php:
操作命令: yum -y install libxml2-devel bzip2-devel libjpeg-devel libpng-devel freetype-devel libcurl-devel
libmcrypt-devel(此包在epel源中)
tar xf php-5.4.40.tar.bz2 cd php-5.4.40
./configure --prefix=/usr/local/php --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --
with-openssl --enable-fpm --enable-sockets --enable-sysvshm --enable-mbstring --with-freetype-dir --with-jpeg-dir -
-with-png-dir --with-zlib-dir --with-libxml-dir=/usr --enable-xml --with-mhash --with-mcrypt --with-config-file-
path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --with-curl
make && make install make test
cp php.ini-production /etc/php.ini
cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
chmod +x /etc/rc.d/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 为php-fpm提供配置文件
vim /usr/local/php/etc/php-fpm.conf
pm.max_children = 150 最大进程数(根据压测进行调试)
pm.start_servers = 8
pm.min_spare_servers = 5
pm.max_spare_servers = 10
user=nginx
group=nginx
(3)整合nginx和php5
vim /etc/nginx/nginx.conf

$fastcgi_script_name 代表请求的uri 映射关系为 www.$$$.com/index.php --> /use/local/nginx/html/index.php
fastcgi_params 映射到此文件/etc/nginx/fastcgi_params
MySQL的编译安装在编译lamp博文中已经介绍了,此处不叙述
使用fastcgi_cache 模块添加缓存功能
在http上下文中添加下面选项:

为php添加加速器:
tar xf xcache-3.2.0.tar.bz2 cd xcache-3.2.0
/usr/local/php/bin/phpize ./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config
make && make install mkdir /etc/php.d cp xcache.ini /etc/php.d/
service php-fpm restart
查看各软件编译时的参数:
php:php -r "phpinfo();" | grep configure
nginx: nginx -V
apache: cat /usr/local/httpd/build/config.nice
mysql: cat /usr/local/mysql/bin/mysqlbug | grep CONFIGURE_LINE
centos6.7下编译安装lnmp的更多相关文章
- centos下编译安装lnmp
centos下编译安装lnmp 本文以centos为背景在其中编译安装nginx搭建lnmp环境. 编译安装nginx时,需要事先安装 开发包组"Development Tools" ...
- centos6.7下 编译安装MySQL5.7
centos6.7下编译安装MySQL5.7 准备工作 #-----依赖包及MySQL和boost安装包----- #yum包安装: shell> yum -y install gcc-c++ ...
- Linux(CentOS6.5)下编译安装PHP5.6.22时报错”configure: error: ZLIB extension requires gzgets in zlib”的解决方式(确定已经编译安装Zlib,并已经指定Zlib路径)
本文地址http://comexchan.cnblogs.com/,作者Comex Chan,尊重知识产权,转载请注明出处,谢谢! 今天在CentOS6.5下编译安装PHP时,一直报错 confi ...
- CentOS6.5_64bit下编译安装MySQL-5.6.23
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/44785511 ************************************** ...
- CentOS6.5下编译安装LAMP环境
LAMP(Linux-Apache-MySQL-PHP)网站架构是目前国际流行的Web框架.该框架能够满足大流量.大并发量的网站需求:当然.也可以直接使用高性能的服务器.高性能的负载均衡硬件以及CDN ...
- 阿里云centos6.5实践编译安装LNMP架构web环境
LNMP 代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构. 本次测试需求: **实践centos6.5编译安装 LNMP生产环境 架构 web生产环境 使用 ngx_pa ...
- centos6源码编译安装lnmp环境
操作系统 版本 64位 CentOS-6.6 10.0.0.20 安装环境所需依赖包 yum -y install gcc automake autoconf libtool make gcc- ...
- centos6.7下编译安装lamp环境
编译C源代码: 前提:提供开发工具及开发环境 通过“包组”提供开发组件,CentOS 6: "Development Tools", "Server Platform D ...
- Centos6.5下编译安装ACE6.0
ACE在Linux下的编译安装步骤(CentOS6.5 64Bit) Linux平台安装(CentOS6.5 64bit) 1, 下载ACE软件包,上传至Linux服务器(假设目录为/opt/ace, ...
随机推荐
- ASP.NET MVC4 WebAPI若干要点
本文仅仅是将一些可以运行无误的WebAPI示例的要点,记录下来,供自己查阅,也供刚刚学习WebAPI的读者参考之. 1.默认的API是不会过滤到action这个级别的,如果要过滤到这个级别,必须在路由 ...
- java 对象类型的转换
import com.java.charpt05.NewStr; class Quadrangle{ public static void draw(Quadrangle q) { ...
- Regional Changchun Online--Elven Postman(裸排序二叉树)
Elven Postman Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Tot ...
- ubuntu关闭THP
所有linux系统详细设置参考: https://docs.mongodb.org/manual/tutorial/transparent-huge-pages/ vi /etc/init.d/dis ...
- Loadrunner性能指标分析
Transactions(用户事务分析)----用户事务分析是站在用户角度进行的基础性能分析. Transation Sunmmary(事务综述)----对事务进行综合分析是性能分析的第一步,通过分析 ...
- noip2009 潜伏者
P1071 潜伏者 827通过 2.2K提交 题目提供者洛谷OnlineJudge 标签字符串模拟2009NOIp提高组 难度普及/提高- 提交该题 讨论 题解 记录 题目描述 R 国和 S 国正 ...
- 华为OJ平台——整形数组合并
题目描述: 将两个整型数组按照升序合并,并且过滤掉重复数组元素 输入: 输入说明,按下列顺序输入: 1 输入第一个数组的个数 2 输入第一个数组的数值 3 输入第二个数组的个数 4 输入第二个数组的数 ...
- FindResource函数错误代码:1813-找不到映像文件中指定的资源类型 与LoadResource函数错误代码:1812-指定的映像文件不包含资源区域
HRSRC WINAPI FindResource( _In_opt_ HMODULE hModule, _In_ LPCTSTR lpName, _In_ LPCTSTR lp ...
- 二模09day1解题报告
T1.词编码(word) 给出一些原长为n的01串经过变化后的串求原串.原串的特点是:各个1的位置号和%(n+1)==0 变法(只取其一): 改一个0为1 删一个 加一个 不变. 其中2优先考虑位置靠 ...
- 【Spring 1】Spring简介
一.Spring简介 首先,Spring框架是由于软件开发的复杂性而创建的.Spring使用的是基本的JavaBean来完成以前只可能由EJB完成的事情.然而,Spring的用途不仅仅限于服务器端的开 ...