Linux论坛安装

事前准备

1、Discuz_X3.5_SC_UTF8_20230520的压缩包。

2、一台虚拟机,xshell和xftp(用来传输文件)

安装httpd 软件并将压缩包移动到指定目录

复制代码
mount /dev/sr0 /mnt      #### 挂载光盘到 /mnt 目录
dnf install httpd -y    ###  安装httpd 软件
ll /var/www/html/       ### 查看指定目录
mv Discuz_X3.5_SC_UTF8_20230520.zip /var/www/html/     ### 移动源码包到目标目录
cd /var/www/html/      ### 切换目录

解压源码包

复制代码
unzip Discuz_X3.5_SC_UTF8_20230520.zip

切换到upload目录,修改目录中指定文件的权限

复制代码
cd upload/        #### 切换到目录
ll
chmod 777 data/ config/ uc_client/ uc_server/ -R    #### 修改指定目录的权限  -R  表示递归修改

启动httpd服务,关闭防火墙服务(也可以设定相关的防火墙规则)

复制代码
systemctl start httpd            ####  启动httpd 服务
systemctl stop firewalld         ###   停止防火墙服务


小知识点:
netstat -lntup                   ###   查看服务端口
systemctl status httpd           ###   查看服务状态
systemctl is-active httpd        ###   查看服务状态

下载PHP相关组件,重启httpd服务

复制代码
dnf install php*                 ###   安装php相关组件
systemctl restart httpd         ####  安装php之后一定要重启httpd服务


注意事项:
如果知道要下载什么组件也可以精准安装,*是通配符代表全部

安装 PHP 之后一定要重启httpd服务,主要有以下原因:
加载新模块:安装 PHP 相关组件后,会有新的 PHP 模块被添加到系统中,例如php-fpm(FastCGI 进程管理器)等。httpd服务需要重新启动才能加载这些新的模块,以便能够识别和处理 PHP 脚本。如果不重启,httpd服务将无法感知到新安装的 PHP 模块,导致无法正确解析和执行 PHP 代码。
更新配置文件:安装 PHP 过程中,可能会对与httpd服务相关的配置文件进行修改,比如httpd.conf文件中关于文件类型映射、模块加载顺序等配置。这些修改不会立即生效,只有重启httpd服务,才能使新的配置文件生效,让httpd服务按照新的配置来运行,确保与 PHP 的集成能够正常工作。
初始化环境变量:PHP 安装可能会添加一些新的环境变量,或者修改现有的环境变量。httpd服务在启动时会读取当前的环境变量。重启httpd服务可以让它获取到最新的环境变量信息,以便在处理 PHP 请求时能够正确使用这些变量,例如找到 PHP 的安装路径、扩展库路径等

停止selinux(也可以打标签,跟防火墙一样跟安全相关),下载安装 mariadb 数据库 (mysql几乎是一样 )

复制代码
setenforce 0                    ####   停止SELinux安全工具 目前只是临时停止,重启系统之后,需要再次停止

dnf install mariadb-server -y   ####   安装 mariadb 数据库   和mysql几乎是一样   
systemctl start mariadb  ###   启动数据库服务
systemctl status mariadb        ###  查看服务状态
netstat -lntup                  ##   查看数据库服务监听的端口

打开浏览器http://192.168.153.132/upload/

这个ip是你自己的地址,如果进不去,可以先输入192.168.153.132,进到红帽的网站,再去加,红帽的网站进不去就是httpd没有成功执行

一直下一步到创建数据库。

进入数据库进行相关操作

复制代码
[root@localhost upload]# mysql -uroot -p        ##使用mysql 客户端  -u 指定用户  root   -p 指定密码  默认没有密码
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.16-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;       ####  查看当前拥有的数据库
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.001 sec)

MariaDB [(none)]> create database luntan;       #### 创建数据库
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> show databases;               ####  查看数据库
+--------------------+
| Database           |
+--------------------+
| information_schema |
| luntan             |
| mysql              |
| performance_schema |
+--------------------+
4 rows in set (0.001 sec)

MariaDB [(none)]> 
MariaDB [(none)]> 
MariaDB [(none)]> 
MariaDB [(none)]> use mysql;                   ### 使用或者指定某个数据库
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]> alter user 'root'@'localhost' identified by 'redhat';     ## 修改 root 账号的密码为  redhat
Query OK, 0 rows affected (0.001 sec)

MariaDB [mysql]> exit                          #### 退出数据库
Bye
[root@localhost upload]# 
[root@localhost upload]# 
[root@localhost upload]# mysql -uroot -p       ####   再次登录,输入用户密码  
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.5.16-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> exit
Bye

安装数据库

点击第一个或者第三个,你就成功进入论坛了。

发帖方法

1、点击主页(小房子)

2、点击快捷导航默认版块

3、点击发新帖就行

4、成功

相关推荐
涛声依旧393168 分钟前
安装部署自己的nginx
运维·服务器·nginx
不会kao代码的小王13 分钟前
零基础也能搭博客?
linux·windows·后端
wanhengidc31 分钟前
物理服务器都有哪些作用?
运维·服务器·安全·智能手机·云计算
weixin_462446232 小时前
ubuntu/kali安装k8s
linux·ubuntu·kubernetes
lys_8283 小时前
【linux】解决NAT模型下使用Xshell连接虚拟机显示22端口connection failed问题
linux·运维·服务器
Mxsoft6193 小时前
电力系统智能运维网络安全威胁检测与防御策略
运维·安全·web安全
序属秋秋秋4 小时前
《Linux系统编程之系统导论》【冯诺依曼体系结构 + 操作系统基本概述】
linux·运维·服务器·c语言·ubuntu·操作系统·冯诺依曼体系结构
她说彩礼65万5 小时前
C# 特性详解
linux·服务器·c#
LSL666_7 小时前
5 Repository 层接口
android·运维·elasticsearch·jenkins·repository
Hi202402179 小时前
消除FFmpeg库的SONAME依赖
linux·ffmpeg