关于新服务器安装Discourse的问题

因为买到了好我服务器准备使用

然后呢


域名都已经写好了

但是我

root@JUHOST-ZbWJCM:~# cd /var/discourse
root@JUHOST-ZbWJCM:/var/discourse# ./discourse-setup
The configuration file containers/app.yml already exists!

. . . reconfiguring . . .


Saving old file as app.yml.2024-07-25-070322.bak
Stopping existing container in 5 seconds or Control-C to cancel.
x86_64 arch detected.
WARNING: containers/app.yml file is world-readable. You can secure this file by running: chmod o-rwx containers/app.yml
+ /usr/bin/docker stop -t 600 app
app
Adding MAXMIND_ACCOUNT_ID placeholder to containers/app.yml

Found 8GB of memory and 4 physical CPU cores
setting db_shared_buffers = 2048MB
setting UNICORN_WORKERS = 8
containers/app.yml memory parameters updated.

Hostname for your Discourse? [www.justnainai.com]: 

Checking your domain name . . .
WARNING: Port 443 of computer does not appear to be accessible using hostname:  www.justnainai.com.
WARNING: Connection to http://www.justnainai.com (port 80) also fails.

This suggests that www.justnainai.com resolves to some IP address that does not reach this 
machine where you are installing discourse.

The first thing to do is confirm that www.justnainai.com resolves to the IP address of this server.
You usually do this at the same place you purchased the domain.

If you are sure that the IP address resolves correctly, it could be a firewall issue.
A web search for "open ports YOUR CLOUD SERVICE" might help.

This tool is designed only for the most standard installations. If you cannot resolve
the issue above, you will need to edit containers/app.yml yourself and then type

./launcher rebuild app

怎么都没法检测到我CMDping也是我服务器的IP地址

端口也都是开着的

然后我就试试用宝塔的

我直接这样没法访问

但是我使用SSL就可以了

但如果我

就会[这时候 已经使用了./launcher rebuild app 启动完成了]

这个问题多是 Let’s Encrypt 给你反向签名的问题。

检测不到地址不是 Discourse 安装程序检测不到,是 Let’s Encrypt 检测不到。

最后的那个 502 Bad Gateway 的错误是 443 的端口错误,是不是你的程序 443 端口没有做好反向代理映射?

这个问题尤其是在有各种反向代理的情况下容易出。

我们的解决办法就是自己买了一个 www 域名的 SSL,这个蛮便宜的,也就是 4 美元左右 1 年。

就不再需要 Let’s Encrypt 不停的给我们的域名签名了,而且 Let’s Encrypt 的签名有效期只有 3 个月,挺麻烦的。

有时候对于常用的和二级域名比较多的,我们就部署了泛域名。

说实话,这个钱还是真值得的,省了好多 Let’s Encrypt 签名签不上,二级域名 3 个月就过期,还要手动签一次的情况。

不仅仅是针对 Discourse。

2 Likes

其实这个我都是忽略的()其实你直接手动编辑app.yml然后 ./launcher rebuild app 就完事了

lets encrypt的certbot是有自动续签的服务的,按manual来就能配置上,我服务器开了快一年了也没管过ssl的事情,都是certbot自动续的

1 Like

个人方面有几台机器的 certbot 进程异常,一直签不下来,就懒得去调了。

花钱买个清净。

这些不仅仅针对 Discourse 的,所以就全部换成了购买 SSL 了。

公司层面

公司的 SSL 管理比较严格,通常都不让自行对域名进行签名。

所有的签名密钥都是 DevOps 那边下发的,还需要校验公司签名信息。

当然,主要是公司方面对 SSL 这个事情蛮严肃的,弄不好会涉及到很多的罚款和业务中断。

discourse能不能不要ssl证书

可以,直接域名不用https装就完事了

但我绝对不推荐这个,这相当于你把密码明文在网上传来传去,被中间人一下就等着泄露密码吧