本wiki只针对ubuntu(24.04 LTS)进行验证,其他系统请自行测试。
- openjdk: v21.0.5
参考官方文档
# install openjdk
apt-get install openjdk-21-jdk
# Verify the java version:
java -version
- Tomcat: latest
参考官方文档
- Redis: latest
参考官方文档
- mySQL: 8.0
参考官方文档
- 创建名为easyads数据库database;
- 使用src/main/resources/mysql目录下的sql文件创建数据表;
配置文件为src/main/resources/application-prod.properties
,将MySQL
和Redis
更改为自己的配置。
...
# easyads db
spring.datasource.easyads.driverClassName = com.mysql.cj.jdbc.Driver
spring.datasource.easyads.jdbc-url = jdbc:mysql://127.0.0.1:3306/easyads?allowMultiQueries=true&characterEncoding=utf-8
spring.datasource.easyads.username = youruser
spring.datasource.easyads.password = yourpassword
...
#primary_conf redis
spring.redis.primary.database = 0
spring.redis.primary.hostName = 127.0.0.1
spring.redis.primary.port = 6379
spring.redis.primary.password = yourpassword
##----------------------- online redis --------------------
# easyads redis
spring.redis.easyads.database = 1
spring.redis.easyads.hostName = 127.0.0.1
spring.redis.easyads.port = 6379
spring.redis.easyads.password = yourpassword
# 执行构建
mvn clean package -Pprod
# 建议通过Tomcat/Jetty托管
# 复制war到Tomcat的webapps下
cp target/Luna.war $TOMCAT_WEBAPPS/