当前位置: 首页 > news >正文

06.部署jpress

  • 安装mariadb数据
yum -y install mariadb-server
#启动并设置开启自启动
systemctl start mariadb.service  
systemctl enable  mariadb.service
  • 数据库准备
[root@web01 ~]# mysql 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.68-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> create database jpress charset utf8mb4;
Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> show create database jpress;
+----------+--------------------------------------------------------------------+
| Database | Create Database                                                    |
+----------+--------------------------------------------------------------------+
| jpress   | CREATE DATABASE `jpress` /*!40100 DEFAULT CHARACTER SET utf8mb4 */ |
+----------+--------------------------------------------------------------------+
1 row in set (0.00 sec)MariaDB [(none)]> grant all on jpress.* to 'jpress'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> select user,host from mysql.user;
+--------+-----------+
| user   | host      |
+--------+-----------+
| root   | 127.0.0.1 |
| root   | ::1       |
|        | localhost |
| jpress | localhost |
| root   | localhost |
|        | web01     |
| root   | web01     |
+--------+-----------+
7 rows in set (0.00 sec)MariaDB [(none)]> grant all on jpress.* to 'jpress'@'172.16.1.%' identified by '123456';
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> drop user ''@'localhost';
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> 
MariaDB [(none)]> drop user ''@'web01';
Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> 
MariaDB [(none)]> select user,host from mysql.user;
+--------+------------+
| user   | host       |
+--------+------------+
| root   | 127.0.0.1  |
| jpress | 172.16.1.% |
| root   | ::1        |
| jpress | localhost  |
| root   | localhost  |
| root   | web01      |
+--------+------------+
6 rows in set (0.00 sec)MariaDB [(none)]> 
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
[root@web01 ~]# mysql -ujpress -p123456
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 7
Server version: 5.5.68-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
  • 准备代码jpress
    上传jpress.war包,直接移动到webapps路径下
[root@web01 ~]# ls
anaconda-ks.cfg  initial-setup-ks.cfg  jpress.war
[root@web01 ~]# mv jpress.war /application/tomcat/webapps/
[root@web01 ~]# ll /application/tomcat/webapps/
总用量 20320
drwxr-xr-x 14 root root     4096 8月   6 13:06 docs
drwxr-xr-x  6 root root       83 8月   6 13:06 examples
drwxr-xr-x  5 root root       87 8月   6 13:06 host-manager
drwxr-xr-x  7 root root      102 8月   6 16:01 jpress
-rw-r--r--  1 root root 20797013 3月   3 2017 jpress.war
drwxr-xr-x  5 root root      103 8月   6 13:06 manager
drwxr-xr-x  3 root root     4096 8月   6 13:06 ROOT
  • 安装向导
    访问http://192.168.111.12:8080/jpress/
    在这里插入图片描述

下图对应的数据信息存放的文件

#tomcat数据库配置文件 db.properties
[root@web01 /application/tomcat/webapps/jpress/WEB-INF/classes]# cat db.properties 
#Auto create by JPress
#Sat Aug 06 19:35:01 CST 2022
db_name=jpress
db_host_port=3306
db_tablePrefix=jpress_
db_host=localhost
db_password=123456
db_user=jpress

如图所示对应的信息内容
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • http://192.168.111.12:8080/jpress/admin/
    在这里插入图片描述
    在这里插入图片描述

编辑文章,添加内容文字和图片进行发布
在这里插入图片描述

发布成功
在这里插入图片描述

上传的图片存放位置
attachment 该路径为用上传目录
在这里插入图片描述

数据库中存放文章的的内容
在这里插入图片描述

[root@web01 ~]# cat /application/tomcat/webapps/ROOT/mem.jsp 
<%
Runtime rtm = Runtime.getRuntime();
long mm = rtm.maxMemory()/1024/1024;
long tm = rtm.totalMemory()/1024/1024;
long fm = rtm.freeMemory()/1024/1024;
out.println("JVM memory detail info :<br>");
out.println("Max memory:"+mm+"MB"+"<br>");
out.println("Total memory:"+tm+"MB"+"<br>");
out.println("Free memory:"+fm+"MB"+"<br>");
out.println("Available memory can be used is :"+(mm+fm-tm)+"MB"+"<br>");
%>

在这里插入图片描述

相关文章:

  • Sublime Text 基础教程(个人总结)
  • 机器学习之爬山算法(Hill Climbing Algorithm)
  • 【OpenVINO™】在C#中使用 OpenVINO™ 部署 YOLOv10 模型实现目标
  • 多线程笔记
  • 浙江大学数据结构MOOC-课后习题-第九讲-排序3 Insertion or Heap Sort
  • git多人开发,不用merge的操作方法,阿里codeup
  • 柳宗元,政治坎坷与文学辉煌的交织
  • 多线程基本常识
  • 实现按块复制元素的进阶技巧
  • 邦芒职场:揭秘影响你职场收入的九大细节
  • 15、设计模式之责任链模式
  • java入门 springboot上传文件
  • vue3 ts问题 找不到模块“@/views/home/index.vue”或其相应的类型声明。
  • STM32系列(HAL库)——F103C8T6通过HC-SR04超声波模块实现测距
  • Python进阶:探索Python标准库和第三方库
  • [译] 理解数组在 PHP 内部的实现(给PHP开发者的PHP源码-第四部分)
  • 【159天】尚学堂高琪Java300集视频精华笔记(128)
  • 【译】React性能工程(下) -- 深入研究React性能调试
  • Android Studio:GIT提交项目到远程仓库
  • Git 使用集
  • JavaScript实现分页效果
  • Nacos系列:Nacos的Java SDK使用
  • nodejs调试方法
  • WinRAR存在严重的安全漏洞影响5亿用户
  • 反思总结然后整装待发
  • 基于Mobx的多页面小程序的全局共享状态管理实践
  • 通过获取异步加载JS文件进度实现一个canvas环形loading图
  • 我建了一个叫Hello World的项目
  • 你对linux中grep命令知道多少?
  • 微龛半导体获数千万Pre-A轮融资,投资方为国中创投 ...
  • ​VRRP 虚拟路由冗余协议(华为)
  • #{}和${}的区别?
  • #QT(智能家居界面-界面切换)
  • #绘制圆心_R语言——绘制一个诚意满满的圆 祝你2021圆圆满满
  • (C++17) optional的使用
  • (delphi11最新学习资料) Object Pascal 学习笔记---第5章第5节(delphi中的指针)
  • (二)c52学习之旅-简单了解单片机
  • (力扣题库)跳跃游戏II(c++)
  • (欧拉)openEuler系统添加网卡文件配置流程、(欧拉)openEuler系统手动配置ipv6地址流程、(欧拉)openEuler系统网络管理说明
  • (四)汇编语言——简单程序
  • (已解决)vue+element-ui实现个人中心,仿照原神
  • (转)http-server应用
  • (转)机器学习的数学基础(1)--Dirichlet分布
  • .NET 8.0 中有哪些新的变化?
  • .NET CORE Aws S3 使用
  • .NET Windows:删除文件夹后立即判断,有可能依然存在
  • .NET/C# 中你可以在代码中写多个 Main 函数,然后按需要随时切换
  • .NET框架
  • .net生成的类,跨工程调用显示注释
  • .NET应用架构设计:原则、模式与实践 目录预览
  • :=
  • @Async注解的坑,小心
  • @Autowired标签与 @Resource标签 的区别
  • @JsonFormat与@DateTimeFormat注解的使用
  • @JsonSerialize注解的使用