在tomcat服务器上,部署jpress个人博客

搭建个人博客

安装tomcat

[root@solo ~]#  yum install tomcat tomcat-webapps tomcat-admin-webapps -y
已加载插件:fastestmirror
Determining fastest mirrors
 * base: mirrors.ustc.edu.cn
 * extras: mirrors.163.com
 * updates: mirrors.aliyun.com
base                                                         | 3.6 kB  00:00:00
extras                                                       | 2.9 kB  00:00:00
updates                                                      | 2.9 kB  00:00:00
(1/4): extras/7/x86_64/primary_db                            | 232 kB  00:00:00
(2/4): base/7/x86_64/group_gz                                | 153 kB  00:00:00
(3/4): updates/7/x86_64/primary_db                           | 7.1 MB  00:00:03
(4/4): base/7/x86_64/primary_db                              | 6.1 MB  00:00:09
正在解决依赖关系
[root@jpress ~]# systemctl restart tomcat

在这里插入图片描述
安装MySQL
可参考这篇文章

[root@jpress ~]# mysql -u root -p 5072e1f5
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@jpress ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

  • 密钥老不对,烦死了(生产环境可别这样啊)
[root@jpress ~]# vi /etc/my.cnf
#加一行
skip-grant-tables

[root@jpress mysql]# service mysql restart
Shutting down MySQL.. SUCCESS!
Starting MySQL. SUCCESS!
[root@jpress mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.48 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit
Bye

安装jpress

  • 命令行下载
[root@jpress ~]# wget https://gitee.com/JPressProjects/jpress/raw/master/docker-compose.yml
--2021-04-18 16:59:05--  https://gitee.com/JPressProjects/jpress/raw/master/docker-compose.yml
正在解析主机 gitee.com (gitee.com)... 180.97.125.228
正在连接 gitee.com (gitee.com)|180.97.125.228|:443... 已连接。

  • 下载所需要的war包 ,下拉寻找war包(官网

在这里插入图片描述

  • 总之(我觉得下到本地,解压后再上传到服务器比较好)
[root@jpress ~]# ll
总用量 89496
-rw-------. 1 root root     1285 417 11:22 anaconda-ks.cfg
drwxr-xr-x. 6 root root       86 420 14:50 jpress


无论解压否,都将jpress的war包移动到/var/lib/tomcat/webapps里

[root@jpress webapps]# ll
总用量 70004
drwxr-xr-x. 8 tomcat tomcat      127 420 13:38 examples
drwxr-xr-x. 5 root   tomcat       87 420 13:38 host-manager
-rw-r--r--. 1 root   root   71677863 420 15:28 jpress-v3.3.0.war
drwxr-xr-x. 5 root   tomcat      103 420 13:38 manager
drwxr-xr-x. 3 tomcat tomcat     4096 420 13:38 ROOT
drwxr-xr-x. 5 tomcat tomcat       86 420 13:38 sample

确保/usr/share/tomcat/webapps里有解压好的jpress的war包(jpress-v3.3.0)

[root@jpress ~]# cd /usr/share/tomcat/
[root@jpress tomcat]# ll
总用量 0
drwxr-xr-x. 2 root root   76 420 13:38 bin
lrwxrwxrwx. 1 root tomcat 11 420 13:38 conf -> /etc/tomcat
lrwxrwxrwx. 1 root tomcat 22 420 13:38 lib -> /usr/share/java/tomcat
lrwxrwxrwx. 1 root tomcat 15 420 13:38 logs -> /var/log/tomcat
lrwxrwxrwx. 1 root tomcat 22 420 13:38 temp -> /var/cache/tomcat/temp
lrwxrwxrwx. 1 root tomcat 23 420 13:38 webapps -> /var/lib/tomcat/webapps
lrwxrwxrwx. 1 root tomcat 22 420 13:38 work -> /var/cache/tomcat/work
[root@jpress tomcat]# cd  webapps
[root@jpress webapps]# ll
总用量 90248
drwxr-xr-x. 8 tomcat tomcat      127 420 13:38 examples
drwxr-xr-x. 5 root   tomcat       87 420 13:38 host-manager
drwxr-xr-x. 6 tomcat tomcat       86 420 15:28 jpress-v3.3.0
-rw-r--r--. 1 root   root   71677863 420 15:28 jpress-v3.3.0.war
-rw-r--r--. 1 root   root   20729792 420 15:33 jpress-web-newest.war
drwxr-xr-x. 5 root   tomcat      103 420 13:38 manager
drwxr-xr-x. 3 tomcat tomcat     4096 420 13:38 ROOT
drwxr-xr-x. 5 tomcat tomcat       86 420 13:38 sample

浏览器:ip+8080端口访问

在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 9
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值