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、成功

相关推荐
AlfredZhao13 小时前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户97183563346619 小时前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪20 小时前
linux 拷贝文件或目录到指定的位置
linux
大树882 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠2 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质2 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务
bush42 天前
嵌入式linux学习记录十四、术语
linux·嵌入式
载数而行5202 天前
Linux 11 动态监控指令top
linux
小宇宙Zz2 天前
Maven依赖冲突
java·服务器·maven
Inhand陈工2 天前
基于台达PLC与映翰通IG502的智慧水产养殖精准投喂与远程运维解决方案
运维·人工智能·物联网·阿里云·信息与通信