网站首页/ 信息中心/ 档案百科/

镇江数字档案馆系统本地化部署实操全流程 零基础可直接上手落地

发布时间:2026年08月14日 19:26:16 浏览量:0

一、部署前置准备

1.1 硬件&系统要求

部署前确保服务器满足以下最低配置,避免运行卡顿或存储不足:

1.2 依赖环境预安装

以下为CentOS7.9环境下依赖安装命令,可直接复制执行,Ubuntu环境可替换为apt命令:

``` 1.更新系统源 yum update -y 2.安装Nginx、MySQL5.7、Redis6、JDK11 yum install nginx mysql-server redis java-11-openjdk -y 3.启动所有依赖并设置开机自启 systemctl start nginx mysqld redis systemctl enable nginx mysqld redis ```

执行完成后需要初始化MySQL root密码,执行命令mysql_secure_installation按提示设置密码即可,牢记设置的root密码后续会用到

二、核心程序部署

2.1 程序包&初始化脚本获取

直接执行以下命令下载官方适配镇江档案标准的程序包和初始化脚本:

``` 创建程序存放目录 mkdir -p /opt/archives cd /opt/archives 下载核心程序包 wget https://gitee.com/zhenjiang-archives/digital-archives-system/releases/download/v1.2.0/archives-system.jar 下载数据库初始化脚本 wget https://gitee.com/zhenjiang-archives/digital-archives-system/releases/download/v1.2.0/init.sql ```

2.2 数据库初始化

执行以下命令创建专用数据库、用户并导入初始化表结构:

``` 登录MySQL,输入之前设置的root密码 mysql -u root -p 执行以下SQL语句 CREATE DATABASE archives_db DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; CREATE USER 'archives_user'@'localhost' IDENTIFIED BY 'Ar@chives2024'; GRANT ALL PRIVILEGES ON archives_db. TO 'archives_user'@'localhost'; FLUSH PRIVILEGES; use archives_db; source /opt/archives/init.sql; exit; ```

2.3 配置文件编写

在/opt/archives目录下创建application.yml配置文件,以下为完整可直接复制的配置内容:

``` server: port: 8080 spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/archives_db?useUnicode=true&characterEncoding=utf8mb4&useSSL=false&serverTimezone=Asia/Shanghai username: archives_user password: Ar@chives2024 redis: host: localhost port: 6379 password: "" 若设置了Redis密码请填写此处 database: 0 servlet: multipart: max-file-size: 10GB max-request-size: 10GB web: resources: static-locations: file:/opt/archives/files/ archives: storage: path: /opt/archives/files/ max-quota-per-user: 100GB 单用户档案存储配额可按需调整 ```

执行命令mkdir -p /opt/archives/files创建文件存储目录,再执行chown -R www:www /opt/archives给目录赋权,避免后续上传文件报错

2.4 服务启动配置

镇江数字档案馆系统本地化部署实操全流程 零基础可直接上手落地

使用systemd管理系统服务,创建/usr/lib/systemd/system/archives.service文件,内容如下:

``` [Unit] Description=Zhenjiang Digital Archives System After=network.target mysqld.service redis.service [Service] Type=simple User=www Group=www WorkingDirectory=/opt/archives ExecStart=/usr/bin/java -jar archives-system.jar --spring.config.location=application.yml Restart=always RestartSec=5 StandardOutput=journal+console StandardError=journal+console [Install] WantedBy=multi-user.target ```

执行以下命令启动服务:

``` systemctl daemon-reload systemctl start archives systemctl enable archives ```

执行systemctl status archives查看服务状态,显示active(running)即为启动成功。

三、反向代理&访问配置

3.1 Nginx配置

创建/etc/nginx/conf.d/archives.conf配置文件,内容如下:

``` server { listen 80; server_name 你的服务器公网IP或绑定的域名; client_max_body_size 10G; access_log /var/log/nginx/archives_access.log; error_log /var/log/nginx/archives_error.log; 档案文件静态资源访问 location /files/ { alias /opt/archives/files/; expires 30d; } 后台接口代理 location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 300s; proxy_send_timeout 300s; proxy_read_timeout 300s; } } ```

执行nginx -t验证配置无误后,执行nginx -s reload重载配置即可。

四、功能验证&初始配置

4.1 后台登录

访问地址http://你的IP/admin进入后台,默认账号为admin,默认密码为Admin@123456,登录后第一时间进入「个人中心」修改默认密码,避免安全风险

4.2 基础规则配置

4.3 功能测试

点击「档案上传」按钮上传任意测试文档,提交后进入「档案检索」页面搜索文件名,可正常查看、下载文件即为部署成功。

五、常见问题排查

档案整理能提高投资回报率:被忽视的资产管理增效策略
档案整理能提高投资回报率:被忽视的资产管理增效策略
在投资领域,我们常常聚焦于市场分析、资产配置和风险控制,却容易忽略一个基础但至关重要的环节——档案整理。许多人不知道,一套系统、清晰的档案管理体系,能够直接或间接地提升你的投资回报率。本文将深入探讨档...
2026年08月14日 19:26:16
档案管理系统接口开发困难解决方案 看完直接落地
档案管理系统接口开发困难解决方案 看完直接落地
你有没有过对接档案管理系统接口的糟心经历?熬了好几个大夜写代码,要么调不通,要么传过去的数据乱码,要么涉密数据不符合要求被打回。老板天天催上线,服务商甩锅说你参数传错,两边扯皮扯得头都大。别慌,这篇文...
2026年08月14日 19:26:16
微信咨询
电话联系
QQ客服
微信咨询一对一服务
服务热线: 028-8744 4417
QQ客服: 2305721818