search
HomeBackend DevelopmentPHP TutorialBasic tutorial on configuring the forum program Discuz under Linux Nginx MySQL, _PHP tutorial

Basic tutorial on configuring the forum program Discuz under Linux Nginx MySQL,

Crossday Discuz! Board (Discuz! for short) is a set of general tools launched by Beijing Kangsheng Xinchuang Technology Co., Ltd. Community forum software system. Since its launch in June 2001, Discuz! has more than 14 years of application history and more than 2 million website user cases. It is one of the most mature and coverage forum software systems in the world. The latest version, Discuz! X3.2, was officially released on June 9, 2015, introducing the application center development model for the first time. On August 23, 2010, Kangsheng Chuangxiang reached an acquisition agreement with Tencent and became a wholly-owned subsidiary of Tencent.
Crossday Discuz! Board (hereinafter referred to as Discuz!, Copyright Registration No. 2006SR11895 of the National Copyright Administration of China) is a universal community forum software system launched by Comsenz (Beijing) Technology Co., Ltd. (Comsenz in English). Users can Based on any programming required, through simple settings and installation, a forum service with complete functions, strong load capacity and highly customizable can be built on the Internet. Discuz!'s infrastructure is implemented using PHP MySQL, the world's most popular web programming combination. It is an efficient forum system solution that is well designed and suitable for various server environments.
As the largest community software and service provider in China, the Discuz! development team under Comsenz has rich experience in web application design, especially in forum products and related fields. After long-term innovative development, it has mastered a complete set of algorithms and data structures. to leading technologies in product safety. This makes Discuz! in the leading position among similar products at home and abroad in terms of stability, load capacity, safety and other aspects.
Let’s take a look at the Discuz installation and configuration process in the LNMP environment:
1. Configure nginx

vim /usr/local/nginx/etc/nginx.conf
user nginx;
 worker_processes 1; 
#error_log logs/error.log;
 #error_log logs/error.log notice;
 error_log logs/error.log info;
events {
  worker_connections 1024;
 }
http {
  include    mime.types;
  server_tokens off;
  default_type application/octet-stream;
  log_format main '$remote_addr - $remote_user [$time_local] "$request" '
           '$status $body_bytes_sent "$http_referer" '
           '"$http_user_agent" "$http_x_forwarded_for"';
  access_log logs/access.log main;
  sendfile    on;
  keepalive_timeout 65;
  client_header_buffer_size 32k;          
  large_client_header_buffers 4 32k;
   #客户请求头缓冲大小 nginx默认会用client_header_buffer_size这个buffer来读取header值,如果header过大,它会使用large_client_header_buffers来读取如果设置过小HTTP头/Cookie过大 会报400 错误 nginx 400 bad request求行如果超过buffer,就会报HTTP 414错误(URI Too Long)nginx接受最长的HTTP头部大小必须比其中一个buffer大,否则就会报400的HTTP错误(Bad Request)。
  client_max_body_size 8m;              #最大上传附件8MB
  client_body_buffer_size 128k;           #缓冲区代理缓冲用户端请求的最大字节数
  keepalive_timeout    60;
  tcp_nopush   on;
  tcp_nodelay  on;
  gzip on; 
  gzip_min_length 1k;
  gzip_buffers   4 16k;
  gzip_http_version 1.0;
  gzip_comp_level 2;
  include vh/bbs.yourich.com.cn.conf;
 }
mkdir /usr/local/nginx/etc/vh
 vim /usr/local/nginx/etc/vh/discuz.conf
upstream  bbs.test.com
 {
  server 127.0.0.1;
  check interval=3000 rise=2 fall=5 timeout=1000 type=http;  
   #interval检测间隔时间,单位为毫秒
   #rsie请求2次正常的话,标记此realserver的状态为up
   #fall表示请求5次都失败的情况下,标记此realserver的状态为down
   #timeout为超时时间,单位为毫秒
  check_http_send "GET / HTTP/1.1\r\nHOST:\r\n\r\n";
  check_http_expect_alive http_2xx http_3xx http_4xx;
 }
server {
  listen 80;
  server_name bbs.test.com;
  index index.html index.php;
  root /www/discuz;
  access_log logs/bbs_access.log main;
  error_log logs/bbs_error.log;
  location ~ .*\.(jpg|jpeg|png|gif\js|css)$ {
    root /www/discuz;
    access_log off;
  }
  location / {
    try_files $uri $uri/ /index.php?$args;
  }
  location ~.*\.(php)?$ {
    expires -1s;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    try_files $uri = 404;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME /www/discuz$fastcgi_script_name;
    fastcgi_param QUERY_STRING  $query_string;
    fastcgi_param REQUEST_METHOD $request_method;
    fastcgi_param CONTENT_TYPE  $content_type;
    fastcgi_param CONTENT_LENGTH $content_length;
  }
}

2. Download discuz
Download the discuz installation package and unzip it. Copy all the contents in the upload directory to the website document and directory specified by nginx /www/discuz
Set permissions

chown -R nginx:nginx /www/discuz

3. Create data

create database discuz default character set utf8;
 grant all privileges on discuz.* to discuz@'localhost' identified by 'discuz';
 flush privileges;

4. Install discuz
Enter http://ip/install in the browser to install according to the wizard

Articles you may be interested in:

  • Solution to the forgotten password of DISCUZ forum administrator
  • DISCUZ forum UBB editor (added flexible calling, supports ASP UBB parsing) Package download
  • DISCUZ paging code

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1084554.htmlTechArticleBasic tutorial on configuring the forum program Discuz under Linux Nginx MySQL, Crossday Discuz! Board (Discuz! for short) is a new product from Beijing Kangsheng A set of general community theories launched by Chuang Technology Co., Ltd....
Statement
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
What is the best way to send an email using PHP?What is the best way to send an email using PHP?May 08, 2025 am 12:21 AM

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

Best Practices for Dependency Injection in PHPBest Practices for Dependency Injection in PHPMay 08, 2025 am 12:21 AM

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHP performance tuning tips and tricksPHP performance tuning tips and tricksMay 08, 2025 am 12:20 AM

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.

PHP Email Security: Best Practices for Sending EmailsPHP Email Security: Best Practices for Sending EmailsMay 08, 2025 am 12:16 AM

ThebestpracticesforsendingemailssecurelyinPHPinclude:1)UsingsecureconfigurationswithSMTPandSTARTTLSencryption,2)Validatingandsanitizinginputstopreventinjectionattacks,3)EncryptingsensitivedatawithinemailsusingOpenSSL,4)Properlyhandlingemailheaderstoa

How do you optimize PHP applications for performance?How do you optimize PHP applications for performance?May 08, 2025 am 12:08 AM

TooptimizePHPapplicationsforperformance,usecaching,databaseoptimization,opcodecaching,andserverconfiguration.1)ImplementcachingwithAPCutoreducedatafetchtimes.2)Optimizedatabasesbyindexing,balancingreadandwriteoperations.3)EnableOPcachetoavoidrecompil

What is dependency injection in PHP?What is dependency injection in PHP?May 07, 2025 pm 03:09 PM

DependencyinjectioninPHPisadesignpatternthatenhancesflexibility,testability,andmaintainabilitybyprovidingexternaldependenciestoclasses.Itallowsforloosecoupling,easiertestingthroughmocking,andmodulardesign,butrequirescarefulstructuringtoavoidover-inje

Best PHP Performance Optimization TechniquesBest PHP Performance Optimization TechniquesMay 07, 2025 pm 03:05 PM

PHP performance optimization can be achieved through the following steps: 1) use require_once or include_once on the top of the script to reduce the number of file loads; 2) use preprocessing statements and batch processing to reduce the number of database queries; 3) configure OPcache for opcode cache; 4) enable and configure PHP-FPM optimization process management; 5) use CDN to distribute static resources; 6) use Xdebug or Blackfire for code performance analysis; 7) select efficient data structures such as arrays; 8) write modular code for optimization execution.

PHP Performance Optimization: Using Opcode CachingPHP Performance Optimization: Using Opcode CachingMay 07, 2025 pm 02:49 PM

OpcodecachingsignificantlyimprovesPHPperformancebycachingcompiledcode,reducingserverloadandresponsetimes.1)ItstorescompiledPHPcodeinmemory,bypassingparsingandcompiling.2)UseOPcachebysettingparametersinphp.ini,likememoryconsumptionandscriptlimits.3)Ad

See all articles

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.