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 安装过程中发现少一个驱动,通过此命令安装该驱动
最终安装完成界面
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!