search
HomeCMS TutorialDiscuzIntroduction to the method of setting up Discuz forum in Linux

How to set up a Discuz forum in Linux? The following article will introduce to you how to build a Discuz forum in Linux. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Introduction to the method of setting up Discuz forum in Linux

Related recommendations: "discuz tutorial"

Building a Discuz forum in Linux

Note: This experiment was conducted in a virtual machine. The software used was VMware Workstation Pro14.0
The image file of rhel-server-7.5-x86_64-dvd was used, and the installation package for building the forum was Discuz_X2.5_SC_UTF8. zip.

1. Set up the yum installation environment:

(1) Edit the yum configuration file: vim /etc/yum.repos.d/base.repo

(2) Write the following code in the configuration file. Remember to save and exit after writing.

Introduction to the method of setting up Discuz forum in Linux

(3) Then we mount the Redhat7.5 image file to the specified mount point directory/mnt using the command: mount /dev/sr0 /mnt /

(4) Then we use the command: yum repolist to check whether yum is installed correctly. When the status appears 5099, it means there is no problem with the installation. As shown below:

Introduction to the method of setting up Discuz forum in Linux

2. Install the http service:

(1) Use the command: yum install httpd -y , to install an http (package name: httpd) service, when complete appears! That's it.

(2) Re-enable the httpd service, use the command systemctl restart httpd

(3) Let’s check the firewall operation status, use the command: systemctl status firewalld

Introduction to the method of setting up Discuz forum in Linux

(4) Since the firewall is open, it will prevent our virtual machine and PC from accessing each other, so we need to turn off the firewall.

Use command: systemctl stop firewalld.service

(5) Then we use the browser on the PC and enter the current IP address of the virtual machine: 192.168.0.22, Then visit. You will enter the following interface:

Introduction to the method of setting up Discuz forum in Linux
When you see this interface, it means that you have accessed the main interface of the apache software used for http.
(6) If you do not see this interface, you need to turn off SELINUX and use the command: setenforce 0. I will explain in detail about SELINUX in my Linux advancement in the future. It is recommended that you click on this interface if you have seen it.

3. Install php* software:

It is web-related software. We need to dynamically access web pages. To install all software related to php, use the command: yum install php* -y

4. Install database:

(1) Generally default It has already been installed, but it doesn’t matter. We can install it again and use the command: yum install mariadb-db -y. It will prompt us that it has been installed. As shown below:
Introduction to the method of setting up Discuz forum in Linux
(2) Start the service and use the command: systemctl start mariadb.service
(3) After the database is installed, we need to initialize the database. The data in the forum are stored in the database. The database can be simply understood as an EXCEL table with corresponding user and password information.
①Install the database: Use the command: mysql_secure_installation
②Then press Enter directly to enter the next step. It will prompt whether to set a password for the root user entering the database
③We enter y or Y , press Enter and enter the password. If the two passwords are consistent, go to the next step.

Introduction to the method of setting up Discuz forum in Linux
④Ask: Do you want to delete anonymous users? y This depends on the actual situation. Since we are doing an experiment here, go directly to the next step.
⑤Question: Disallow (disallow) root user to log in remotely? y
⑥Ask: Remove the data test database and access it? y
⑦Question: Reload the permission table now? y

Introduction to the method of setting up Discuz forum in Linux

5. Log in to the database:

Use the command: mysql -u root -p Enter , the password is the password to enter the database. After entering the database, we can use the database command to take a brief look: show databases;
Introduction to the method of setting up Discuz forum in Linux

6. Create a database:

Use command: create dabase luntan; After the creation is completed, we use show databases; to check and find that the luntan database has been successfully created.
Introduction to the method of setting up Discuz forum in Linux
After completion, we can use the command: quit or exit to exit.

7. Build a forum:

Before building a forum, first understand two terms about web pages:
Static interface: refers to The code of the web page is all in the page. It does not need to execute some programs to generate the web page of the client web page code. It cannot independently manage the published updated page.
Dynamic interface: It generates web pages with client web code by executing some programs. Dynamic web pages can update and manage the content of the website through the website background management system. Publish news, communicate and interact, blog, log in to email, and interact with the server.
(1) Go to the specified folder: cd /var/www/html. To decompress the source code of the forum, go to the specified folder.
This directory is a page that can be accessed by the http service. If you create a file here and write some content in it. Use the command: echo I love China > index.html When we visit 192.168.0.22 again, we will see the following result:
Introduction to the method of setting up Discuz forum in Linux
Just take a look at this and you will know. We Delete it first.
(2) Then we need to transfer the source code software of the forum to this directory. The name of the source code software in windows is Discuz_X2.5_SC_UTF8.zip, so we need to use the rz command
(3) The passed file is a compressed file with zip suffix, so we need to use the command: unzip Discuz_X2.5_SC_UTF8.zip to decompress the file.
(4) Restart the service and database:
Restart the httpd service: systemctl restart httpd.service
Restart the database: systemctl restart mariadb.service
( 4) Visit 192.168.0.22/upload/ to enter Discuz! installation guide. Click to accept
Introduction to the method of setting up Discuz forum in Linux
(5) We found that many of our directory files are not writable, so we need to change the permissions.
Introduction to the method of setting up Discuz forum in Linux
(6) Use the command to change permissions: chmod 777 config/ data/ uc_* -R Give these directories and all files and directories contained in them 777 permissions, refresh the installation wizard web page: it is found that all statuses are Writable Status
(7) Next step, and the next step:

Introduction to the method of setting up Discuz forum in Linux
(8) Next Step one, after the installation is complete. Then close the browser and re-enter to visit 192.168.0.22/upload. At this time, the DISCUZ forum has been fully established, and we can register users and log in there.

Here we have finished explaining this section of the experiment. You can log in to the forum to play, among other things. You can also use other PCs under the LAN to access 192.168.0.22/upload, and you will find that others can also log in!

Summary of the main commands used in this section:

##yum install httpd -yConfirm Install httpd servicesystemctl restart httpdRestart httpd servicesystemctl status firewalld Check the firewall statussystemctl stop firewalld.serviceClose the firewallsetenforce 0Close SELINUX yum install php * -yConfirm the installation of all software related to PHP##yum install mariadb-db -ysystemctl start mariadb.servicemysql_secure_installationmysql -u root -pshow databases;create dabase luntan;chmod 777 config/ data/ uc_* -RFor more programming-related knowledge, please visit:
Command Comments
Confirm the installation of the database file
Start the database file
Install database
Log in to database
Check what databases there are
Create a database named forum
Give 777 permissions to the folders config/data/uc_* and the directories and files they own
Programming Teaching

! !

The above is the detailed content of Introduction to the method of setting up Discuz forum in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete
什么是linux设备节点什么是linux设备节点Apr 18, 2022 pm 08:10 PM

linux设备节点是应用程序和设备驱动程序沟通的一个桥梁;设备节点被创建在“/dev”,是连接内核与用户层的枢纽,相当于硬盘的inode一样的东西,记录了硬件设备的位置和信息。设备节点使用户可以与内核进行硬件的沟通,读写设备以及其他的操作。

Linux中open和fopen的区别有哪些Linux中open和fopen的区别有哪些Apr 29, 2022 pm 06:57 PM

区别:1、open是UNIX系统调用函数,而fopen是ANSIC标准中的C语言库函数;2、open的移植性没fopen好;3、fopen只能操纵普通正规文件,而open可以操作普通文件、网络套接字等;4、open无缓冲,fopen有缓冲。

linux中什么叫端口映射linux中什么叫端口映射May 09, 2022 pm 01:49 PM

端口映射又称端口转发,是指将外部主机的IP地址的端口映射到Intranet中的一台计算机,当用户访问外网IP的这个端口时,服务器自动将请求映射到对应局域网内部的机器上;可以通过使用动态或固定的公共网络IP路由ADSL宽带路由器来实现。

linux中eof是什么linux中eof是什么May 07, 2022 pm 04:26 PM

在linux中,eof是自定义终止符,是“END Of File”的缩写;因为是自定义的终止符,所以eof就不是固定的,可以随意的设置别名,linux中按“ctrl+d”就代表eof,eof一般会配合cat命令用于多行文本输出,指文件末尾。

linux怎么判断pcre是否安装linux怎么判断pcre是否安装May 09, 2022 pm 04:14 PM

在linux中,可以利用“rpm -qa pcre”命令判断pcre是否安装;rpm命令专门用于管理各项套件,使用该命令后,若结果中出现pcre的版本信息,则表示pcre已经安装,若没有出现版本信息,则表示没有安装pcre。

linux怎么查询mac地址linux怎么查询mac地址Apr 24, 2022 pm 08:01 PM

linux查询mac地址的方法:1、打开系统,在桌面中点击鼠标右键,选择“打开终端”;2、在终端中,执行“ifconfig”命令,查看输出结果,在输出信息第四行中紧跟“ether”单词后的字符串就是mac地址。

linux中rpc是什么意思linux中rpc是什么意思May 07, 2022 pm 04:48 PM

在linux中,rpc是远程过程调用的意思,是Reomote Procedure Call的缩写,特指一种隐藏了过程调用时实际通信细节的IPC方法;linux中通过RPC可以充分利用非共享内存的多处理器环境,提高系统资源的利用率。

什么是linux交叉编译什么是linux交叉编译Apr 29, 2022 pm 06:47 PM

在linux中,交叉编译是指在一个平台上生成另一个平台上的可执行代码,即编译源代码的平台和执行源代码编译后程序的平台是两个不同的平台。使用交叉编译的原因:1、目标系统没有能力在其上进行本地编译;2、有能力进行源代码编译的平台与目标平台不同。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),