16 Star 61 Fork 19

joymufeng / play-community

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README

PlayCommunity 社区系统

PlayCommunity 社区系统基于 Play Framework 2.6.x 开发而成,目前正在运营PlayScala社区

参与贡献

Play For Scala 开发指南
PlayScala社区贡献指南

下载&编译

git clone https://github.com/playcommunity/play-community.git

打开命令行,进入 play-community 目录,执行命令:

sbt dist

最终生成的Play应用路径为:

play-community\target\universal\play-community-<version>.zip

配置

配置 MongoDB 连接

play-community-<version>.zip 文件上传至服务器并解压,打开配置文件 conf/application.conf,配置如下:

# 配置 MongoDB
mongodb.uri = "mongodb://user:password@host:port/play-community?authMode=scram-sha1"

需要注意的是,MongoDB需要开启ReplicaSet功能,开启方法可以参考官方文档:Deploy Replica Set,也可以使用群友梦境迷离贡献的一键启动脚本,该脚本需要在Git Bash中运行。启动脚本的使用方法如下:

  • 打开Git Bash,切换当前目录至项目根目录;
  • 进入配置文件目录:cd conf
  • 执行启动脚本:bash start_mongo.sh,该脚本会启动mongod进程,并随后自动进入mongo shell
  • mongo shell中输入如下命令初始化ReplicaSet:
var config = {_id:"rs",members:[{_id:0,host:"127.0.0.1:27001"},{_id:1,host:"127.0.0.1:27002"}]};
rs.initiate(config);
  • 检查ReplicaSet状态:rs.status()

以上启动脚本会启动两个MongoDB节点,分别是127.0.0.1:27001127.0.0.1:27002,数据库文件位置为C:/mongo/data,日志路径为:C:/mongo/logs/log1.logC:/mongo/logs/log2.log

配置发送邮件账户:

打开配置文件 conf/application.conf,配置如下:

# 配置发送邮件账户
play.mailer {
  host = "smtp.163.com"
  port = 25
  user = "xxx@163.com"
  password = "xxx"
}

配置搜索服务 ElasticSearch

安装 ElasticSearch
下载任意一个版本,解压并执行启动命令:

官方的安装包由于安全问题不允许在 root 账户下启动。

cd elasticsearch-5.5.0/bin
nohup ./elasticsearch > ./log.txt&

打开配置文件 conf/application.conf ,配置如下:

# 配置 ElasticSearch
es {
  enabled = true
  index = "play-community"
  host = "127.0.0.1:9200"
}

启动

执行下面命令启动应用:

nohup ./play-community -J-Xms1g -J-Xmx1g -Dhttp.port=80 > ../log.txt &

关于Play应用的启动、停止以及升级,请参考:Play For Scala 开发指南 - 第5章 第一个Play项目 - 发布Play项目

管理

系统的管理入口为:

http://服务器地址/admin

默认管理员账户为:admin@playscala.cn 123456

Empty file

About

一个基于Play Framework开发的开源社区系统。 expand collapse
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
Scala
1
https://gitee.com/joymufeng/play-community.git
git@gitee.com:joymufeng/play-community.git
joymufeng
play-community
play-community
master

Search

14c37bed 8189591 565d56ea 8189591