Tomcat 方式部署 Solo 博客系统总结
- 作者: 五速梦信息网
- 时间: 2026年03月05日 13:17
此篇为Tomcat部署方式,另有Docker部署方式,请参考文章《Docker 方式部署 Solo 博客系统总结》
一、环境和文件准备
- 服务器:购买的阿里云服务器,系统为Linux(Cent OS)。
- JDK:版本1.8 下载
- Tomcat:版本9.0.19 下载
- Solo:war包形式,版本3.6.3 下载
- MySQL 8:通用Linux社区版 下载
下载准备好以上几个文件后,分别将他们放到Cent OS的相应目录中,具体目录自己决定。最好新建自己的文件夹,目录中不要出现中文。
/usr/local/hudk/JDK/jdk-8u111-linux-x64.tar.gz/usr/local/hudk/apache-tomcat-9.0.22-deployer.tar.gz/usr/local/hudk/solo-v3.6.3.war
二、安装JDK和配置环境变量
1、解压
/usr/local/hudk/JDK
$ tar -zxvf jdk-8u111-linux-x64.tar.gz
2、环境变量
/etc/profile.d/jdk.sh
#编辑文件
$ vim /etc/profile.d/jdk.sh
如果/etc/profile.d/下没有jdk.sh文件,执行此命令会自动增加jdk.sh文件,并进入vim编辑器,按键盘字母i进入编辑状态。编辑如下内容:
export JAVA_HOME=/usr/local/hudk/JDK/jdk1.8.0_111
export PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH
分别按键盘Esc > (Shift+:) > w >q >Enter 保存并推出编辑模式。执行以下命令使jdk.sh文件生效。
$ source /etc/profile.d/jdk.sh
JDK 环境变量的多种配置形式请参考 《CentOS 安装 JDK 三种形式详细总结》。
三、安装MySQL
mjsolo
四、安装Tomcat和配置80端口
1、解压缩
/usr/local/hudk/apache-tomcat-9.0.22-deployer.tar.gz
$ tar -zxvf apache-tomcat-9.0.22-deployer.tar.gz
server.xml
tomcat/usr/local/hudk/apache-tomcat-9.0.22/conf
$ vim ./server.xml
将其中内容:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
修改为:
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
五、部署Solo到Tomcat并启动初始化
1、解压缩
/usr/local/hudk/apache-tomcat-9.0.22/webapps/ROOT//usr/local/hudk/solo-v3.6.3.war/usr/local/hudk/apache-tomcat-9.0.22/webapps/ROOT/
2、修改配置文件
latke.propertieslocal.properties
latke.propertiesserverHostwww.mjhdk.cnwww.mjhdk.cnjs 和 css
#
# Solo - A small and beautiful blogging system written in Java.
# Copyright (c) 2010-present, b3log.org
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
#
# Description: B3log Latke configurations.
# Version: 1.6.0.2, Mar 19, 2019
# Author: Liang Ding
#
#### Server ####
# Browser visit protocol
serverScheme=http
serverHost=www.mjhdk.cn
serverPort=80
#### Runtime Mode ####
#runtimeMode=DEVELOPMENT
runtimeMode=PRODUCTION
local.properties
#
# Solo - A small and beautiful blogging system written in Java.
# Copyright (c) 2010-present, b3log.org
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
#
# Description: Solo local environment configurations.
# Version: 1.1.3.15, Mar 17, 2019
# Author: Liang Ding
#
#### MySQL runtime ####
runtimeDatabase=MYSQL
jdbc.username=***
jdbc.password=******
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.URL=jdbc:mysql://0.0.0.0:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC
#### H2 runtime ####
#runtimeDatabase=H2
#jdbc.username=root
#jdbc.password=
#jdbc.driver=org.h2.Driver
#jdbc.URL=jdbc:h2:~/solo_h2/db;MODE=MYSQL
# The minConnCnt MUST larger or equal to 3
jdbc.minConnCnt=5
jdbc.maxConnCnt=10
# The specific table name prefix
jdbc.tablePrefix=b3_solo
/usr/local/hudk/apache-tomcat-9.0.22/bin./startup.sh
相关文章
-
Tomcat 服务器版本的区别以及下载与安装
Tomcat 服务器版本的区别以及下载与安装
- 互联网
- 2026年03月05日
-
Tomcat 控制台UTF
Tomcat 控制台UTF
- 互联网
- 2026年03月05日
-
Tomcat(多版本)安装注意!
Tomcat(多版本)安装注意!
- 互联网
- 2026年03月05日
-
Tomcat Jboss Apache WebLogic区别与比较(阿里面试)
Tomcat Jboss Apache WebLogic区别与比较(阿里面试)
- 互联网
- 2026年03月05日
-
tomcat 7 用mod
tomcat 7 用mod
- 互联网
- 2026年03月05日
-
TOEFL 丨 202307 改革 · 新版题型总结
TOEFL 丨 202307 改革 · 新版题型总结
- 互联网
- 2026年03月05日



