Build Discuz Forum in LNMP Environment under CentOS7

Prerequisites for setting up Discuz forum:


< br>

Check whether each service has been started and the process is normal###


  1. Check whether the Nginx service process has been started and whether it is listening on port 80:

ps aux |grep nginx
netstat -lntp |grep nginx

  1. Check whether selinux is closed, whether port 80 of the firewall is open, or whether the firewall rules are cleared:
[ root@localhost ~]# getenforce selinux
Disabled
[ root@localhost ~]# iptables -nvL
  1. Check whether the process of php-fpm service has been started:

ps aux |grep php-fpm

  1. Check whether Nginx can parse php normally. First find your Nginx default site directory. Here is my Nginx default site directory is /data/wwwroot/default/, then you change the Nginx default access page file to index.php :
[ root@localhost ~]# cd /data/wwwroot/default[root@localhost /data/wwwroot/default]# mv index.html index.php
[ root@localhost /data/wwwroot/default]# vim index.php

The edited content is as follows:

<? php
 phpinfo();?>

Then use the browser to visit, the configuration information page of php is displayed, which means it can be parsed normally.

  1. Check whether mysql can be logged in and used normally:

mysql -uroot -p'12345'

< br>

Download Discuz's compressed package###

After checking all the above services to ensure that they are normal, you can start building Discuz. First, download Discuz. The compressed package of Discuz can be downloaded from the official website to download the version you need: http://www.discuz.net/forum.php

I am using the UTF8 version of 3.3:

[ root@localhost ~]# cd /usr/local/src/[root@localhost /usr/local/src]# wget http://download.comsenz.com/DiscuzX/3.3/Discuz_X3.3_SC_UTF8.zip

Unzip:

[ root@localhost /usr/local/src]# unzip Discuz_X3.3_SC_UTF8.zip

After decompression, there will be the following directories:

[ root@localhost /usr/local/src]# ls
Discuz_X3.3_SC_UTF8.zip readme upload utility

< br>

Start configuring Discuz


First delete the default page file before Nginx, and then copy all the files in the upload directory decompressed above to the root directory of the Nginx default site:

[ root@localhost /usr/local/src]# rm -f /data/wwwroot/default/index.php
[ root@localhost /usr/local/src]# ls /data/wwwroot/default/[root@localhost /usr/local/src]# cp -r upload/* /data/wwwroot/default/
[ root@localhost /usr/local/src]# ls !$
ls /data/wwwroot/default/
admin.php  config           data         home.php    misc.php    search.php  uc_client
api        connect.php      favicon.ico  index.php   plugin.php  source      uc_server
api.php    cp.php           forum.php    install     portal.php  static      userapp.php
archiver   crossdomain.xml  group.php    member.php  robots.txt  template
[ root@localhost /usr/local/src]#

Then use the browser to visit Discuz's configuration page: http://192.168.77.130/install (IP is your machine's IP), after successful access, the following page will be displayed, click Agree to enter the next step:

Then you will enter the directory and file permission check interface, but you will find that these directories or files have insufficient permissions, so they are all in an unwritable state:

Then you can only write a script to grant permissions to these directories. The directory paths displayed on the page are all relative paths, so this script needs to be placed in the root directory of the site:

[ root@localhost ~]# cd /data/wwwroot/default/[root@localhost /data/wwwroot/default]# vim fileList.txt  #Put the paths in a text file first
. /config
. /data
. /data/cache
. /data/avatar
. /data/plugindata
. /data/download
. /data/addonmd5
. /data/template
. /data/threadcache
. /data/attachment
. /data/attachment/album
. /data/attachment/forum
. /data/attachment/group
. /data/log
. /uc_client/data/cache
. /uc_server/data/./uc_server/data/cache
. /uc_server/data/avatar
. /uc_server/data/backup
. /uc_server/data/logs
. /uc_server/data/tmp uc_server/data/view
[ root@localhost /data/wwwroot/default]# vim filePermission.sh
#! bin/bash
# Write a simple loop script and it&#39;s done
for file in`cat ./fileList.txt`do
 chmod 777 $file
done
[ root@localhost /data/wwwroot/default]# vim filePermission.sh

After executing the script, refresh the page and you will find that the status becomes writable:

After no problem, click "Next" at the bottom of the page:

1、 Select "Fresh install Discuz! X (including UCenter Server)"

Choose this if you haven't installed Discuz before.

2、 Select "Install Discuz! X only (manually specify the installed UCenter Server)"

If you have installed Discuz before and are only upgrading now, select this option and ensure that the previous UCenter is UCenter 1.6.0 version. If the previously installed UCenter Server is not upgraded, it is usually version 1.5.1 or 1.5.2. You need to upgrade Ucenter to version 1.6.0 first, otherwise the installation program will prompt an error and cannot continue. Because I haven't installed it before, here is a fresh installation of Discuz as an example.

Click "Next" to enter the database installation interface, as shown in the figure below:

Here you only need to enter the password of the root user of your database, and then set an admin password. You can write or not write the email address of the alert email, and the rest will be installed automatically:

After the installation is complete, click to visit, if you don't need to install Discuz recommended applications:

Get it done, finish work:

**So far, Discuz has been successfully installed! If you have any questions, please send a private message. **

Recommended Posts

Build Discuz Forum in LNMP Environment under CentOS7
Build Dedecms website in LNMP environment under CentOS7
CentOS6.7 build LNMP environment
Centos7.6 build LNMP environment
CentOS 7 build LNMP environment
Build docker environment under Centos6.5
Build Discuz Forum based on CentOS
Centos build lnmp
[PHP] Build a PHP operating environment under CentOS
Build LEMP (Linux+Nginx+MySQL+PHP) environment under CentOS 8.1 (detailed tutorial)
Build Hadoop in CentOS
Build a basic environment for Java development under Centos7
[CentOS environment deployment] Java7/Java8 deployment under CentOS
Build OpenV** Server under CentOS7
Build zabbix monitoring zabbix4.2 in CentOS7.6
Build zabbix monitoring zabbix4.2 in CentOS7.6
Build a PXC cluster under CentOS8
Build an FTP server under centos7
Build Nginx environment on Linux (CentOS)
Build Discuz forum based on ubuntu
Build Yum private warehouse in Centos7.3
FFmpeg environment deployment record under centos7
PPTP environment deployment record under Centos
Tomcat configuration JMX in centos 6.5 environment
Centos-6.5 installation and deployment of LNMP environment
Build the C++ compilation environment under ubuntu
Steps to build LNMP environment on ubuntu 20.04
(1) Centos7 installation to build a cluster environment
Python and scrapy deployment in centos environment
Build a python development environment under Ubuntu
Install Docker CE in yum under CentOS 7
Build a ScaleIO distributed storage cluster under CentOS7
Cloud server builds Discuz forum based on CentOS
How to quickly build Nginx server under CentOS
Centos6.5 compile and install LNMP architecture web environment
How to build a LAMP environment on centos7.2
CentOS7 build jenkins
Centos7 build python3.8.5+scrapy+gerapy
Use Rancher to build a K8s cluster under CentOS7
Tutorial for deploying nginx+uwsgi in django project under Centos8
Install PHP in yum under CentOS, configure php-fpm service
SFTP dual-machine high availability environment deployment record under Centos
Environment configuration of JDK, mysql and tomcat under Centos7
Compile and install Lnmp shell script under Linux centos
Rapid deployment of Kubernetes (k8s) cluster in CentOS7 environment
Resolve the problems encountered in the linux environment under ubuntu