Table of Contents
Building a Discuz forum in Linux
1. Set up the yum installation environment:
2. Install the http service:
3. Install php* software:
4. Install database:
5. Log in to the database:
6. Create a database:
7. Build a forum:
Home CMS Tutorial Discuz Introduction to the method of setting up Discuz forum in Linux

Introduction to the method of setting up Discuz forum in Linux

Dec 23, 2020 pm 06:14 PM
discuz 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 of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

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 Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

deepseek web version entrance deepseek official website entrance deepseek web version entrance deepseek official website entrance Feb 19, 2025 pm 04:54 PM

DeepSeek is a powerful intelligent search and analysis tool that provides two access methods: web version and official website. The web version is convenient and efficient, and can be used without installation; the official website provides comprehensive product information, download resources and support services. Whether individuals or corporate users, they can easily obtain and analyze massive data through DeepSeek to improve work efficiency, assist decision-making and promote innovation.

How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

There are many ways to install DeepSeek, including: compile from source (for experienced developers) using precompiled packages (for Windows users) using Docker containers (for most convenient, no need to worry about compatibility) No matter which method you choose, Please read the official documents carefully and prepare them fully to avoid unnecessary trouble.

How to solve the permissions problem encountered when viewing Python version in Linux terminal? How to solve the permissions problem encountered when viewing Python version in Linux terminal? Apr 01, 2025 pm 05:09 PM

Solution to permission issues when viewing Python version in Linux terminal When you try to view Python version in Linux terminal, enter python...

Get the gate.io installation package for free Get the gate.io installation package for free Feb 21, 2025 pm 08:21 PM

Gate.io is a popular cryptocurrency exchange that users can use by downloading its installation package and installing it on their devices. The steps to obtain the installation package are as follows: Visit the official website of Gate.io, click "Download", select the corresponding operating system (Windows, Mac or Linux), and download the installation package to your computer. It is recommended to temporarily disable antivirus software or firewall during installation to ensure smooth installation. After completion, the user needs to create a Gate.io account to start using it.

BITGet official website installation (2025 beginner's guide) BITGet official website installation (2025 beginner's guide) Feb 21, 2025 pm 08:42 PM

BITGet is a cryptocurrency exchange that provides a variety of trading services including spot trading, contract trading and derivatives. Founded in 2018, the exchange is headquartered in Singapore and is committed to providing users with a safe and reliable trading platform. BITGet offers a variety of trading pairs, including BTC/USDT, ETH/USDT and XRP/USDT. Additionally, the exchange has a reputation for security and liquidity and offers a variety of features such as premium order types, leveraged trading and 24/7 customer support.

Ouyi okx installation package is directly included Ouyi okx installation package is directly included Feb 21, 2025 pm 08:00 PM

Ouyi OKX, the world's leading digital asset exchange, has now launched an official installation package to provide a safe and convenient trading experience. The OKX installation package of Ouyi does not need to be accessed through a browser. It can directly install independent applications on the device, creating a stable and efficient trading platform for users. The installation process is simple and easy to understand. Users only need to download the latest version of the installation package and follow the prompts to complete the installation step by step.

How to automatically set permissions of unixsocket after system restart? How to automatically set permissions of unixsocket after system restart? Mar 31, 2025 pm 11:54 PM

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

Ouyi Exchange Download Official Portal Ouyi Exchange Download Official Portal Feb 21, 2025 pm 07:51 PM

Ouyi, also known as OKX, is a world-leading cryptocurrency trading platform. The article provides a download portal for Ouyi's official installation package, which facilitates users to install Ouyi client on different devices. This installation package supports Windows, Mac, Android and iOS systems. Users can choose the corresponding version to download according to their device type. After the installation is completed, users can register or log in to the Ouyi account, start trading cryptocurrencies and enjoy other services provided by the platform.

See all articles