記錄純淨RedHat7搭建LNMP環境

2021-09-27 13:26:32 字數 1015 閱讀 9917

1.關閉防火牆、禁用selinux

systemctl disable firewalld

systemctl stop firewalld

vi /etc/sysconfig/selinux

將selinux設定為disabled

重啟伺服器

2.配置網路yum源

wget -o /etc/yum.repos.d/my.repo 

sed -i 's#$releasever#7#g;s#$basearch#x86_64#g' /etc/yum.repos.d/my.repo

yum clean all

yum makecache

yum install epel-release -y

3.安裝元件
yum install php-mysql php-fpm php nginx mariadb-server mariadb -y
4.修改配置檔案
vim /etc/nginx/nginx.conf
修改nginx主目錄為/var/www/html

server 

#新增結束

location /

systemctl start php-fpm

systemctl start mariadb

systemctl start nginx

在/var/www/html下新增index.php測試nginx服務是否正常工作

5.配置資料庫

mysql_secure_installation
create database wdb;

grant all on wdb.* to 'wuser'@'%' identified by 'wpass';

select username from mysql;

lnmp環境搭建完畢

Docker 環境搭建(RedHat 7)

docker 環境搭建 redhat 7 裝載映象檔案 系統安裝完畢後,通過virtualbox配置網路 啟動linux 7 cd etc sysconfig network scripts 修改ifcfg enp0s3中紅線的配置 修改 etc hosts 修改dns 修改完畢,重啟網路 serv...

Redhat7 搭建ntp(時間同步)

redhat7 搭建ntp 時間同步 安裝 yum install ntp 啟動 systemctl start ntpd systemctl enable ntpd 檢視同步 ntpq p 開放防火牆 firewall cmd permanent add service ntp 此時ntp ser...

Redhat7安裝Madagascar簡易教程

madagascar 是當前地球物理界比較流行和熱門的一套開源軟體 已經遷移到git上,由於更新速度快 開源的特性,再加上fomel等人的大力推廣,發展勢頭很猛,有超越su的趨勢。1.二 依賴軟體包 的安裝在下面的 根據自己系統版本選擇下軟體依賴包。redhat7已經更新python為2.7,所以這...