lnmp环境搭建

基础环境:

wmware  , centos7.5 

1.安装httpd

yum -y install httpd

2.启动httpd

systemctl start httpd

3.设置开机自启动

systemctl enable httpd

4.验证httpd

浏览器输入ip即可

5.安装maraidb

yum -y install mariadb

6.安装mariadb-server

yum install -y mariadb-server

7.启动mariadb

systemctl start mariadb

8.设置开机自启动

sysyemctl enable mariadb

9.安装epel(nginx不在yum源里,所以需要安装)

a:获取epel

wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

b:安装epel

rpm -ivh epel-release-latest-7.noarch.rpm

10.安装php,及扩展。如果之前已经安装我们先卸载一下

yum -y remove php*

由于linux的yum源不存在php7.x,所以我们要更改yum源

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm   

yum 安装php72和各种拓展,选自己需要的即可

yum -y install 

11.重启 httpd ,mariadb

systemctl restart mariadb

systemctl restart httpd

12.安装nginx

 yum -y install nginx

13.设置mysql密码

a: 登录mysql

mysql

b: 选择数据库

use mysql;

c: 更新用户密码

update user set password=password("123456")where user='root';

d: 设置远程连接

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;

e: 刷新

flush privileges;

14.安装git

yum -y install git

15.安装composer

cd /usr/local/bin

curl -s http://getcomposer.org/installer | php

chmod a+x composer.phar

alias composer=/usr/local/bin/composer.phar

你可能感兴趣的:(lnmp环境搭建)