Nginx Environment Building Discuz Forum

Source: Internet
Author: User


1: Create the installation location for the Discuz forum

[Email protected] src]# mkdir/data/www

[Email protected] src]# CD!$

Cd/data/www

[[email protected] www]# cp/usr/local/src/discuz_x3.2_sc_gbk.zip.//Copy the downloaded compressed file to the current directory

[Email protected] www]# Unzip Discuz_x3.2_sc_gbk.zip

[Email protected] www]# mv upload/*.//move the files out.

2: Create a virtual host

Our own Nginx configuration file

The last sentence is an include statement, which means to load the virtual host's configuration file

[Email protected] www]# cd/usr/local/nginx/conf

[Email protected] conf]# mkdir vhosts

[Email protected] conf]# vim vhosts/discuz.conf

Server

{

Listen 80;

server_name www.test.com;

Index index.html index.htm index.php;

root/data/www;

Location ~ \.php$ {

Include Fastcgi_params;

Fastcgi_pass 127.0.0.1:9000;

Fastcgi_index index.php;

Fastcgi_param Script_filename/data/www$fastcgi_script_name;

}

}

Then detect that the configuration file is correct:

[Email protected] conf]#/usr/local/nginx/sbin/nginx-t

Nginx:the configuration file/usr/local/nginx/conf/nginx.conf syntax is OK

Nginx:configuration file/usr/local/nginx/conf/nginx.conf Test is successful

[[Email protected] conf]# service Nginx restart

stopping Nginx: [OK]

Starting Nginx:

# # # #注意server_name configured domain name needs to parse, if the Linux system uses the virtual machine

Need to re-/windows/system32/drivers/etc/hosts the Windows system in the C-disk to resolve! As follows:

192.168.1.123 www.test.com

Create the Discuz database in the MySQL database!

mysql> CREATE DATABASE Discuz;

Query OK, 1 row Affected (0.00 sec)

Mysql> Grant all on discuz.* to "Wang" @ "localhost" identified by "123456";

Query OK, 0 rows Affected (0.00 sec)

Mysql> quit

Bye

Then the browser enters the newly resolved domain name, which is www.test.com

Give permission to the corresponding file!

It is important to note that in Apache, because PHP is running as a module of Apache, it is necessary to give Apache users permissions for these files, by default daemon, which is to give daemon permissions. Nginx PHP is run through the PHP-FPM, and then return the results to the client, so here need to give these files php-fpm user rights, we set the front user php-fpm!

Cd/data/www

Chown-r php-fpm:php-fpm data uc_server/data uc_client/data Config

Then rerun the page, click on the new Installation Discuz, the following screen appears, fill in the database information just created:


650) this.width=650; "Src=" Http://upload-images.jianshu.io/upload_images/5688726-231156ee752da099.png?imageMogr2 /auto-orient/strip%7cimageview2/2/w/1240 "style=" height:auto;vertical-align:middle;border:0px; "alt=" 1240 "/>

Fill in the information correctly, click Next to complete the installation!

Nginx Environment Building Discuz Forum

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.