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 + ...
随机推荐
- [css] CSS3中的单位
FROM http://www.qianduan.net/understand-the-unit-of-length-in-the-css.html CSS3中的单位: css3中引入了一些新的单位: ...
- Web Serveice服务代理类生成及编译
本文链接地址:http://www.cnblogs.com/dengxinglin/p/3334158.html 一.生成代理类 对于web service服务和wcf的webservice服务,我们 ...
- lodash常用方法2--修改
1.map function timesThree(n) { return n * 3; } _.map([1, 2], timesThree); // => [3, 6] 2.remove 移 ...
- 01Mybatis_课程安排
课程安排: mybatis和springmvc通过订单商品 案例驱动 第一天:基础知识(重点,内容量多) 对原生态jdbc程序(单独使用jdbc开发)问题总结 mybatis框架原理 (掌握) m ...
- 【web前端面试题整理07】我不理解表现与数据分离。。。
拜师传说 今天老夫拜师了,老夫有幸认识一个JS高手,在此推荐其博客,悄悄告诉你,我拜他为师了,他承诺我只收我一个男弟子..... 师尊刚注册的账号,现在博客数量还不多,但是后面点会有干货哦,值得期待. ...
- Hybrid框架UI重构之路:二、事出有因
上文回顾:Hybird框架UI重构之路:一.师其长技以自强 一切的重构都是有原因的,或许为了更快速度.更好体验.更快捷开发等,于是就有了自己的开发目标,简单看看未重构前UI("中国移动式&q ...
- spring(4)——自动装配
set注入和构造注入有时在做配置时比较麻烦.所以框架为了提高开发效率,提供自动装配功能,简化配置.spring框架式默认不支持自动装配的,要想使用自动装配需要修改spring配置文件中<bean ...
- SAP中查询用户操作日志的事务码
事务码:STAD 注意:查询的时间跨度范围不要太大,否则会很慢! 事务码:ST03N 工作负载和性能统计
- Sharepoint学习笔记—习题系列--70-576习题解析 -(Q25-Q28)
Question 25 You are designing a SharePoint 2010 farm in your organization. You need to design the li ...
- Ioc Autofac心得
对于这个容器注入,个人也不是很熟悉,很多还不懂,只会基本的操作,几天把它记录下来,说不定以后帮助就大了呢,这方面跟安卓差距还是挺大的 下面记录下应用的流程 步骤: 1.添加应用 2.重写工厂(这里讲的 ...