VPS/云主机等
优惠信息分享

宝塔面板安装discourse论坛程序

Discourse程序基于Ruby on Rails, Ember.js, 以及PostgreSQL, 完全免费开源。它拥有丰富的功能,强劲的性能,高稳定性与安全性,以及可以高度自定义的界面。

官方推荐使用docker安装,借助Docker,我们可以在一个简单的容器中为您提供经过完全优化的Discourse配置,以及基于Web的GUI,使您只需单击一个按钮即可轻松升级到Discourse的新版本。这篇文章还是基于宝塔面板来安装。

宝塔服务器面板,一键全能部署及管理,送你3188元礼包,点我领取https://www.bt.cn/?invite_code=MV9ub2NxdmI=

注意,本教程的系统环境为Centos7


之前介绍的论坛程序安装教程:

1)宝塔面板安装discourse论坛程序:https://www.daniao.org/12801.html

2)宝塔面板安装Homeland:https://www.daniao.org/12632.html

3)宝塔面板部署NodeBB:https://www.daniao.org/12504.html

4)宝塔面板安装Flarum:https://www.daniao.org/12468.html


1、简介

项目:https://github.com/discourse/discourse

官网:https://www.discourse.org/

演示:https://try.discourse.org/

2、准备

1)硬件需求:

  • 推荐双核vps
  • 最低1 GB RAM(带有swap)
  • 与Docker兼容的64位Linux系统
  • 最小10 GB磁盘空间

2)其他准备

  • 宝塔面板
  • docker管理器(软件商店里安装)
  • 准备一个域名

3、留出80和443端口

安装需要80和443端口,所以最好是在一个全新的宝塔环境里安装该该程序。宝塔面板默认占用了80端口,我们需要稍微修改一下。

1)路径:/www/server/panel/vhost/nginx,把里面的文件端口改为其他,比如808。看图:

注意,这里面的2个默认文件都需要编辑默认的80端口。

4、部署

1)下载程序

git clone https://github.com/discourse/discourse_docker.git /var/discoursecd /var/discourse

2)编辑app.yml

[reply]

执行命令 cp samples/standalone.yml containers/app.yml复制配置文件到containers目录并且根据自己环境配置app.yml配置文件,修改以下内内容

具体编辑如下:

expose:  - "80:80"   # http  默认80端口,如果需要修改可以改为类似8080:80的形式  - "443:443" # httpsparams:  db_default_text_search_config: "pg_catalog.english"  ## Set db_shared_buffers to a max of 25% of the total memory.  ## will be set automatically by bootstrap based on detected RAM, or you can override  db_shared_buffers: "2048MB"  ## can improve sorting performance, but adds memory usage per-connection  #db_work_mem: "40MB"  ## Which Git revision should this container use? (default: tests-passed)  #version: tests-passedenv:  LC_ALL: zh_CN.UTF-8  LANG: zh_CN.UTF-8  LANGUAGE: zh_CN.UTF-8  # DISCOURSE_DEFAULT_LOCALE: en  ## How many concurrent web requests are supported? Depends on memory and CPU cores.  ## will be set automatically by bootstrap based on detected CPUs, or you can override  UNICORN_WORKERS: 8  ## TODO: The domain name this Discourse instance will respond to  ## Required. Discourse will not work with a bare IP number.  DISCOURSE_HOSTNAME: dd.qixi.ng  #这里是域名,不要忘记填写。  ## Uncomment if you want the container to be started with the same  ## hostname (-h option) as specified above (default "$hostname-$config")  #DOCKER_USE_HOSTNAME: true  ## TODO: List of comma delimited emails that will be made admin and developer  ## on initial signup example '[email protected],[email protected]'  DISCOURSE_DEVELOPER_EMAILS: '[email protected]'  #这里修改为自己的  ## TODO: The SMTP mail server used to validate new accounts and send notifications  # SMTP ADDRESS, username, and password are required  # WARNING the char '#' in SMTP password can cause problems!  #这下面都是邮箱配置,根据需要来。  DISCOURSE_SMTP_ADDRESS: smtp.163.com  DISCOURSE_SMTP_PORT: 587  DISCOURSE_SMTP_USER_NAME: daniao  DISCOURSE_SMTP_PASSWORD: "123456"  #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)  DISCOURSE_SMTP_DOMAIN: daniao.org  DISCOURSE_NOTIFICATION_EMAIL: [email protected]  ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate  LETSENCRYPT_ACCOUNT_EMAIL: [email protected]

[/reply]

3)启动安装

在程序根目录,输入以下命令开始安装。

./discourse-setup

4)在提示时回答以下问题例如:

Hostname for your Discourse? [discourse.example.com]: Email address for admin account(s)? [[email protected],[email protected]]: SMTP server address? [smtp.example.com]: SMTP port? [587]: SMTP user name? [[email protected]]: SMTP password? [pa$$word]: Let's Encrypt account email? (ENTER to skip) [[email protected]]:

之后,我们需要等2到8分钟的时间安装程序!!

5)如果需要更换域名,或者其他,你需要编辑app.yml文件。编辑好后,输入以下命令让修改生效。

./launcher rebuild app

5、安装向导

1)上面的程序安装完成后,打开你的域名便可以访问了。

2)注册新帐户并成为管理员,使用引导前输入的电子邮件地址之一注册一个新的管理员帐户。

3)注册成功,要验证邮箱,所以前面的smtp一定要配置正确。

4)注册管理员帐户后,安装向导将启动并指导您完成Discourse的基本配置。

5)完成设置向导后,您应该看到Staff主题和README FIRST:Admin快速入门指南

6、升级版本

随着新版本的Discourse的发布,您将收到电子邮件提醒。请保持最新状态以获取最新功能和安全修复程序。要将Discourse升级到最新版本,请/admin/upgrade在浏览器中访问,然后单击“升级”按钮。

launcher命令/var/discourse可用于各种维护,如下:

Usage: launcher COMMAND CONFIG [--skip-prereqs] [--docker-args STRING]Commands:    start:      Start/initialize a container    stop:       Stop a running container    restart:    Restart a container    destroy:    Stop and remove a container    enter:      Use nsenter to get a shell into a container    logs:       View the Docker logs for a container    bootstrap:  Bootstrap a container for the config based on a template    rebuild:    Rebuild a container (destroy old, bootstrap, start new)    cleanup:    Remove all containers that have stopped for > 24 hoursOptions:    --skip-prereqs Don't check launcher prerequisites    --docker-args  Extra arguments to pass when running docker

举个列子:

./launcher rebuild app

7、最后

上面的app就是容器的名称,看图:

用宝塔来安装还是有点繁琐的,你如果用80端口,还需要修改宝塔默认占用的80端口。

参考:

https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md

https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247

赞(0)
未经允许不得转载:遗弃你|YIQINI.COM » 宝塔面板安装discourse论坛程序

评论 抢沙发

评论前必须登录!

 

登录

找回密码

注册