CentOS7 快速高效,簡單安裝 lnmp

Yoger發表於2019-04-19

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 協議》,轉載必須註明作者和本文連結

相關文章