Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build Discuz Forum in Linux

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to build the Discuz forum in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Build Discuz Forum in Linux

Note: this experiment is carried out in a virtual machine, and the software used is VMware Workstation Pro14.0

The image file of rhel-server-7.5-x86_64-dvd is used, and the installation package for building the forum is Discuz_X2.5_SC_UTF8.zip.

1. Set up the yum installation environment:

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

(2) write the following code in the configuration file, and remember to save and exit after writing.

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

(4) then we use the command: yum repolist to check whether the installation of yum is correct. When the status appears 5099, there is no problem with the installation. As shown below:

2. Install the http service:

(1) use the command: yum install httpd-y to install a http (package name: httpd) service, when complete appears! It's done.

(2) re-enable the httpd service and use the command systemctl restart httpd

(3) Let's check the operation of the firewall and use the command: systemctl status firewalld

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

Use the command: systemctl stop firewalld.service

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

Seeing this interface shows that you have visited the main interface of the apache software used by http.

(6) if you do not see this interface, you also need to close SELINUX and use the command: setenforce 0. I will explain in detail about SELINUX in my Linux Advanced. It is suggested that it is better to knock on this interface whether or not you have seen it.

3. Install php* software:

It is web page-related software, we need to dynamically visit the web page. To install all software related to php, use the command: yum install php*-y

4. Install the database:

(1) generally, it has been installed by default, but it doesn't matter, we can install it again, using the command: yum install mariadb-db-y, it will remind us that it has been installed. As shown below:

(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, the corresponding user and password and other information.

① installation database: use the command: mysql_secure_installation

② then directly enter to the next step, it will prompt whether to set a password for root users who enter the database.

For ③, we enter y or Y, enter the password after entering enter, and proceed to the next step with the same password.

④ asks: do you want to delete anonymous (anonymous) users? This depends on the actual situation. Since we are experimenting here, let's go straight to the next step.

⑤ asks: does not allow (disallow) root users to log in remotely? Y

⑥ asks: remove the data test database and access it? Y

⑦ asks: reload the permissions table now? Y

5. Log in to the database:

Use the command: enter mysql-u root-p, and the password is the password for entering the database. After entering the database, we can simply take a look at it using the database command: show databases

6. Create a database:

Use the command: after the create dabase luntan; is created, we check it with show databases; and find that the database for luntan has been created successfully.

When we are done, we can use the command: quit or exit to exit.

7. Set up a forum:

Before setting up the forum, we should first understand two nouns about the web page:

Static interface: it means that the code of the web page is in the page, it does not need to execute some programs to generate the client web page code, it can not independently manage the updated page.

Dynamic interface: it generates the web page of the client web page code by executing some programs, and the dynamic web page can update and manage the content of the website through the website background management system. Release news, communicate with each other, blog, log in to email, and interact with the server.

(1) cut to the specified folder: cd / var/www/html, and the forum source code will be decompressed to the specified folder.

This directory is the page that the http service can access. If you create a file here and write something into it. Using the command: echo I love China > index.html, if we visit 192.168.0.22 again, we will see the following result:

Just take a look at this and know it. Let's delete it first.

(2) then we need to upload the forum's source software to this directory. The source software is called Discuz_X2.5_SC_UTF8.zip in windows, so we need to use the rz command.

(3) the file passed is a compressed file with the suffix of zip, so we need to use the command: unzip Discuz_X2.5_SC_UTF8.zip to extract the file.

(4) restart services and databases:

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 wizard. Click to accept

(5) We found that many of our directory files are unwritable, so we need to change the permissions.

(6) change permission to use command: chmod 777 config/ data/ uc_*-R gives these directories and all files and directories contained in them permissions to 777, refresh the installation wizard web page: find all states are writable

(7) next step, next step:

(8) next, after the installation is completed. Then close the browser and re-enter to access 192.168.0.22/upload. At this time, the DISCUZ forum has been fully built, in which we can register users and log in.

This is the end of this section of the experiment, you can log on to the forum to play, in addition. You can also use other PC under the local area network to visit 192.168.0.22/upload, and you will find that others can also log in.

The main commands used in this section are summarized:

Command Note yum install httpd-y confirm installation of httpd Services systemctl restart httpd restart http Services systemctl status firewalld View Firewall status systemctl stop firewalld.service close Firewall setenforce 0 close SELINUXyum install php *-y confirm installation of all software related to PHP yum install mariadb-db-y confirm installation of database files systemctl start mariadb.service startup database files mysql_secure_installation installation database mysql-u root-p login database show databases Check what database create dabase luntan; creates a database called forum chmod 777 config/data/uc_*-R for config/data/uc_* these folders and their directories and files are granted 777 permissions above are all the contents of the article "how to build a Discuz Forum in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report