上线代码有两种方式,第一种方式是直接将程序目录放在webapps目录下面,这种方式大家已经明白了,就不多说了。第二种方式是使用开发工具将程序打包成war包,然后上传到webapps目录下面。下面让我们见识一下这种方式。

系统环境

[root@tomcat ~]# getenforce
Disabled
[root@tomcat ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead) Jul 19 08:39:10 centos7 systemd[1]: Starting firewalld - dynamic firewall daemon...
Jul 19 08:39:11 centos7 systemd[1]: Started firewalld - dynamic firewall daemon.
Jul 19 11:20:50 git systemd[1]: Stopping firewalld - dynamic firewall daemon...
Jul 19 11:20:51 git systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@tomcat ~]# ip a|grep eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
inet 172.16.1.70/24 brd 172.16.1.255 scope global eth1
[root@tomcat ~]#

什么是JPress?

  JPress是一款和WordPress类似的程序,WordPress支持PHP语言,JPress则支持Java语言,更多关于JPress的介绍可以去JPress的官方网站查看:http://jpress.io/。JPress的安装包也可以在GitHub中下载:https://github.com/JpressProjects/jpress。也可以使用我提供的安装包:https://pan.baidu.com/s/1o8wSOQI 密码:8co8。

安装JPress

[root@tomcat webapps]# cd /application/tools/
[root@tomcat tools]# ll
total 194204
-rw-r--r-- 1 root root 8491533 Jul 20 2017 apache-maven-3.3.9-bin.tar.gz
-rw-r--r-- 1 root root 9128610 Jul 20 2017 apache-tomcat-8.0.27.tar.gz
-rw-r--r-- 1 root root 181238643 Jul 20 2017 jdk-8u60-linux-x64.tar.gz
[root@tomcat tools]# tar xf apache-maven-3.3.9-bin.tar.gz -C /application/
[root@tomcat tools]# ln -s /application/apache-maven-3.3.9 /application/maven
[root@tomcat tools]# sed -i.ori2 '$a export MAVEN_HOME=/application/maven\nexport PATH="$MAVEN_HOME/bin:$PATH"' /etc/profile
[root@tomcat tools]# source /etc/profile

检查是否安装成功:

[root@tomcat tools]# mvn -vsrsion
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /application/maven
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /application/jdk1.8.0_60/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-327.el7.x86_64", arch: "amd64", family: "unix"
[root@tomcat tools]#

上传JPress的war包:(在我提供的百度云盘链接中有),可以通过ftp或者rz等各种方式上传。

安装JPress:

[root@tomcat tools]# cd /application/tomcat/webapps/ROOT/
[root@tomcat ROOT]# mv index.jsp /tmp/
[root@tomcat ROOT]# jar xf /application/tools/jpress-web-newest.war
[root@tomcat ROOT]# ls
asf-logo.png bg-middle.png bg-upper.png meminfo.jsp robots.txt tomcat.css tomcat-power.gif
asf-logo-wide.gif bg-nav-item.png build.xml META-INF static tomcat.gif tomcat.svg
bg-button.png bg-nav.png favicon.ico RELEASE-NOTES.txt templates tomcat.png WEB-INF
[root@tomcat ROOT]#

开启一台mysql服务器,并创建对应的数据库和用户:

  这里我开启一台ip为172.16.1.51的MySQL服务器作为JPress的数据库支持,也可以在当前服务器自行安装MySQL。

[root@mysql-db01 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 112
Server version: 5.6.34-log Source distribution Copyright (c) 2000, 2016, 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> create database jpress;
Query OK, 1 row affected (0.00 sec) mysql> show create database jpress;
+----------+-----------------------------------------------------------------+
| Database | Create Database |
+----------+-----------------------------------------------------------------+
| jpress | CREATE DATABASE `jpress` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+-----------------------------------------------------------------+
1 row in set (0.00 sec) mysql>
mysql> grant all on jpress.* to jpress@"172.16.1.%" identified by '';
Query OK, 0 rows affected (0.00 sec) mysql>

  数据库和授权用户创建完毕。(这里我创建的数据库为jpress,用户名为jpress,密码为123456)。

网页上初始化JPress

  浏览器打开地址http://10.0.0.70:8080

  点击下一步:

  填写完相关信息,点击下一步:

  设置网站名称、管理员账号密码之后点击完成即可。如果等待一会儿,网页没有自动刷新,可以手动重启一次Tomcat即可。

  JPress后台登陆地址:http://10.0.0.70:8080/admin

  输入管理员账号密码即可跳转到后台管理界面:

  其实JPress跟WordPress的界面和操作非常相似,而且JPress比WordPress更加简洁,没有广告。

Tomcat安装JPress的更多相关文章

  1. jpress-配合nginx与tomcat安装

    目录 1. 前言 2. yum安装tomcat 2. yum安装MySQL 3. 下载JPress并安装 4. 配置tomcat使其可以部署多个网站 5. 安装nginx并配置 6. 将已经安装好的j ...

  2. Windows操作系统下tomcat安装版图文教程

    下载tomcat安装文件,官方下载地址是:http://tomcat.apache.org/,本文以tomcat-7.0.26版本为例进行安装过程的说明: 1.双击apache-tomcat-7.0. ...

  3. JavaWeb——tomcat安装及目录介绍

    一.web web可以说,就是一套 请求->处理->响应 的流程.客户端使用浏览器(IE.FireFox等),通过网络(Network)连接到服务器上,使用HTTP协议发起请求(Reque ...

  4. tomcat安装后,本地可以访问,远程不能访问

    问题描述:tomcat安装后,在本地可以使用本地IP地址.localhost可以访问,但是在远程却不能访问. 使用工具:无. 解决方法:关闭服务器端的"公用网络防火墙"即可.

  5. Windows下Java环境配置,tomcat安装

    问题描述:在Windows下面做Java web相关的项目的时候,Java和tomcat是基础,这里记载一下Java环境的配置以及tomcat的安装和配置. 使用工具:Windows.jdk安装包.t ...

  6. Linux搭建JDK、Tomcat安装及配置

    一.JDK安装及配置 1.JKD下载地址:http://pan.baidu.com/s/1i5NpImx 2.查看安装: rpm -qa | grep jdk 3.卸载:rpm -e --nodeps ...

  7. Win2008R2+java+tomcat安装

    Win2008R2+java+tomcat安装 准备软件: jdk-7u25-windows-x64.exe apache-tomcat-7.0.42-windows-x64.zip 一.安装java ...

  8. Tomcat安装配置

    Tomcat安装配置 很久没有通过博客对学习所得进行记录了. 现在将使用Tomcat的一些经验和心得写到这里,作为记录和备忘.如果有朋友看到,也请不吝赐教. 1.首先是Tomcat的获取和安装. 获取 ...

  9. CentOS7 Tomcat安装

    CentOS7 Tomcat安装 CentOS7 Tomcat安装 Download 从Tomcat下载apache-tomcat-8.0.18.tar.gz Install 安装 上传RPM文件到/ ...

随机推荐

  1. 100.64.0.0/10运营商级(Carrier-grade)NAT保留IP地址

    在一次跟踪路由的网络操作时发现自己路由器下一跳路由节点的IP地址比较奇怪,是100.64.0.1.好奇促使我查询了这个IP地址的归属,结果是保留地址,到这里觉得比较奇怪了,按照常理以IPv4为例保留的 ...

  2. ncbi API

    https://www.ncbi.nlm.nih.gov/sviewer/?db=nuccore&query_key=2&term=DYNLL2&page_size=1& ...

  3. python3.5+flask+mysql

    该篇博客配置环境为:python版本3.5,flask2.0,python3中已经不再支持MySQLdb模块,所有这里我用了pymysql,所有使用前应该 安装pymysql:pip install ...

  4. vs2010 安装 Ajax Control Toolkit

    Ajax Control Toolkit 7.1005.0 The Ajax Control Toolkit contains a rich set of controls that you can ...

  5. linux tcp调优

    Linux TCP Performance Tuning News Linux Performance Tuning Recommended Books Recommended Links Linux ...

  6. 2.redis配置

    转自:http://www.runoob.com/redis/redis-tutorial.html Redis 的配置文件位于 Redis 安装目录下,文件名为 redis.conf. 你可以通过  ...

  7. JSP页面中的时间显示问题

    在JSP页面中往往要将时间显示为指定格式的,如果传入的是Date类型很好解决 <fmt:formatDate value="${orderTime}" pattern=&qu ...

  8. Form表单标签的Enctype属性的作用及应用示例介绍

    Enctype :指定将数据回发到服务器时浏览器使用的编码类型.用于表单里有图片上传. 编码类型有以下三种: application/x-www-form-urlencoded: 在发送前编码所有字符 ...

  9. 【310】◀▶ Python 日期和时间

    参考: python 时间日期计算 Python 日期和时间(菜鸟教程) 8.1. datetime — Basic date and time types python中datetime模块中dat ...

  10. VS Code 在新Tabs打开文件

    添加如下设置即可 "workbench.editor.enablePreview": false