🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

Domestic Forum Program Discuz! Q Beta Version Application and Installation Tutorial

Discuz is believed to be a very familiar forum source code for older personal webmasters in China. From the same period, there was also phpwind. A few years ago, when policies were not so strict, forums were very popular. Naibabiji considers Discuz to be the best forum program, but later, after Tencent's acquisition and policy influences, it was essentially abandoned. Some time ago, Wu Hongsheng (Naizhao) announced on the official forum that Discuz is returning and will develop a new version called Discuz!Q. It mainly aims to help high-traffic influencers, internet celebrities, knowledge payment creators, WeChat ecosystem, and mobile internet entrepreneurs more easily achieve user retention and conversion to paid users. Discuz! Q is a lighter, more monetizable, more mobile-focused, more open, and more easily customizable community product.Currently, the Discuz! Q beta version is open for application and experience. Interested webmasters can give it a try.

Prerequisites:

  1. Have a real-name verified domain at DNSPod (domains from other registrars are currently not supported for application).
  2. A clean server (actually, adding a separate virtual host should also work, but Naibabiji hasn't tested it).
  3. In the Tencent Cloud Account Center's API Key Management, obtain the SecretId and SecretKey. Note: Please never leak these two items to anyone you do not trust to avoid your Tencent Cloud account being compromised and suffering losses.
  4. It is recommended to enable an SSL security certificate.
Apply for Beta Access:https://www.dnspod.cn/promo/discuzq

Installation Process

1. Install Server Environment

The official recommendation is to install the LNMP one-click package (webmasters from that era used this more, as Baota Panel wasn't available yet). Of course, installing Baota Panel should also work. The specific tutorial is not repeated here; refer to the link below:
  1. #Website Building# LNMP One-Click Installation Tutorial with Screenshots
  2. Beginner-friendly graphic installation tutorial for building a website with Baota Panel
During installation, pay attention to selecting the following items:
  • MariaDB 10.3.15
  • PHP 7.3.6
  • Jemalloc
  • Memcached
  • Redis
  • imageMagick
For the LNMP one-click package, after installation, delete the disabled functions. The code is as follows:
sed -i 's/^disable_functions.*/disable_functions = /' /usr/local/php/etc/php.ini

2. Clone Discuz!Q Installation Code

Because the Discuz!Q code is still in beta and does not have a complete installation package, the code directory is not particularly standardized. We need to manually create the directory first. First, create a folder on the server. Example code is as follows: (For Baota Panel, just create it directly).
mkdir -p /var/hosts/com/naizhao
cd /var/hosts/com/naizhao
The above code creates a folder named 'naizhao' and then switches to the 'naizhao' folder. Then we change the composer source to Tencent Cloud (the official composer source is abroad and very slow).
composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/
Start cloning the code into the folder.
composer create-project --prefer-dist qcloud/discuz --repository=https://cloud.discuz.chat q
During the code cloning process, you will be prompted to enter Tencent Cloud's API keys. If everything goes smoothly, the code has been completely cloned into the 'q' directory. We can go in and take a look.
cd q
ls -lha
You should see the following content.
total 388K
drwxr-xr-x 11 root root 4.0K Mar 16 18:23 .
drwxr-xr-x  3 root root 4.0K Mar 16 18:21 ..
drwxr-xr-x 28 root root 4.0K Mar 16 18:21 app
-rw-rw-rw-  1 root root  917 Mar 15 19:57 composer.json
-rw-r--r--  1 root root 319K Mar 16 18:23 composer.lock
drwxr-xr-x  2 root root 4.0K Mar 16 18:21 config
drwxr-xr-x  4 root root 4.0K Mar 16 18:21 database
-rw-rw-rw-  1 root root  362 Mar 15 19:57 disco
-rw-rw-rw-  1 root root  213 Mar 15 19:57 .editorconfig
drwxr-xr-x  4 root root 4.0K Mar 16 18:21 .github
-rw-rw-rw-  1 root root  108 Mar 15 19:57 .gitignore
-rw-rw-rw-  1 root root 1.4K Mar 15 19:57 .php_cs
drwxr-xr-x  5 root root 4.0K Mar 16 18:21 public
-rw-rw-rw-  1 root root 2.3K Mar 15 19:57 readme.md
drwxr-xr-x  7 root root 4.0K Mar 16 18:21 resources
drwxr-xr-x  2 root root 4.0K Mar 16 18:21 routes
drwxr-xr-x 11 root root 4.0K Mar 16 18:21 storage
drwxr-xr-x 56 root root 4.0K Mar 16 18:23 vendor
Finally, modify the directory permissions for 'storage' and 'config' to 777.
chmod -R 777 storage config

4. Add Virtual Host

For LNMP, the code used to add a virtual host is as follows. For Baota Panel, please configure accordingly.
Please enter domain(example: www.lnmp.org): 让你输入要绑定的域名
 Your domain: 你绑定的域名
Enter more domain name(example: lnmp.org *.lnmp.org): 
Please enter the directory for the domain: 为你绑定的域名设置路径
Default directory: /home/wwwroot/q.naizhao.com: /var/hosts/com/naizhao/q/public #输入网站的根目录,记得后面要加上public
Virtual Host Directory: /var/hosts/com/naizhao/q/public
Allow Rewrite rule? (y/n) y
Please enter the rewrite of programme, 
wordpress,discuzx,typecho,thinkphp,laravel,codeigniter,yii2 rewrite was exist.
(Default rewrite: other): laravel #rewrite规则选择laravel
You choose rewrite: laravel
Enable PHP Pathinfo? (y/n) y
Enable pathinfo.
Allow access log? (y/n) y
Enter access log filename(Default:q.naizhao.com.log): 
You access log filename: q.naizhao.com.log
Create database and MySQL user with same name (y/n) y #创建MySQL数据库
Enter current root password of Database (Password will not shown): #输入MySQL的root密码
OK, MySQL root password correct.
Enter database name: dzq #输入要创建的数据库名字
Your will create a database and MySQL user with same name: dzq
Please enter password for mysql user dzq: dzq #输入数据库密码
Your password: dzq 
Add SSL Certificate (y/n) y #是否打开SSL支持
1: Use your own SSL Certificate and Key
2: Use Let's Encrypt to create SSL Certificate and Key
Enter 1 or 2: 2 #SSL证书安装方式,如果前面在腾讯云申请了,选1。或者选2用Let's Encrypt提供的免费3个月证书。但一定要提前把域名指向你的服务器,否则申请不成功!!!
It will be processed automatically.
Then wait about half a minute, and both the website and database will be created.
Next, remove the open_basedir restriction, otherwise it will cause a 500 error. Run lnmp1.6/tools/remove_open_basedir_restriction.sh, enter the website root directory /var/hosts/com/naizhao/q/public, and press Enter.
Edit the nginx configuration file. In the directory /usr/local/nginx/conf/vhost/, find the corresponding file, such as q.naizhao.com.conf. Replace the entire file with the following content (do not paste directly; pay attention to modifying some corresponding parameters).
server {
listen 80;
server_name 你前面绑定的域名; #网站域名
return 301 https://$host$request_uri; # 强制把HTTP跳转到HTTPS
}


server {
listen 443 ssl http2;
server_name 你绑定的域名; #网站域名
root /var/hosts/com/naizhao/q/public; #网站目录,切记指到public


ssl_certificate /usr/local/nginx/conf/ssl/你绑定的域名/fullchain.cer; #ssl证书的证书链
ssl_certificate_key /usr/local/nginx/conf/ssl/你绑定的域名/你绑定的域名.key; #ssl证书的key


ssl_session_cache shared:SSL:10m;
ssl_session_timeout 24h;


ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ecdh_curve secp521r1:secp384r1;
ssl_session_tickets off;
ssl_stapling on;
ssl_stapling_verify on;
ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;
ssl_buffer_size 4k;


add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;


index index.html;


include enable-php-pathinfo.conf;


location /install {
try_files $uri $uri/ /index.php?$query_string;
}


location /api {
try_files $uri $uri/ /index.php?$query_string;
}


location / {
try_files $uri $uri/ /index.html;
}


location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }


error_page 404 /index.php;
}
After completing, restart LNMP.
lnmp restart

5. Install Discuz! Q

Open your browser and visit: https://your-bound-domain/install Follow the prompts to enter MySQL information and administrator details, then click install. After installation is complete, go to: https://your-bound-domain/admin to manage your site. Note: If a loading icon persists after installation, open your browser's developer mode - Application - Storage - Local Storage, right-click and select Clear, then refresh the browser.

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step instead.

「Naibabiji WordPress Website Building Coaching」 — From selecting a domain and purchasing hosting to installing themes and publishing posts, I「ll guide you through every step, helping you avoid detours and reach your goals directly.

👉 Learn about Website Building Coaching Service
🔒

Comments are closed

The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.

×
二维码

Scan to Follow