您现在的位置是:首页 > cms教程 > Discuz教程Discuz教程
centos7环境搭建Discuz论坛的方法
以蕊2025-07-11Discuz教程已有人查阅
导读用centos7搭建搭建网络yum源。设置yum源自动挂载关闭SELinux和防火墙安装httpd安装net-tools工具(1)安装数据库服务
用centos7搭建搭建网络yum源。
通过CRT上传Discuz网站目录,在公有云上可以下载安装包然后解压。
然后给予upload这个目录较高的权限。
这里就需要填写刚刚创建的数据库名称和系统用户密码。
然后安装完成之后就可以通过IP进入论坛了;可以登录后台进行编辑。
修改站点名称和QQ在线客服。
找到图片所在位置:http://192.168.68.168/upload/static/image/common/logo.png用自选的logo替换默认logo。在论坛中添加模板。
[root@localhost Packages]# yum -y install wget-1.14-18.el7_6.1.x86_64.rpm
[root@localhost Packages]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
设置yum源自动挂载
[root@www ~]# vi /etc/fstab
关闭SELinux和防火墙
[root@www ~]# # systemctl stop firewalld
[root@www ~]# setenforce 0
setenforce: SELinux is disabled
安装httpd
[root@www ~]# yum -y install httpd
[root@www ~]## systemctl start httpd
[root@www ~]## systemctl enable httpd
[root@www httpd]# systemctl status httpd
安装net-tools工具
[root@www ~]# yum -y install net-tools
(1)安装数据库服务
# yum -y install mariadb mariadb-server
[root@localhost ~]# yum -y install mariadb mariadb-server
(2)安装 php
# yum -y install php php-mysql
[root@localhost ~]# yum -y install php php-mysql
开启服务。
[root@localhost ~]# systemctl start mariadb
数据库初始化
[root@www ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
You already have a root password set, so you can safely answer 'n'.
Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
... skipping.
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removedbefore moving into a production environment.
Remove test database and access to it? [Y/n] n
... skipping.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
登录数据库中
[root@localhost ~]# mysql -uroot -p
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 29
Server version: 5.5.65-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)]>
设置 root 用户远程访问数据库的权限
MariaDB [(none)]> grant all privileges on *.* to root@'%' identified by "159357";
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
创建数据库
MariaDB [(none)]> create database test_xiao;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> use test_xiao
Database changed
MariaDB [test_xiao]> CREATE TABLE `test_xiao`.`xiao_tb` ( `name` VARCHAR(100) NOT NULL ,`passwd` VARCHAR(100) NOT NULL ) ENGINE = InnoDB;
Query OK, 0 rows affected (0.15 sec)
MariaDB [test_xiao]> show tables;
+---------------------+
| Tables_in_test_xiao |
+---------------------+
| xiao_tb |
| xpl_tb |
+---------------------+
2 rows in set (0.00 sec)
MariaDB [test_xiao]> desc xiao_tb;
+--------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+--------------+------+-----+---------+-------+
| name | varchar(100) | NO | | NULL | |
| passwd | varchar(100) | NO | | NULL | |
+--------+--------------+------+-----+---------+-------+
2 rows in set (0.01 sec)
MariaDB [test_xiao]> INSERT INTO `test_xiao`.`xiao_tb` (`name`, `passwd`) VALUES ('xpl',
-> 'xpl'), ('xiao','xiao');
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
MariaDB [test_xiao]> select * from xiao_tb;
+------+--------+
| name | passwd |
+------+--------+
| xpl | xpl |
| xiao | xiao |
+------+--------+
2 rows in set (0.00 sec)通过CRT上传Discuz网站目录,在公有云上可以下载安装包然后解压。
然后给予upload这个目录较高的权限。
[root@localhost html]# chmod 777 -Rf upload/
[root@localhost html]# ll
total 4
drwxrwxrwx. 13 root root 4096 May 20 21:56 upload
这样就可以通过IP地址来进入安装向导啦!这里就需要填写刚刚创建的数据库名称和系统用户密码。
然后安装完成之后就可以通过IP进入论坛了;可以登录后台进行编辑。
修改站点名称和QQ在线客服。
找到图片所在位置:http://192.168.68.168/upload/static/image/common/logo.png用自选的logo替换默认logo。在论坛中添加模板。
本文标签:
很赞哦! ()
下一篇:discuz脚本发表帖子的方法
相关教程
图文教程
discuz添加自定义模板的方法
Discuz!X3是Discuz!建站程序系列的较新版本,提供了易于DIY的环境,很多新人喜欢问:我看见了那么多好看的模版,但是不符合我当前网站的需求,如何自己去DIY?
Discuz ML! V3.X 代码注入漏洞的修复方法
Discuz!ML是一个由CodersClub.org创建的多语言,集成,功能齐全的开源网络平台,用于构建像“社交网络”这样的互联网社区,该引擎基于Comsenz Inc.创建的着名的Discuz!
Discuz模板安装后显示异常的原因和解决方法
在处理Discuz模板显示异常时,最关键的是理解这些问题可能源自哪里。通常,问题可能出现在模板文件的编码、样式表的引用、JavaScript脚本的加载、或者是模板与Discuz版本的不兼容性上。
Discuz!6的论坛搭建步骤教程
相信有很多朋友想在自己电脑上架设个人论坛玩玩吧,但有时架设是不是有点麻烦呢?搜了下,在“太平洋电脑网”里介绍得太啰嗦而且重复(装了PHPnow完全可以不用装MySQL,因为PHPnow里
相关源码
-
(自适应)帝国cms7.5模板新闻资讯门户带会员中心基于帝国CMS7.5内核开发的HTML5响应式模板,为新闻机构、媒体门户及资讯聚合平台设计。通过模块化布局实现图文混排查看源码 -
帝国CMS7.5漫画网站模板带手机端源码免费下载本模板为漫画内容平台设计开发,采用帝国CMS7.5内核构建,深度优化漫画作品展示结构与章节管理模式。前端采用响应式布局设计,适配各类漫画阅读场景,提供作品分类、连载追踪、热度排行等垂直领域功能模块。查看源码 -
(自适应)蓝色基建施工工程建筑集团网站pbootcms模板下载为工程建筑、基建施工类企业打造的PbootCMS模板,采用现代化设计理念,突出企业实力与项目展示,帮助建筑类企业快速建立专业在线门户。查看源码 -
(自适应响应式)运动健身瑜伽俱乐部网站pbootcms源码下载为健身瑜伽俱乐部设计的响应式网站模板,采用PbootCMS内核开发,可快速搭建专业级企业官网。模板默认适配运动健身行业视觉风格,用户可通过替换图文内容灵活应用于其他服务行业。查看源码 -
(自适应响应式)工业机床工程农业机械设备网站源码下载框架适用于工程机械、机床设备等工业领域。通过模块调整可快速转型为农业机械、物流设备展示系统。预留7种工业产品展示模板。查看源码 -
(PC+WAP)蓝色自动电动闸门伸缩门类网站pbootcms模板下载为电动闸门、自动伸缩门企业设计的响应式网站模板,突出产品展示与技术优势,助力门控设备企业建立专业数字化形象。手工编写DIV+CSS结构,代码精简高效,无冗余代码干扰,加载速度更快。查看源码
| 分享笔记 (共有 篇笔记) |
