上线代码有两种方式,第一种方式是直接将程序目录放在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. 判断字符串为空 为null

    str:string; delphi str.IsNullOrEmpty str.IsNullOrWhiteSpace TStringHelper for delphi only,c++ no use ...

  2. 推荐十几款Firefox web开发插件(转载)

    开发工具 Web Developer 1.1.8   https://addons.mozilla.org/en-US/firefox/addon/60by chrispederick The Web ...

  3. VUE+WebPack前端游戏设计:实现物体的拖拽动态特效

  4. 解剖Nginx·自动脚本篇(7)类型相关脚本系列

    1 auto/types/sizeof 该脚本的功能,是通过测试程序获知给定的ngx_type的大小. 1.1 显示提示信息 echo $ngx_n "checking for $ngx_t ...

  5. JS回调函数深入篇

    <有些错别字> 在Javascript中,函数是第一类对象,这意味着函数可以像对象一样按照第一类管理被使用.既然函数实际上是对象:它们能被“存储”在变量中,能作为函数参数被传递,能在函数中 ...

  6. Reveal CocoaPods的使用

    Reveal是配合开发者编辑各种用户界面参数一款工具,运行界面如下,模拟器和真机都支持. Reveal使用时中不需要添加其他代码,只需要ios工程加载Reveal.framework,如果是真机需要确 ...

  7. NodeJS - npm WARN package.json : No repository field:can not open package.json

    最近在研究node.js,在安装npm的时候发现了几个报错,瞬间蒙圈,查找文献基本解决(文献好少呀~  -.-)   一.报错:“can not open  path/path/package.jso ...

  8. jQuery开发者眼中的AngularJS

    文章来源:http://blog.jobbole.com/76265/ AngualrJS是一个很贴心的web应用框架.它有很不错的官方文档和示例:经过在现实环境中的测试著名的TodoMVC proj ...

  9. Window: move\copy\xcopy

    Move 移动文件和重命名文件与目录. 要移动一个或多个文件: MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination 要重命名目录: MO ...

  10. code1074 食物链

    开3*n的并查集,其中x用来连接与x同类的,x+n用来连接x吃的,x+2*n用来连接x被吃的. 1 x y时,如果 x吃y 或 x被y吃,那么为假话, 否则x与y同类,x吃的y也吃,x被吃的y也被吃: ...