1、概述
rhythm
是由摸鱼派社区基于symphony
社区版进行的二次开发程序。
社区版:使用 AGPLv3 开源,如果你选择使用社区版,则必须完全遵守 AGPLv3 的相关条款;公司使用必须购买商用授权。
2、基于rhythm源码构建
需提前准备好构建环境:jdk1.8、maven
2.1、拉取源码
git clone https://github.com/csfwff/rhythm.git
cd rhythm/
2.2、修改配置文件
latke.properties
:配置系统端口及系统运行模式(开发模式还是生产模式)等一些信息。
默认为开发模式。开发模式下用户注册不会真发送手机验证码,而是将验证码打印在控制台上。如果改为生产模式则需要在symphony.properties中填写ten开头的手机验证码发送配置。否则用户注册时无法获取手机验证码。local.properties
:配置了数据库的信息。
jdbc.URL=jdbc:mysql://localhost:3306/b3log_symphony?useUnicode=yes&characterEncoding=UTF-8&useInformationSchema=true&useSSL=false&serverTimezone=UTC
jdbc.username=adminnnn
jdbc.password=123333
symphony.properties
:第三方一些配置信息,例如邮件推送服务等。
2.3、修改src/assembly/bin.xml
文件
<formats>
<format>dir</format>
</formats>
<!-- 增加此内容 start -->
<id>assembly</id>
<!-- 增加此内容 end -->
<includeBaseDirectory>false</includeBaseDirectory>
如果不添加在打包时会报如下错误
[INFO] Reading assembly descriptor: src/assembly/bin.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.984 s
[INFO] Finished at: 2023-10-08T01:34:18-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:3.6.0:single (make-assembly) on project symphony: Assembly is incorrectly configured: null: Assembly is incorrectly configured: null:
[ERROR] Assembly: null is not configured correctly: Assembly ID must be present and non-empty.
2.4、打包并运行
在rhythm目录下执行mvn package -DskipTests
命令进行打包。
打包完成后将rhythm/target路径下的symphony-assembly整个文件夹拷贝至服务器。
进入symphony-assembly目录并执行以下命令运行程序。
- Windows:
java -cp "lib/*;." org.b3log.symphony.Server
- linux:
java -cp "lib/*:." org.b3log.symphony.Server
后台运行:
nohup java -cp "lib/*:." org.b3log.symphony.Server > rhy.log 2>&1 &
#查看启动日志
tail -f rhy.log
2.5、配置nginx伪静态
upstream backend_symphony {
#latke.properties中配置的端口号
server localhost:8080;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server
{
listen 80;
server_name test.doget.net;
#ssl自行添加
location / {
proxy_pass http://backend_symphony$request_uri;
proxy_http_version 1.1;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
access_log /www/wwwlogs/test.doget.net.log;
error_log /www/wwwlogs/test.doget.net.error.log;
}
2.6、登录
默认管理员: admin
默认密码:admin
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容