[svc]jdk+tomcat部署.jforum论坛部署

安装jdk和tomcat

jdk1.7.0_13(系列)下载url
我这里用的最新的jdk.

  • 去官网下载即可
cd /usr/local/src/
tar xf jdk-8u162-linux-x64.tar.gz -C /usr/local/
ln -s /usr/local/jdk1.8.0_162 /usr/local/jdk
tar xf apache-tomcat-8.5.29.tar.gz -C /usr/local/
ln -s /usr/local/apache-tomcat-8.5.29 /usr/local/tomcat- 查看目录/usr/local
[root@n1 local]# ls -ld jdk* *tomcat*
drwxr-xr-x 8   10  143 255 Dec 20 13:27 jdk1.8.0_162
lrwxrwxrwx 1 root root  23 Mar 14 09:15 jdk -> /usr/local/jdk1.8.0_162
drwxr-xr-x 9 root root 160 Mar 14 09:14 apache-tomcat-8.5.29
lrwxrwxrwx 1 root root  31 Mar 14 09:15 tomcat -> /usr/local/apache-tomcat-8.5.29
  • 添加path
sed -i.ori '$a export JAVA_HOME=/usr/local/jdk\nexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH\nexport CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar' /etc/profile
echo 'export TOMCAT_HOME=/usr/local/tomcat'>>/etc/profilesource /etc/profile

export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar
export TOMCAT_HOME=/usr/local/tomcat
[root@n1 ~]# java -version
java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)- 启动tomcat
[root@n1 tomcat]# /usr/local/tomcat/bin/catalina.sh start
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/jdk
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
[root@n1 tomcat]# netstat -ntulp|grep java
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      1277/java           
tcp        0      0 127.0.0.1:8005          0.0.0.0:*               LISTEN      1277/java           
tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN      1277/java

806469-20180314092122348-275563336.png

一键jdk+tomcat部署脚本(jdk和tomcat放到/usr/local/src)

cd /usr/local/src/
tar xf jdk-8u162-linux-x64.tar.gz -C /usr/local/
ln -s /usr/local/jdk1.8.0_162 /usr/local/jdk
tar xf apache-tomcat-8.5.29.tar.gz -C /usr/local/
ln -s /usr/local/apache-tomcat-8.5.29 /usr/local/tomcatsed -i.ori '$a export JAVA_HOME=/usr/local/jdk\nexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH\nexport CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar' /etc/profile
echo 'export TOMCAT_HOME=/usr/local/tomcat'>>/etc/profile
source /etc/profile/usr/local/tomcat/bin/catalina.sh start
sleep 3
ls -ld /usr/local/jdk* /usr/local/*tomcat*
java --version
netstat -ntulp|grep java
curl -I 192.168.14.11:8080

部署app,以java的开源论坛jforum为例

抽时间也可以部署下jpress,国人写的.部署方法

806469-20180314092240502-751751332.png

  • 默认部署会报错,导致安装失败, 提前解决下
    本质上是因为sql问题,将每句的TYPE=InnoDB去掉即可.
Query being executed when exception was thrown: CREATE TABLE jforum_banlist ( banlist_id INT NOT NULL auto_increment, user_id INT, banlist_ip varchar(15), banlist_email varchar(255), PRIMARY KEY (banlist_id), INDEX idx_user (user_id), INDEX (banlist_ip), INDEX (banlist_email)) TYPE=InnoDB 
CREATE TABLE jforum_banlist ( banlist_id INT NOT NULL auto_increment, user_id INT, banlist_ip varchar(15), banlist_email varchar(255), PRIMARY KEY (banlist_id), INDEX idx_user (user_id), INDEX (banlist_ip), INDEX (banlist_email)) TYPE=InnoDB" 

806469-20180314092710889-1426268602.png

806469-20180314092809988-1072744696.png

  • 修改好后,压缩,上传,解压.
tar xf jforum-2.1.9.tar.gz -C /usr/local/tomcat/webapps/
cd /usr/local/tomcat/webapps/
mv jforum-2.1.9 jforum/usr/local/tomcat/bin/catalina.sh stop
/usr/local/tomcat/bin/catalina.sh start
  • 部署mysql
docker run  \
-p 3306:3306 \
-v /data/mysql:/var/lib/mysql \
-v /etc/localtime:/etc/localtime \
--name mysql5 \
--restart=always \
-e MYSQL_ROOT_PASSWORD=123456 \
-d mysql:5.6.23 --character-set-server=utf8 --collation-server=utf8_general_ci- 建库
mysql> create database jforum;
  • 安装jforum

访问http://192.168.14.11:8080/jforum/install.jsp
806469-20180314093612720-1477121896.png
806469-20180314093726370-141557344.png
806469-20180314093734376-801945904.png
自此部署form论坛完成.

自此体验了一把jdk+tomcat的一个app的部署. 后面会整理下tomcat这个动态应用的基础知识和优化.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/278302.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ipad和iphone切图_如何从iPhone和iPad上的Mail应用程序删除电子邮件帐户

ipad和iphone切图Nicole Lienemann/Shutterstock妮可利尼曼(Nicole Lienemann)/ ShutterstockWhen you add your Google account to your iPhone or iPad in the Settings app, you’re adding your Gmail account to the Mail app. If you prefer to use third-party email cl…

使用nmcli 实现 bond0 网络组 网桥三种模式

使用nmcli 实现 bond 网络组 网桥模式 bond0(负载均衡) step1:创建一个bond0的主属nmcli connection add con-name bond0 type bond ifname bond0 mode active-backup 之所以不为绿色是因为还没有创建从属,这个bond0相当于一个虚拟…

RabbitMQ是如何运转的?

前言 之前已经介绍了RabbitMQ交换机模型的相关简单概念,都是作为此篇的基础铺垫,如果对此篇不懂的可以先看我上一篇的介绍认识RabbitMQ交换机模型,或者联系评论,分享《RabbitMQ实战指南》电子书给大家,里面虽然有些许错…

如何种植屡获殊荣的青豆

Most people don’t know this yet, but I’ve decided to give up computers and become a farmer instead. Since I’m the helpful type, I’ve decided to share everything I know about farming with you, starting with how I won my prize winning green beans. 大多数…

充分利用Microsoft Planner的6种方法

Microsoft Planner is pretty simple to use, but some of its more useful features aren’t front and center. If you’re just creating and moving tasks, here are six ways to get a bit more out of Planner. Here’s everything you need to know. Microsoft Planner的…

最详细的排序解析,理解七大排序

最详细的排序解析,理解七大排序 mp.weixin.qq.com点击上方“方志朋”,选择“置顶或者星标” 你的关注意义重大! 注: lgN在这里为1og2N简写 为了方便描述,本文默认用int类型比较,从小到大排序 本文排序算法以java语言…

xp删除管理员账户_在Windows XP中从登录屏幕删除用户帐户

xp删除管理员账户So you login to your computer every single day, but there’s more than one account to choose from… either because you got the computer from somebody else, or some software package added a user account that you really don’t want to see. So…

Pycharm下将py文件打包成exe文件

1. 在PyCharm下安装PyInstaller 1. 首先,打开自己要发布的工程 2. 点击底部的【Terminal】打开终端,中输入命令pip install pyinstaller后回车,如图所示进行安装 3. 输入命令 pyinstaller,回车显示安装成功 4. 输入命令 pyinstall…

什么是自然语言处理,它如何工作?

NicoElNino/Shutterstock.comNicoElNino / Shutterstock.comNatural language processing enables computers to process what we’re saying into commands that it can execute. Find out how the basics of how it works, and how it’s being used to improve our lives. 自…

GIT速查手册

为什么80%的码农都做不了架构师?>>> 一、GIT 1.1 简单配置 git是版本控制系统,与svn不同的是git是分布式,svn是集中式 配置文件位置 # 配置文件 .git/config 当前仓库的配置文件 ~/.gitconfig 全局配置文件# 查看所有配置项 git …

4-3逻辑非运算符及案例 4-4

创建类 LoginDemo3 这里取反 !(n%30) package com.imooc.operator; import java.util.Scanner;public class LoginDemo3 {public static void main(String[] args) {// TODO Auto-generated method stubSystem.out.println("请输入一个整数");Scanner scnew Scanner(…

assistant字体_如何使用Google Assistant设置和致电家庭联系人

assistant字体Google谷歌Google Home and Nest smart speakers and displays allow you to make calls without using your phone. By setting up “Household Contacts,” anyone in your home can easily call friends and family members with Google Assistant-enabled dev…

Accoridion折叠面板

详细操作见代码&#xff1a; <!doctype html> <html><head><meta charset"UTF-8"><title></title><meta name"viewport" content"widthdevice-width,initial-scale1,minimum-scale1,maximum-scale1,user-scal…

skype快捷键_每个Skype键盘快捷键及其用法

skype快捷键Roberto Ricca/Shutterstock罗伯托里卡/ ShutterstockGet familiar with Skype’s unique keyboard shortcuts that will allow you to quickly change your settings, alter your interface, and control your communications. Use these hotkeys and become a Sky…

YouTube键盘快捷键:速查表

Google’s video website wouldn’t be complete without all sorts of useful buttons and hidden commands that aren’t immediately obvious. Use this hotkey cheat sheet to quickly navigate YouTube and gain better control over your video browsing experience. 如果…

MySQL服务读取参数文件my.cnf的规律研究探索

在MySQL中&#xff0c;它是按什么顺序或规律去读取my.cnf配置文件的呢&#xff1f;其实只要你花一点功夫&#xff0c;实验测试一下就能弄清楚&#xff0c;下面的实验环境为5.7.21 MySQL Community Server。其它版本如有不同&#xff0c;请以实际情况为准。 其实&#xff0c;MyS…

将组策略编辑器添加到控制面板

If you find yourself using the Group Policy Editor all the time, you might have wondered why it doesn’t show up in the Control Panel along with all the other tools. After many hours of registry hacking, I’ve come up with a registry tweak to let you do ju…

Exchange Server 2016管理系列课件50.DAG管理之激活数据库副本

激活邮箱数据库副本是将特定被动副本指定为邮箱数据库的新主动副本的过程。我们将此过程称为数据库切换。数据库切换过程是指卸除当前的活动数据库&#xff0c;然后在指定的服务器上将相应的数据库副本作为新的活动邮箱数据库副本进行装载。成为活动邮箱数据库的数据库副本必须…

常见设计模式 (python代码实现)

1.创建型模式 单例模式 单例模式&#xff08;Singleton Pattern&#xff09;是一种常用的软件设计模式&#xff0c;该模式的主要目的是确保某一个类只有一个实例存在。当你希望在整个系统中&#xff0c;某个类只能出现一个实例时&#xff0c;单例对象就能派上用场。 比如&#…

记录一次解决httpcline请求https报handshake_failure错误

概述 当使用httpclinet发起https请求时报如下错误&#xff1a; javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failureat com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)at com.sun.net.ssl.internal.ssl.Alerts.getSSLExcep…