CentOS6.5搭建LNMP
1:查看环境:
|
1
2
|
[root@10-4-14-168 html]# cat /etc/redhat-release CentOS release 6.5 (Final) |
2:关掉防火墙
|
1
|
[root@10-4-14-168 html]# chkconfig iptables off |
3:配置CentOS 6.0 第三方yum源(CentOS默认的标准源里没有nginx软件包)
|
1
|
#sh ./atomic |
|
1
|
#yum check-update |
4:安装开发包和库文件
|
1
2
3
4
|
#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 |
5:卸载已安装的apache、mysql、php
|
1
2
3
|
# yum remove httpd# yum remove mysql# yum remove php |
6:安装nginx
|
1
2
3
4
|
# yum install nginx# service nginx start# chkconfig --levels 235 nginx on//设2、3、5级别开机启动 |
7:安装mysql
|
1
2
3
|
# yum install mysql mysql-server mysql-devel# service mysqld start# chkconfig --levels 235 mysqld on |
|
1
2
3
4
5
6
7
8
|
登陆MySQL删除空用户,修改root密码mysql>select user,host,password from mysql.user;mysql>drop user ''@localhost;mysql>update mysql.user set password = PASSWORD('*********') where user='root';mysql>flush privileges; |
8:安装php
|
1
2
|
# yum install php lighttpd-fastcgi php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mssql php-snmp php-soap |
//安装php和所需组件使PHP支持MySQL、FastCGI模式
|
1
|
#yum install php-tidy php-common php-devel php-fpm php-mysql |
|
1
2
|
# service php-fpm start# chkconfig --levels 235 php-fpm on |
9:配置nginx支持php
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# mv /etc/nginx/nginx.conf /etc/nginx/nginx.confbak//将配置文件改为备份文件# cp /etc/nginx/nginx.conf.default /etc/nginx/nginx.conf//由于原配置文件要自己去写因此可以使用默认的配置文件作为配置文件//修改nginx配置文件,添加fastcgi支持# vi /etc/nginx/nginx.confindex index.php index.html index.htm;//加入index.phplocation ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; }//将以上代码注释去掉,并修改成nginx默认路径 |
|
1
|
|
10:配置php
|
1
2
|
//编辑文件php.ini,在文件末尾添加cgi.fix_pathinfo = 1[root@CentOS ~]# vi /etc/php.ini |
11:重启nginx php-fpm
|
1
2
|
# service nginx restart# service php-fpm restart |
12:建立info.php文件
|
1
2
3
4
|
# vi /usr/share/nginx/html/info.php<?php phpinfo();?> |
13:测试nginx是否解析php
|
1
2
|
本地浏览器输入:192.168.1.105/info.php显示php界面 环境搭建成功 |
CentOS6.5搭建LNMP的更多相关文章
- CentOS6.6搭建LNMP环境
CentOS6.6搭建LNMP环境 1.设置yum源,本地安装依赖包 1 yum -y install gcc gcc-c++ automake autoconf libtool make 2.下载依 ...
- CentOS6.7搭建LNMP环境
1:查看环境: [root@localhost ~]# cat /etc/redhat-release 2:关掉防火墙 #重启后生效开启 [root@localhost ~]# chkconfig i ...
- centos6.5搭建lnmp环境
注:本文原文链接:http://www.cnblogs.com/xiaoit/p/3991037.html 本文只是做保存使用 1:查看环境: [root@10-4-14-168 html]# cat ...
- centos6.4搭建lnmp服务(转载)
1.配置防火墙,开启80端口.3306端口vi /etc/sysconfig/iptables-A INPUT -m state --state NEW -m tcp -p tcp --dport 8 ...
- Centos6.x搭建lnmp环境
查看系统版本 #cat /etc/redhat-release CentOS release 6.7 (Final) 配置静态ip #vi /etc/sysconfig/network-scripts ...
- CentOS6.8搭建LNMP环境
selinux可能会致使编译安装失败,我们先禁用它.永久禁用,需要重启生效 sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/selinux/c ...
- 源码搭建LNMP
源码安装LNMP 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 欢迎加入:高级运维工程师之路 598432640 前言:非常简单的一个平台LNMP,在生产实际环 ...
- CentOS下Web服务器环境搭建LNMP一键安装包
CentOS下Web服务器环境搭建LNMP一键安装包 时间:2014-09-04 00:50来源:osyunwei.com 作者:osyunwei.com 举报 点击:3797次 最新版本:lnmp- ...
- CentOS源码安装搭建LNMP全过程(包括nginx,mysql,php,svn)【转】
转自:http://blog.csdn.net/yanzi1225627/article/details/49123659 服务器环境为:CentOS6.5 64位 目标:搭建LNMP(Linux + ...
随机推荐
- POS机刷卡跨行交易的清算方式
POS机刷卡的参与方比较多.以你在星巴克刷卡为例: 持卡人--你 发卡行--你办这张卡的银行,我们假设是工行 商户--星巴克,我们假设星巴克的账户开在建行 收单行--星巴克的刷卡机的归属银行,假设也是 ...
- 使用 WSO2 API Manager 管理 Rest API
WSO2 API Manager 简介 随着软件工程的增多,越来越多的软件提供各种不同格式.不同定义的 Rest API 作为资源共享,而由于这些 API 资源的异构性,很难对其进行复用.WSO2 A ...
- prototype和__proto__
一.prototype和__proto__的概念 prototype是函数的一个属性(每个函数都有一个prototype属性),这个属性是一个指针,指向一个对象.它是显示修改对象的原型的属性. __p ...
- 推荐25款实用的 HTML5 前端框架和开发工具【下篇】
快速,安全,响应式,互动和美丽,这些优点吸引更多的 Web 开发人员使用 HTML5.HTML5 有许多新的特性功能,允许开发人员和设计师创建应用程序和网站,带给用户桌面应用程序的速度,性能和体验. ...
- html4基础知识梳理
基础的html知识,只放Xmind的截图. 第一部分: 第二部分: 某些标签的使用示例及注意事项,在印象笔记里.
- js取url参数
function GetQueryString(name) { var reg = new RegExp("(^|&)"+ name +"=([^&]*) ...
- 【NodeJS 学习笔记01】不学就老了
前言 再不学nodeJs,我们就老了......在HTML5大浪袭来的时候,很多先辈就开始了NodeJs之旅,而那时我还在做服务器端的程序后来转成前端,和梯队的距离已经很大了,因为我会服务器端语言,还 ...
- Sharepoint学习笔记—习题系列--70-576习题解析 -(Q69-Q71)
Question 69 You are designing an extranet site using SharePoint 2010. This site must allow employees ...
- Sharepoint学习笔记—习题系列--70-576习题解析 -(Q81-Q83)
Question 81You are designing a custom administrative timer job for a SharePoint 2010 farm. You need ...
- 详细对比IB开发与纯手码开发的优劣。
1.IB是什么? Interface Builder 是一种通过图形化界面搭建UI的方式,并把窗口.菜单栏以及窗口上的各种控件的对象都“冻结”在了一个 NIB文档里:程序运行时,这些对象将会“苏醒”. ...