当前位置: 首页 > news >正文

Linux+Apache+MySQL+PHP 架构下搭建 Discuz 社区论坛

1、配置仓库(挂载镜像)

[root@localhost ~]# cat /etc/yum.repos.d/rpm.repo 
[baseos]
name=baseos
baseurl=/mnt/BaseOS
gpgcheck=0
[appstream]
name=appstream
baseurl=/mnt/AppStream
gpgcheck=0
[root@localhost ~]# mount /dev/sr0 /mnt

2、安装软件


[root@localhost ~]# dnf install httpd php* mysql8.4-server -y

3、源码包传送到linux

mv Discuz_X3.5_SC_UTF8_20250901.zip /var/www/html/
cd /var/www/html/
unzip Discuz_X3.5_SC_UTF8_20250901.zip

4、修改权限

cd upload/
chmod 777 uc_server/ uc_client/ data/ config/ -R

5、启动httpd服务


[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# systemctl enable httpd

6、启动数据库服务

[root@localhost ~]# systemctl start mysqld

7、创建数据库,配置用户密码
                        mydql ----无密码,直接按回车

[root@localhost ~]# mysql -uroot -p
Enter password:     
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.4.4 Source distributionCopyright (c) 2000, 2025, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)mysql> create database luntan;
Query OK, 1 row affected (0.01 sec)mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| luntan             |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.00 sec)mysql> alter user 'root'@'localhost' identified by 'redhat';
Query OK, 0 rows affected (0.01 sec)mysql> exit;
Bye
[root@localhost ~]# 

8、安装部署  

[root@localhost ~]# setenforce 0      ---关闭SELinux安全框架

得到这个图就全部完成了!!!

其中,我遇到两个问题

1.x下载dft httpd -y总是error真的很让人烦躁啊

可以说它折磨了我一个下午,好在最后弄出来了

一定要清理重复挂载(避免混乱),我就是太多挂载了然后报错越来越多,其实只要细心一点,争取一次性输对就是最好的,当然在实验过程中总是会遇到很多大大小小的error,在修改错误同时也会加深我们对知识点的理解。当然解决点一个错误就会开心很久,像打怪兽一样,有人乐在其中,也有人烦闷与其中。。。。

2.

我在index.html 里输入了welcome 但还是显示的是左边那样。所以就怀疑,发现了这个问题

root@localhost:~# cat /var/www/html/index.html
cat: /var/www/html/index.html: 没有那个文件或目录

root@localhost:~# sudo vi /var/www/html/index.html
root@localhost:~# sudo chmod 644 /var/www/html/index.html
root@localhost:~# sudo systemctl restart httpd
root@localhost:~# setenforce 0
root@localhost:~# 

http://www.dtcms.com/a/560840.html

相关文章:

  • 可替代Github Copilot的插件分享CodeGeeX
  • Ubuntu学习笔记
  • 双非大学生自学鸿蒙5.0零基础入门到项目实战 - 歌曲列表
  • 双非大学生自学鸿蒙5.0零基础入门到项目实战 -ArkTs核心
  • UVa 10989 Bomb Divide and Conquer
  • 【Linux】版本控制器Git和调试器—gdb/cgdb的使用
  • 怎么把个人做的网站上传到网上wordpress用户名钩子
  • 成都网站排名网站添加邮件发送怎么做
  • Spring AI 极简入门:15分钟集成AI到SpringBoot应用
  • 临潼城市建设局网站外资公司注册
  • 1.基础--数据库相关概念
  • 使用DTS迁移工具迁移oracle到DM
  • langchain agent的短期记忆
  • 使用DrissionPage和自动化技术实现得物鞋子信息爬取
  • 做网站的是干嘛的为网站添加统计
  • 网站设计的建设目的做网站推销手表
  • [LitCTF 2023]Vim yyds
  • LNMP环境部署 KodBox私有云盘
  • 解决windows docker开发thinkphp6启动慢的问题
  • Rust编译参数与优化控制
  • springboot后端的接口headers
  • day04(11.2)——leetcode面试经典150
  • mysql常识和jdbc工具类的进化以及连接池思想
  • 七.Docker网络
  • 怎么做免费视频网站吗网站建设哪儿好
  • 推荐优质wordpress外贸网站主题
  • TDengine 数学函数 ASCII 用户手册
  • @Builder注解导致mybatis类型匹配错误 Cannot determine value type from string
  • AI模型开发 | 从零部署Deepseek OCR模型,零门槛开发PDF文档解析工具
  • Linux INPUT 子系统实验