Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Tomcat configuration

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Tomcat configuration

Jdk and tomcat do not need to be compiled.

Tomcat does not support restart

jdk official website www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html

Java programs cannot be compiled without jdk

tomcat official website tomcat.apache.org/

jdk in other words java, equivalent to php in lamp

Tomcat is apache.

1. install the JDK

cd /usr/local/src

wget'http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-i586.tar.gz? AuthParam=1466748694_4fba144996aad848aa5ee7344c94ad2e'

tar -zxvf jdk-8u77-linux-i586. gz//file names may vary

mv jdk1.8.0_77 /usr/local/

vim /etc/profile.d/java.sh

Add content:

JAVA_HOME=/usr/local/jdk1.8.0_77

JAVA_BIN=/usr/local/jdk1.8.0_77/bin

JRE_HOME=/usr/local/jdk1.8.0_77/jre

CLASSPATH=/usr/local/jdk1.8.0_77/jre/lib:/usr/local/jdk1.8.0_77/lib:/usr/local/jdk1.8.0_77/jre/lib/charsets.jar

PATH=/usr/local/jdk1.8.0_77/bin:/usr/local/jdk1.8.0_77/jre/bin:$PATH

//Put $PATH at the end of the line to ensure that the first java found is installed by yourself

source /etc/profile.d/java.sh

java -version

//display your own installed version is OK

2. Install tomcat

cd /usr/local/src

wget'http://apache.fayea.com/tomcat/tomcat-7/v7.0.70/bin/apache-tomcat-7.0.70.tar.gz'

tar -zxvf apache-tomcat-7.0.70.tar.gz

mv apache-tomcat-7.0.70 /usr/local/tomcat

cp /usr/local/tomcat/bin/catalina.sh.d/tomcat /copy startup script

vim /etc/init.d/tomcat

Add content:

#chkconfig: 2345 63 37

. /etc/init.d/functions

JAVA_HOME=/usr/local/jdk1.8.0_91

CATALINA_HOME=/usr/local/tomcat

chkconfig --add tomcat

chkconfig tomcat on

/etc/init.d/tomcat start

Enter 192.168.134.137:8080 in the browser to see the tomcat welcome page

Tomcat configuration

vim /usr/local/tomcat/conf/server.xml

8080 modified 80 //tomcat indicates comment

Add Virtual Host

//immediately above, where docBase="./ "is relative to appBase="/data/tomcatweb"

The requested URL/data/tomcatweb /tomcat was not found on this server.

/etc/init.d/tomcat stop

The requested URL/etc/init.d/tomcat/was not found on this server.

vim /data/tomcatweb/1.jsp

Add content:

Now time is:

curl -xlocalhost:80 www.111.com/1.jsp

display

Now time is: Sat Jun 25 21:25:18 CST 2016

//indicates tomcat configuration successfully

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report