lala.im:开源免费的社区/论坛系统:Homeland

運維技術·軟件/源碼·lala.im · 2018-11-27 · 122 人浏览

原文地址:https://lala.im/4472.html,請支持原作者!該處僅作轉載。

这是一套基于Ruby开发的论坛系统,功能完善,界面很简洁,给人一种干净/小清新的感觉~
项目地址:https://github.com/ruby-china/homeland
官方推荐使用Docker部署,所以部署过程很简单,此外官方也有非常详细的使用文档了:
https://gethomeland.com/docs/
注意:因为我看了下这个程序搜索这块用到了ES,这个玩意非常占用内存,所以建议机器内存最好大于4GB,另外Docker不支持OVZ,请使用KVM等全虚拟化VPS安装。
下面是我在CentOS7上的部署过程:
更新系统:

yum -y update

安装Docker:

cd
yum -y install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-18.06.1.ce-3.el7.x86_64.rpm
systemctl start docker
systemctl enable docker.service

安装Docker-Compose:

curl -L https://github.com/docker/compose/releases/download/1.23.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

安装Git拉取项目并进入到项目目录:

yum -y install git
git clone https://github.com/ruby-china/homeland-docker.git
cd homeland-docker/

复制一份配置文件并进行编辑:

cp app.local.env.example app.local.env
vi app.local.env

下面是我用部署时用到的配置文件:

RAILS_ENV=production
# RAILS_LOG_TO_STDOUT=true

# Nginx
# NGINX_WORKER_CONNECTIONS=65535

# Database
DATABASE_URL=postgres://postgres@postgresql:5432/homeland
# DATABASE_POOL=64
REDIS_URL=redis://redis:6379/1
ELASTICSEARCH_HOST=elasticsearch:9200

# App Config
app_name=KoKoCAT
https=false
domain=koko.cat
cert_domain=*.koko.cat
modules=home,topic,press,site,note
profile_fields=all
[email protected]
asset_host=
upload_provider=file
upload_host=

注:
1.admin_emails请一定要修改成你自己的邮箱,这款论坛程序是根据邮箱来添加管理员账号的。也就是说你在这里配置好你的邮箱地址,待会在前台注册用户的时候填写和这个地址相同的邮箱,那么你注册的账号就是管理员。
2.https=false,初次安装这个一定要关闭,否则安装完成之后站点无法打开。要配置ssl也是在安装完成之后配置,但是我实测这个程序配置ssl这块估计是有点bug,Nginx各种出错。
3.domain修改成你自己的域名,app_name则是你的论坛名字,这个在安装完成之后也可以在后台设置。
确认无误后开始安装:

make install

完成之后运行:

make start

这样Homeland就安装完成了,如需配置SSL,则运行:

make install_ssl

完成之后重启程序:

make restart

我之前也说了,这个程序配置ssl估计是有bug,反正ssl我这边是配置不上,下面是我配置ssl的出错信息:

[Tue Nov 27 12:02:05 UTC 2018] Installing key to:/home/app/ssl/homeland.key
[Tue Nov 27 12:02:05 UTC 2018] Installing full chain to:/home/app/ssl/homeland.crt
[Tue Nov 27 12:02:05 UTC 2018] Run reload cmd: nginx -s reload
nginx: [error] open() "/run/nginx/nginx.pid" failed (2: No such file or directory)
[Tue Nov 27 12:02:05 UTC 2018] Reload error for :
make: *** [install_ssl] Error 1

我懒得折腾了,就这样吧,希望你们安装的时候不会出和我一样的问题。。。
关于邮件的配置,这里照搬一下官方的文档,因为我没有配置,不知道有没有什么坑:

vi app.local.env

添加如下参数:

mailer_provider=smtp
[email protected]
mailer_options_address=smtp.gmail.com
mailer_options_port=587
mailer_options_domain=your-domain.com
[email protected]
mailer_options_password=your-password
mailer_options_authentication=plain
mailer_options_enable_starttls_auto=true

帖子页面:

範例
论坛页面:

範例
总而言之是一款很不错的论坛程序,用在生产环境是肯定没问题的。当然最重要的是我又成功水了一篇文章~

運維技術 軟件/源碼 lala.im
Theme Jasmine by Kent Liao