center7系统搭建lnmp

Posted suxiaolong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了center7系统搭建lnmp相关的知识,希望对你有一定的参考价值。


center6.9 php5.6 mysql5.7 这些都已经结束了
center7 php7

php -i |less 查看配置文件在哪里,编译参数
php -m |less 查看php加载的模块

 

------mariadb安装
yum install mariadb mariadb-server
systemctl start mariadb #启动MariaDB
systemctl stop mariadb #停止MariaDB
systemctl restart mariadb #重启MariaDB
systemctl enable mariadb #设置开机启动

mysql -u root -p
update mysql.user set password=PASSWORD(‘#mysql123456‘) where user=‘root‘; #修改密码
flush privileges;

create user ‘xiaolong‘@‘%‘ identified by ‘#mysql123456‘; #创建用户
grant select on visa.* to ‘xiaolong‘@‘%‘; #给用户分配权限

#添加远程登录用户
CREATE USER ‘xiaosu10‘@‘%‘ IDENTIFIED WITH mysql_native_password BY ‘#mysql123456‘;
GRANT ALL PRIVILEGES ON *.* TO ‘xiaosu‘@‘%‘;
flush privileges;


CREATE USER ‘xiaosu10‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘#mysql123456‘;
GRANT ALL PRIVILEGES ON *.* TO ‘xiaosu‘@‘%‘;
flush privileges;

参考连接 https://towait.com/blog/how-to-upgrade-to-php-7-on-centos-7/
https://www.centos.bz/2018/05/centos-6-7-%E5%8D%87%E7%BA%A7-php-5-6-%E5%88%B0-7-1-7-2/ (全)
-------PHP7安装
yum -y remove php* php-common?
phpMyAdmin目前还未支持PHP7

安装php7的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

php -v 查看PHP版本

(可)
yum -y install php71w php71w-cli php71w-common php71w-devel php71w-embedded php71w-fpm php71w-gd php71w-mbstring php71w-mysqlnd php71w-opcache php71w-pdo php71w-xml php71w-ldap php71w-mcrypt

------配置nginx,php-fpm
vi /etc/php-fpm.d/www.conf
默认group,user = apache 的,要改为nginx
vi /etc/nginx/nginx.conf
user nginx nginx; #修改nginx运行账号为:nginx组的nginx用户

sudo systemctl start php-fpm
sudo systemctl enable php-fpm # 设置开启启动


systemctl restart nginx #centeros7 只能用这种方式重启服务

---git
yum -y install git # 默认安装的是1.8版本的
yum -y upgrade git # 升级 X
yum remove git
yum remove -y git | yum -y install git2u # center7安装git2u

 

git config --global user.name "xiaosu"
git config --global user.email "xxxx@qq.com"
git stash # 打包,清空工作区
git stash pop # 恢复最新进度到工作区

 

以上是关于center7系统搭建lnmp的主要内容,如果未能解决你的问题,请参考以下文章

Linux系统下LNMP一键搭建LinuxPHPMySQL环境(适合新手搭建linux下的web生成环境)

详述Linux系统中搭建LNMP架构+Discuz论坛

zabbix监控系统的搭建

lnmp 搭建 typecho博客系统

Ubuntu系统下lnmp环境的搭建

Ubuntu 系统搭建LNMP环境