centos源码安装lnmp
参考博客:http://blog.csdn.net/yanzi1225627/article/details/49123659
服务器环境为:CentOS6.6 64位(虚拟机)
一.安装前准备
创建www目录,在www目录下创建software目录用来存储软件安装包
二.安装所有的依赖包
yum -y install ntp make openssl openssl-devel pcre pcre-devel libpng libpng-devel libjpeg-6b libjpeg-devel-6b freetype freetype-devel gd gd-devel zlib zlib-devel gcc gcc-c++ libXpm libXpm-devel ncurses ncurses-devel libmcrypt libmcrypt-devel libxml2 libxml2-devel imake autoconf automake screen sysstat compat-libstdc++-33 curl curl-devel cmake
三.下载软件包
1.nginx:http://nginx.org/en/download.html 下载稳定版 nginx-1.10.3.tar.gz
2.mysql:http://dev.mysql.com/downloads/mysql/ 下载 mysql-5.5.54-linux2.6-x86_64.tar.gz
3.php:http://php.net/downloads.php 下载php-5.6.30.tar.gz
上传到 /www/software目录下
四.安装nginx
在/www/software目录下
1.tar -zxvf nginx-1.10.3.tar.gz
2.cd nginx-1.10.3
3../configure --user=www --group=www --prefix=/www/nginx
4.make
5.make install
6.groupadd -f www
7.useradd -g www www
8. cp /www/nginx/sbin/nginx /etc/init.d/
9. chmod 755 /etc/init.d/nginx
10.cd /etc/rc.d/init.d
11.新建nginx,如果有则覆盖,文件内容如下
#!/bin/bash
# nginx Startup script for the Nginx HTTP Server
# it is v.0.0.2 version.
# chkconfig: - 85 15
# description: Nginx is a high-performance web and proxy server.
# It has a lot of features, but it's not for everyone.
# processname: nginx
# pidfile: /var/run/nginx.pid
# config: /usr/local/nginx/conf/nginx.conf
nginxd=/www/nginx/sbin/nginx
nginx_config=/www/nginx/conf/nginx.conf
nginx_pid=/www/nginx/logs/nginx.pid
RETVAL=0
prog="nginx"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x $nginxd ] || exit 0
# Start nginx daemons functions.
start() {
if [ -e $nginx_pid ];then
echo "nginx already running...."
exit 1
fi
echo -n $"Starting $prog: "
daemon $nginxd -c ${nginx_config}
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/nginx
return $RETVAL
}
# Stop nginx daemons functions.
stop() {
echo -n $"Stopping $prog: "
killproc $nginxd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /www/nginx/logs/nginx.pid
}
reload() {
echo -n $"Reloading $prog: "
#kill -HUP `cat ${nginx_pid}`
killproc $nginxd -HUP
RETVAL=$?
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
stop
start
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|reload|status|help}"
exit 1
esac
exit $RETVAL
12.chmod 775 /etc/rc.d/init.d/nginx
13.chkconfig nginx on
14./etc/rc.d/init.d/nginx restart
15.service nginx restart
16.在浏览器中树localhost,显示
Welcome to nginx!
五.安装mysql
参考http://www.cnblogs.com/shiwaitaoyuan/p/6401334.html
六. 安装php
1. tar -zxvf php-5.6.30.tar.gz
2. cd php-5.6.30
./configure --prefix=/www/php --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-openssl --with-libxml-dir --with-zlib --enable-mbstring --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mysqlnd --with-pdo-mysql=/usr/local/mysql --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --with-curl
3.make 和make install
4.nginx整合php
打开/www/nginx/conf/nginx.conf,做如下修改


进到cp /www/php/etc/php-fpm.conf.default /www/php/etc/php-fpm.conf。
执行/www/php/sbin/php-fpm
5.配置php.ini
cp /root/www/software/php-5.6.30/php.ini-production /www/php/lib/。
centos源码安装lnmp的更多相关文章
- CENTOS6.5源码安装LNMP
CENTOS6.5源码安装LNMP 一.安装前准备 ########################################################################## ...
- CentOS源码安装QT
在VirtualBox上的CentOS下安装qt-everywhere-opensource-src-4.8.4 ,执行 ./confiure时失败,失败信息为:Basic XLib function ...
- linux 手动源码安装lnmp(亲测)
linux 手动源码安装lnmp笔记(亲测)<pre>先安装这2个yum install gccyum install g++</pre><pre>先在linux ...
- 源码安装LNMP与搭建Zabbix
系统环境:CentOS release 6.5 (Final) 搭建Zabbix 3.0对PHP环境要求>= 5.4 一.下载NMP的软件包: N:wget http://nginx.org/d ...
- 简单说明CentOS源码安装程序
第一步.安装依赖包.一般官网会有依赖关系,没有就网上搜索一下. 第二步.下载源码包,上传至CentOS服务器 第三步.解压缩 第四步.进入源码文件夹 第五步.执行./configure,这一步主要是为 ...
- CentOS 源码安装MySQL5.7
一.安装方式源码安装,源码包名称mysql-boost-5.7.27.tar.gz,此版本包含boost库,在解压后的boost路径下.安装时,可以-DDOWNLOAD_BOOST=1 -DWITH_ ...
- CentOS源码安装Wireshark
(2019年2月19日注:这篇文章原先发在自己github那边的博客,时间是2016年8月25日) Wireshark为网络管理员常用的一个网络管理工具,通过使用这个软件,我们可以对本机网卡上的经过的 ...
- linux(centos)源码安装git
最近使用一个开源库,部署的的时候需要用git克隆依赖库.刚好系统没安装git.就尝试了源码安装git. 源码下载地址:http://codemonkey.org.uk/projects/git-sna ...
- CentOS源码安装 Tomcat/8.0.24
依个人的习惯,喜欢将源码安装在/usr/local这个目录下面: 第一步:下载源码 wget http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.2 ...
随机推荐
- 1.使用python连接odps并获取项目
from odps import ODPS # 直接从odps模块导入ODPS这个类 # 然后传入相应的参数进行初始化即可 ''' ODPS函数接收的参数如下: access_id: 你的access ...
- [BZOJ1034][ZJOI2008]泡泡堂BNB 贪心
1034: [ZJOI2008]泡泡堂BNB Time Limit: 10 Sec Memory Limit: 162 MB Submit: 3414 Solved: 1739 [Submit][ ...
- js-限制参与活动的范围(微信H5活动)
近期接到大连某个项目,一个H5的活动,其中有一个需求就是:这个活动的参与者仅限大连地区的用户 所以参考了微信API 得出的操作结果为: wx.ready(function() { wx.getLoca ...
- 洛谷 P3955 图书管理员【模拟/思维】
题目描述 图书馆中每本书都有一个图书编码,可以用于快速检索图书,这个图书编码是一个 正整数. 每位借书的读者手中有一个需求码,这个需求码也是一个正整数.如果一本书的图 书编码恰好以读者的需求码结尾,那 ...
- Python的程序结构[4] -> 函数/Function[2] -> 匿名函数
匿名函数 / Anonymous Function 匿名函数是一种不需要绑定函数名的函数 (i.e. functions that are not bound to a name).匿名函数通过 la ...
- php 快速上手
基本语法 PHP 标记 php 以 <?php 和 ?>(可以选用, 推荐, 防止输出空白) 作为开始和结束标记. 打印 php 有 echo(多参数) 和 print(单参数) 可以用于 ...
- Tarjan缩点+LCA【p2783】有机化学之神偶尔会做作弊
Description 你翻到那一题:给定一个烃,只含有单键(给初中生的一个理解性解释:就是一堆碳用横线连起来,横线都是单条的). 然后炎魔之王拉格纳罗斯用他的火焰净化了一切环(???).所有的环状碳 ...
- Kth Smallest Element in a Sorted Matrix -- LeetCode
Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth ...
- k8s学习
k8s简介 在学习k8s之前,相信大家和我一样,肯定都学习和使用过docker容器,并且对容器技术有了一个基本的认识.引用张磊老师的总结:其实一个"容器",实际上是一个由Linux ...
- 八. 输入输出(IO)操作3.面向字符的输出流
面向字符的输出流都是类 Writer 的子类,其类层次结构如图 10-5 所示. 图10-5 Writer的类层次结构图 表 10-3 列出了 Writer 的主要子类及说明. 表 10-3 Writ ...