CentOS7 快速高效,简单安装 lnmp
Centos7的repo源安装软件非常的方便,能够让你快速的搭建自己的环境!
推荐大家使用!!!!!!
下面是安装lnmp的例子!!!!!
安装php 扩展源
yum update
yum install epel-release
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-utils
yum-config-manager --enable remi-php72
yum update
安装php
yum install php php-fpm php-mysqlnd php-opcache php-xml php-xmlrpc php-gd php-mbstring php-json php-zip
systemctl start php-fpm.service
systemctl enable php-fpm.service
安装nginx
yum install nginx
systemctl start nginx.service
systemctl enable nginx.service
安装 mariadb
yum install mariadb-server mariadb
systemctl start mariadb.service
systemctl enable mariadb.service
mysql_secure_installation
yum install php-mysql
允许访问80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-ports //查看开放的端口
关闭selinux
vim /etc/sysconfig/selinux
SELINUX=enforcing 改为 SELINUX=disabled
重启服务reboot
根据自身需求安装以下软件
安装redis
yum install redis
systemctl start redis.service
systemctl enable redis.service
yum install php-redis
安装 nodejs
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
yum install nodejs
npm install -g yarn
npm install -g typescript
安装supervisord
yum install python-pip
pip install --upgrade pip
easy_install supervisor
yum install supervisor
systemctl start supervisord.service
systemctl enable supervisord.service
安装docker
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce
usermod -aG docker $(whoami)
systemctl start docker.service
systemctl enable docker.service
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: