yum命令轻松搭建lamp架构

图解lamp架构

关于linux防火墙

cat /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted


运行中
#     enforcing - SELinux security policy is enforced.
临时关闭中,下次开机还会启动
#     permissive - SELinux prints warnings instead of enforcing.
永久关闭了
#     disabled - No SELinux policy is loaded.

修改selinux状态,enforcing > permissive
setenforce 0

想永久关闭,还得修改配置文件,然后reboot
reboot



关闭firewalld防火墙
iptables -F     清空iptables规则

systemctl stop firewalld     停止防火墙运行
systemctl disable firewalld   禁止防火墙开机自启
以上两条命令敲完就相当于永久禁用firewalld

通过yum命令点点点搭建lamp架构

安装准备其运行环境
[root@xinxin ~]# yum install httpd  -y            安装apache

[root@xinxin ~]#yum install  php  -y              安装php后端语言

[root@xinxin ~]# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm 

[root@xinxin ~]# rpm -ivh mysql-community-release-el7-5.noarch.rpm           下载数据库yum源配置文件

[root@xinxin yum,repos.d]# rpm -ivh mysql-community-release-el7-5.noarch.rpm   获取该repo文件

[root@xinxin yum,repos.d]# yum -y install mysql-community-server              安装数据库

[root@xinxin yum,repos.d]# systemctl restart mysqld              启动数据库

[root@xinxin yum,repos.d]# mysql_secure_installation                初始化数据库密码

[root@xinxin yum,repos.d]# mysql -uroot -p                  用新密码登录数据库

[root@xinxin ~]# wget https://www.dismall.com/forum.php?mod=attachment&aid=MTA0fGZlYmVhN2ZlfDE2NDg3ODQ3ODV8MHw3Mw%3D%3D    下载该
论坛源码

[root@xinxin ~]# unzip -d   /var/www/html/   Discuz_X3.4_SC_UTF8_20220131.zip          通过该命令将其解压到指定目录下

[root@xinxin ~]# cd /var/www/html/                   进入到该目录下

[root@xinxin html]# mv upload/*   ./                将该文件内的所有内容全部移到当前目录下才能访问到该网页

[root@xinxin html]# chmod -R 777 ./*                 需要对这些文件提权才能读取到这些文件内容

[root@xinxin html]# systemctl restart httpd          重启Apache服务即可通过自己的ip进入到网页中操作

[root@xinxin html]# yum install php-mysqli -y        安装过程中发现少一个驱动,通过此命令安装该驱动

最终安装完成界面

posted @   刘条缝  阅读(53)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
点击右上角即可分享
微信分享提示