Ubuntu安装tomcat,ubuntutomcat

Ubuntu安装tomcat,ubuntutomcat

1.从官方网站中下载apache-tomcat-**.tar.gz文件

2.在地头文件新建二个文本夹(tomcat),在文件夹中解压压缩包,
无需利用root:

tar -zxvf /home/xcx/下载/apache-tomcat-8.5.11.tar.gz 

3.进来解压文件中应用命令,将tomcat中的文件全体安装加多读写权限:

chmod +xr -R *
  1. 步向tomcat的conf文件夹下,找到tomcat-users.xml
    配置文件,在里边增多客户音讯

5.启用tomcat:

[email protected]:~/local/tomcat/apache-tomcat-8.5.11$ ./bin/startup.sh
Using CATALINA_BASE:   /home/xcx/local/tomcat/apache-tomcat-8.5.11
Using CATALINA_HOME:   /home/xcx/local/tomcat/apache-tomcat-8.5.11
Using CATALINA_TMPDIR: /home/xcx/local/tomcat/apache-tomcat-8.5.11/temp
Using JRE_HOME:        /usr/lib/jvm/java-8-oracle
Using CLASSPATH:       /home/xcx/local/tomcat/apache-tomcat-8.5.11/bin/bootstrap.jar:/home/xcx/local/tomcat/apache-tomcat-8.5.11/bin/tomcat-juli.jar
Tomcat started.
  1. 关闭tomcat:

    [email protected]:~/local/tomcat/apache-tomcat-8.5.11$ ./bin/shutdown.sh
    Using CATALINA_BASE: /home/xcx/local/tomcat/apache-tomcat-8.5.11
    Using CATALINA_HOME: /home/xcx/local/tomcat/apache-tomcat-8.5.11
    Using CATALINA_TMPDIR: /home/xcx/local/tomcat/apache-tomcat-8.5.11/temp
    Using JRE_HOME: /usr/lib/jvm/java-8-oracle
    Using CLASSPATH: /home/xcx/local/tomcat/apache-tomcat-8.5.11/bin/bootstrap.jar:/home/xcx/local/tomcat/apache-tomcat-8.5.11/bin/tomcat-juli.jar

 

1.从官方网址中下载apache-tomcat-**.tar.gz文件
2.在当守田件新建多个文本夹(tomcat),在文书夹中解压压缩包,
无需使用…

1.从官方网站中下载apache-tomcat-**.tar.gz文件

Linux下JDK和Tomcat安装

翻开情状变量
whereis java
which java (java实践路线)
echo $JAVA_HOME
echo $PATH

二,安装
选拔要设置java的任务,如/usr/目录下,新建文件夹java(mkdir java)

#mkdir -p /usr/java
拷贝下载的jdk-8u31-linux-x64.tar.gz到/usr/java下

#cd /usr/java
# tar -zxvf jdk-8u31-linux-x64.tar.gz

三、设置变量
# vim /etc/profile
在最后面增添如下内容:
# JAVA
JAVA_HOME=/usr/java/jdk1.8.0_31
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH

使变量生效
# source /etc/profile

证实是还是不是成功
# java -version
java version “1.8.0_31”
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

翻看变量
# which java //java推行路线
/usr/java/jdk1.8.0_31/bin/java
# echo $JAVA_HOME
/usr/java/jdk1.8.0_31
# echo $PATH
/usr/java/jdk1.8.0_31/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

四. 卸载jdk
·找到jdk安装目录的_uninst子目录
·在shell终端推行命令./uninstall.sh就能够卸载jdk。

五,安装tomcat
下载tomcat
wget

(1)解压apache-tomcat-8.0.20.tar.gz
# tar-zxvf apache-tomcat-8.0.20.tar.gz
(2)复制解压后的目录apache-tomcat-8.0.20到/usr/local下一视同仁命名字为tomcat8
# cp -Rapache-tomcat-8.0.20 /usr/local/tomcat8
专心:/usr/local/tomcat8就是前边我们要修改境况变量时须要填写的目录路线
(3)
加多tomcat情状变量
# vim /etc/profile
加盟下代码
#set environment variable
JAVA_HOME=/usr/java/jdk1.8.0_31
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
exportTOMCAT_HOME=/usr/local/tomcat8
exportCATALINA_HOME=/usr/local/tomcat8
修改应用境况变量,是布局生效
# source/etc/profile

(4)进入bin目录 ,启动tomcat
# cd/usr/local/tomcat8/
# cd bin/
#./startup.sh

(5)修改意况变量后再也开动tomcat运转成功
[[email protected]
bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat8
Using CATALINA_HOME: /usr/local/tomcat8
Using CATALINA_TMPDIR: /usr/local/tomcat8/temp
Using JRE_HOME: /usr/java/jdk1.8.0_31
Using CLASSPATH:
/usr/local/tomcat8/bin/bootstrap.jar:/usr/local/tomcat8/bin/tomcat-juli.jar
Tomcat started.

(6)关闭tomcat
[[email protected]
bin]# ./shutdown.sh
Using CATALINA_BASE: /usr/local/tomcat8
Using CATALINA_HOME: /usr/local/tomcat8
Using CATALINA_TMPDIR: /usr/local/tomcat8/temp
Using JRE_HOME: /usr/java/jdk1.8.0_31
Using CLASSPATH:
/usr/local/tomcat8/bin/bootstrap.jar:/usr/local/tomcat8/bin/tomcat-juli.jar

(7) 查看进程
[[email protected]
bin]# ps -ef | grep tomcat
root 22552 1 99 09:58 pts/0 00:00:05 /usr/java/jdk1.8.0_31/bin/java
-Djava.util.logging.config.file=/usr/local/tomcat8/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.endorsed.dirs=/usr/local/tomcat8/endorsed -classpath
/usr/local/tomcat8/bin/bootstrap.jar:/usr/local/tomcat8/bin/tomcat-juli.jar
-Dcatalina.base=/usr/local/tomcat8 -Dcatalina.home=/usr/local/tomcat8
-Djava.io.tmpdir=/usr/local/tomcat8/temp
org.apache.catalina.startup.Bootstrap start
root 22581 22284 0 09:58 pts/0 00:00:00 grep tomcat

(8)增加管理权限
暗中认可景况下,汤姆cat并没提供具有管理权限的账号,所以要求加上具备这种权力的账号。剧中人物manager-gui具备这种权力,但在系统客户调节文件tomcat-users.xml中并未安装那三种剧中人物和呼应的顾客,所以需求加上这种角色和客户,方法是展开tomcat-users.xml文件,增加如下内容:
<rolerolename=”manager-gui”/>
<userusername=”manager” password=”manager”roles=”manager-gui”/>
下一场重启汤姆cat服务器,文件修改生效。

查看情状变量 whereis java
which java (java实行路径) echo $JAVA_HOME echo $PATH 二,安装
选拔要设置java的地方,如/usr/目录下,…

2.在地点文件新建一个文本夹(tomcat),在文书夹中解压压缩包,
不要求使用root:

tar -zxvf /home/xcx/下载/apache-tomcat-8.5.11.tar.gz 

3.进来解压文件中应用命令,将tomcat中的文件全体装置增加读写权限: