文档资料

官方指引

  1. 官方站点: https://discuz.com/

  2. 示例站点:https://discuz.chat/

  3. 安装指引: https://discuz.com/docs/Linux%20%E4%B8%BB%E6%9C%BA.html#nginx

  4. 后台使用:https://discuz.com/manual-admin/

  5. 程序下载: https://dl.discuz.chat/dzq_latest_install.zip

社区使用

站点:纷享社区 (fxiaoke.com)

后台登录:管理中心首页 (fxiaoke.com)

程序部署

系统准备

#!/bin/bash
yum makecache
yum update -y

# 创建本地软件源
# 因为是在内网环境部署,所以采用yumdownload下载软件后,使用本机源的形式部署。
# 使用remi源
# 需要开启epel源

tar zxvf php74.tar.gz -C /opt/
yum install -y createrepo
createrepo /opt/php74/
yum-config-manager --add-repo file:/opt/php74

# 安装软件包打包证书
# wget https://rpms.remirepo.net/RPM-GPG-KEY-remi

#导入证书
rpm --import RPM-GPG-KEY-remi
# 安装nginx和PHP
yum install -y nginx
yum install -y php php-cli php-fpm php-gd php-mysqlnd php-odbc php-bcmath php-curl php-fileinfo php-nette-tokenizer php-xmlrpc php-date php-soap php-ldap php-mbstring libmcrypt libmcrypt-devel php-pecl-apcu mhash php-dom php-xmlreader php-date php-exif php-filter  php-hash php-iconv php-json php-libxml php-mysqlnd php-openssl php-pcre php-posix hp-tokenizer php-zlib php-opcache php-zip
# 拉起服务
systemctl daemon-reload
systemctl enable --now nginx php-fpm
# 开放80端口
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
#论坛程序部署
mkdir -p /wwwroot/discuz/public
unzip dzq_latest_install.zip -d /wwwroot/discuz/
chown -R nginx:nginx /wwwroot/

# 配置PHP-fpm
sed -i 's\;exif.\exif.\g' /etc/php.ini
sed -i 's@date.timezone =@date.timezone = Asia\Shanghai@g' /etc/php.ini
sed -i 's\zlib.output_compression = Off\zlib.output_compression = On\g' /etc/php.ini
sed -i 's\user = apache\ user = nginx\g' /etc/php-fpm.d/www.conf
sed -i 's\group = apache\ group = nginx\g' /etc/php-fpm.d/www.conf

systemctl restart php-fpm.service

netstat -tlnp

配置Nginx

server {
    listen       80;
    listen       [::]:80;
    server_name  forum.sujx.net;
    # 修改root目录
    root         /wwwroot/discuz/public/;

    # Load configuration files for the default server block.
    include /etc/nginx/default.d/*.conf;
    # 添加配置参数
    index index.php;
    gzip on;
    gzip_min_length 1024;
    gzip_types application/json text/css application/x-javascript application/javascript application/vnd.api+json;
    gzip_disable "MSIE [1-6]\.";
    gzip_comp_level 2;
   # 配置rewrite模块 
    location / {
            try_files $uri $uri/ /index.php?$query_string;
    }
   # 添加PHP支持
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO $fastcgi_path_info;
        include        fastcgi_params;
    }
            error_page 404 /404.html;
    location = /404.html {
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    }
}

配置数据库

# Mariadb需要10.0.5以上,MySQL需要8.5以上
mysql> create database forumdb;
mysql> create user forumdbadmin@'localhost' identified by 'forumdbadmin';
mysql> grant all privileges on ocsng.* to forumdbadmin@'localhost';
mysql> flush privileges;
mysql> exit;

安装

访问站点IP或者域名来进行安装

以下略