Centos7 yum安装LNMP
1、Centos7系统库中默认是没有nginx的rpn包的,所以我们需要先更新下rpm依赖库
(1):使用yum安装nginx,安装nginx库
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
(2):使用下面命令安装nginx
yum -y install nginx
(3):启动nginx
service nginx start #centos6
或
systemctl start nginx.service #centos7
(4):防火墙允许通过80端口-

vim /etc/sysconfig/iptables # Generated by iptables-save v1.4.7 on Thu Dec 28 19:47:19 2017
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [21691:949300]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

(5):重启防火墙
service iptables restart
(6):访问网站,查看是否出现 'Welcome To Nginx',如果想更改网站根目录,修改地址:vim /etc/nginx/conf.d/default.conf,修改Root 后面的路径,详细请参考:Liscookie

2、安装Mysql,先更新yum源
(1):yum源下载地址,根据自己需要的版本选择相应的源
https://dev.mysql.com/downloads/repo/yum/

(2):我们版本是6.x的,所以选择linux 6 下载
wget https://repo.mysql.com//mysql57-community-release-el6-11.noarch.rpm
(3):安装mysql的yum源
rpm -Uvh mysql57-community-release-el6-11.noarch.rpm
或
yum -y localinstall mysql57-community-release-el6-11.noarch.rpm
(4):查看是否配置mysql源成功
在/etc/yum.repos.d下面

(5):安装Mysql
yum -y install mysql-community-server
#时间有点长,稍微等一下
(6):开始mysql服务
service mysqld start

(7):Mysql安装成功之后,会自动创建root的密码,存储在/var/log/mysqld.log,可以通过以下命令来查看
grep 'temporary password' /var/log/mysqld.log

(8):登录mysql,修改密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Wang123!';
(9):开启远程链接,iptables开放3306端口
vim /etc/sysconfig/iptables

(10):重启防火墙使iptables生效
service iptables restart
3、安装PHP
(1):更新yum源
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
(2):安装PHP
yum -y install --enablerepo=remi --enablerepo=remi-php56 php php-bcmath php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-gd php-xml php-memcache php-redis php-fpm php-mysql php-common php-mssql
(3):配置php.ini文件,关闭php信息头
vim /etc/php.ini
#366行左右
expose_php = Off #关闭phpxinxi
(4):启动PHP,设置开机启动
service php-fpm restart #启动php
chkconfig php-fpm --level 2345 on #设置开机启动
OK,至此,已经安装完成了LNMP
source:https://www.cnblogs.com/willamwang/p/8241506.html
Centos7 yum安装LNMP的更多相关文章
- centos7 yum 安装lnmp
centos7 yum 安装lnmp 安装7.2把7.1改成7.2就行 使用第三方扩展epel源安装php7.2 #移除旧版php [root@web02 ~]# yum remove php-m ...
- CentOS7使用yum安装LNMP环境以后无法打开php页面
CentOS7使用yum安装LNMP环境以后无法打开php页面 页面提示为File not found 查看nginx错误日志/var/log/nginx/error.log提示如下 原因分析 ngi ...
- centos7 yum搭建lnmp环境及配置wordpress超详细教程
yum安装lnmp环境是最方便,最快捷的一种方法.源码编译安装需要花费大量的人类时间,当然源码编译可以个性化配置一些其它功能.目前来说,yum安装基本满足我们搭建web服务器的需求. 本文是我根据近期 ...
- CentOS7 yum 安装git
1.查看系统是否已经安装git git --version 2.CentOS7 yum 安装git yum install -y git 3.安装成功 4.卸载git yum remove git
- [转帖]Centos7 yum安装Chrome浏览器
Centos7 yum安装Chrome浏览器 https://www.cnblogs.com/ianduin/p/8727333.html以及https://blog.csdn.net/libaine ...
- centos7 yum安装配置redis 并设置密码
原文:https://www.cnblogs.com/fanlinglong/p/6635828.html centos7 yum安装配置redis 并设置密码 1.设置Redis的仓库地址 yum ...
- centos7 yum安装遇到报错:Head V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEYer
centos7 yum安装时遇到错误:Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY 无法安装时,可按如下方法解决: This mini ...
- centos7 yum安装MongoDB
centos7 yum安装MongoDB 原文博客地址http://xgs888.top/post/view?id=64 centos7 yum安装mongodb: 1:创建仓库 vi /etc/ ...
- CentOS7 yum 安装 Nginx最新版本
CentOS7 yum 安装 Nginx最新版本 下载对应当前系统版本的nginx包(package) # wget http://nginx.org/packages/centos/7/noarc ...
随机推荐
- 【leetcode】1218. Longest Arithmetic Subsequence of Given Difference
题目如下: Given an integer array arr and an integer difference, return the length of the longest subsequ ...
- The Preliminary Contest for ICPC Asia Shanghai 2019 L. Digit sum
题目:https://nanti.jisuanke.com/t/41422 思路:预处理 #include<bits/stdc++.h> using namespace std; ][]= ...
- php如何实现大文件断点续传-php文件
总结一下大文件分片上传和断点续传的问题.因为文件过大(比如1G以上),必须要考虑上传过程网络中断的情况.http的网络请求中本身就已经具备了分片上传功能,当传输的文件比较大时,http协议自动会将文件 ...
- 2018山东省赛 E Sequence ( 思维 )
题目链接 题意 : 给出一个排列,让你删除一个数,使得删除后整个序列的 Good 数数量最多.Good 数的定义为 若 Ai 为 Good 则存在 Aj < Ai ( j < i ) 分析 ...
- Python3学习笔记(八):集合
集合(set)是一种可变的无序的不重复的数据类型 要创建集合,需要将所有项(元素)放在花括号({})内,以逗号(,)分隔. >>> s = {'p','y','t','h','o', ...
- 在linux下搭建go环境
这几天小Jerry开始接触Go语言了,因为小Jerry学个东西必须要从最基础的开始弄懂,不然~她理解不了<hahaha> 所以,今天就来讲最基础,却也很容易让小Jerry这样的菜鸟感到困扰 ...
- KVM 常用命令
显示虚拟机 virsh list --all 停止虚拟机 virsh destroy <name> 启动虚拟机 virsh start <name> 删除虚拟机 virsh u ...
- leetcode-mid-backtracking -22. Generate Parentheses-NO
mycode 没有思路,大早上就有些萎靡,其实和上一个电话号码的题如出一辙啦 参考: class Solution(object): def generateParenthesis(self, ...
- c++11多线程---线程入口函数
1.普通函数(线程入口) #include <thread> #include <iostream> void hello(const char *name) { std::c ...
- awk结合数组统计
1.统计用户登录类型 #!/bin/bashdeclare -A shells (定义关联数组shells)while read ll (读取/etc/passwd,ll为变量) dotype= ...