Prerequisites for setting up Discuz forum:
< br>
ps aux |grep nginx
netstat -lntp |grep nginx
[ root@localhost ~]# getenforce selinux
Disabled
[ root@localhost ~]# iptables -nvL
ps aux |grep php-fpm
[ 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.
mysql -uroot -p'12345'
< br>
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>
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'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