standalone_mode

D edited this page Oct 18, 2016 · 23 revisions
Clone this wiki locally

独立模式

只要已经安装好了 Java 环境,一个命令就能启动!

  1. 不依赖 MySQL 数据库,而是使用内嵌的 H2 数据库
  2. 不依赖外置 Servlet 容器,而是使用内嵌 Jetty 进行启动

配置

解压 solo.war,然后修改如下配置:

  1. (可选)修改 latke.props,比如修改域名、端口等,默认 localhost
  2. (可选)修改 local.props 文件,其中 #### H2 runtime #### 段落的 jdbc.URL 值,默认数据存储路径 ~/b3log_solo_h2/db(~ 表示用户家目录 ${user.home})

配置细节请参考: Latke 配置剖析

运行

在解压目录下执行:

  • Windows: java -cp WEB-INF/lib/*;WEB-INF/classes org.b3log.solo.Starter
  • Unix-like: java -cp WEB-INF/lib/*:WEB-INF/classes org.b3log.solo.Starter

默认是监听 8080 端口启动服务的,如果要使用其他端口,可以在上述命令后加入端口参数,比如 -lp 9090 -sp 9090

更多信息请使用 -h 打印查看:

usage: java -cp WEB-INF/lib/*;WEB-INF/classes org.b3log.solo.Starter [-h]
       [-lp <LISTEN_PORT>] [-rm <RUNTIME_MODE>] [-sh <SERVER_HOST>] [-sp
       <SERVER_PORT>] [-ss <SERVER_SCHEME>] [-ssh <STATIC_SERVER_HOST>]
       [-ssp <STATIC_SERVER_PORT>] [-sss <STATIC_SERVER_SCHEME>]

Solo is a blogging system written in Java, feel free to create your or
your team own blog.
Solo 是一个用 Java 实现的博客系统,为你或你的团队创建个博客吧。

 -h,--help                                            print help for the
                                                      command
 -lp,--listen_port <LISTEN_PORT>                      listen port, default
                                                      is 8080
 -rm,--runtime_mode <RUNTIME_MODE>                    runtime mode
                                                      (DEVELOPMENT/PRODUCT
                                                      ION), default is
                                                      DEVELOPMENT
 -sh,--server_host <SERVER_HOST>                      browser visit domain
                                                      name, default is
                                                      localhost
 -sp,--server_port <SERVER_PORT>                      browser visit port,
                                                      default is 8080
 -ss,--server_scheme <SERVER_SCHEME>                  browser visit
                                                      protocol, default is
                                                      http
 -ssh,--static_server_host <STATIC_SERVER_HOST>       browser visit static
                                                      resource domain
                                                      name, default is
                                                      localhost
 -ssp,--static_server_port <STATIC_SERVER_PORT>       browser visit static
                                                      resource port,
                                                      default is 8080
 -sss,--static_server_scheme <STATIC_SERVER_SCHEME>   browser visit static
                                                      resource protocol,
                                                      default is http

Report bugs or request features please visit our project website:
https://github.com/b3log/solo