php+mysql+nginx+liunx 快速环境部署

安装php7相应的yum源

CentOS 7.x:

rpm -Uvh https://dl.fedoraproject.org/...

rpm -Uvh https://mirror.webtatic.com/y...

CentOS  6.x:

rpm -Uvh https://mirror.webtatic.com/y...

查看版本

yum search php7

安装php7

yum install mod_php71w php71w-opcache php71w-fpm

安装php7扩展:

yum install php71w-gd php71w-mbstring

yum install php71w php71w-bcmath php71w-cli php71w-common php71w-devel php71w-fpm php71w-gd php71w-mbstring php71w-mcrypt php71w-pdo php71w-pear php71w-pecl- php71w-process php71w-xm

安装nginx

yum install nginx

安装mysql

wget https://dev.mysql.com/get/mys...

rpm -Uvh mysql80-community-release-el7-2.noarch.rpm 

yum repolist all | grep mysql

vim /etc/yum.repos.d/mysql-community.repo

yum repolist enabled | grep mysql

yum install mysql-community-server

service mysqld start

mysql 修改密码

mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';
mysql> FLUSH PRIVILEGES;

liunx新增用户

useradd admin

groupadd admin

passwd admin

contos7端口开启

firewall-cmd --query-port=8083/tcp

firewall-cmd --zone=public --add-port=80/tcp --permanent

firewall-cmd --reload

systemctl start firewalld

systemctl stop firewalld

systemctl status firewalld 

contos6端口开启

yum -y install iptables-services

vi /etc/sysconfig/iptables

systemctl restart iptables.service #重启防火墙使配置生效

相关推荐