Debugging logs for linux (tomcat jsp server configuration method)

Source: Internet
Author: User

 

In order to allow others to better understand the specific operation of a command, I would like to ask all of you to take your own steps on linux
The output is written to a log file so that others can perform the same operation easily. Here I want to expand
Home provides some logs by myself.
For example, tomcat installation and configuration, jdk installation configuration, WebSphere installation configuration, and mail configuration
DNS configuration. Route modification, Nic configuration. Disk mounting, partitioning, and formatting.
File Search, Java environment configuration compilation error handling analysis. C ++ compilation error handling analysis.
Write, and lilo configurations of makefile.
Hope you have any help. If you are in trouble, you can use netterm to flip the screen.

Root @ denet2 webapps] # tar xzvf *. gz
Jakarta-tomcat-4.0-m4 /.....
.....
[Root @ denet2 webapps] # Music jakarta-tomcat-4.0-m4
Jakarta-tomcat-4.0-m4 jakarta-tomcat-4.0-m4.tar.gz
[Root @ denet2 webapps] # mv jakarta-tomcat-4.0-m4/usr/local/tomcat
[Root @ denet2 webapps] # cd/usr/local/tomcat/
[Root @ denet2 tomcat] #
[Root @ denet2 tomcat] # cd bin/
[Root @ denet2 bin] # ls
Bootstrap. jar cpappend. bat jpappend. bat servlet. jar startup. bat
Catalina. bat jasper. bat jspc. bat shutdown. bat startup. sh
Catalina. sh jasper. sh jspc. sh shutdown. sh
[Root @ denet2 bin] #./startup. sh
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar
Touch:/usr/local/tomcat/bin/logs/catalina. out: No such file or directory
[Root @ denet2 bin] #./catalina. sh:/usr/local/tomcat/bin/logs/catalina. out: No such file or directory
Ls
Bootstrap. jar cpappend. bat jpappend. bat servlet. jar startup. bat
Catalina. bat jasper. bat jspc. bat shutdown. bat startup. sh
Catalina. sh jasper. sh jspc. sh shutdown. sh
[Root @ denet2 bin] #
[Root @ denet2 bin] # mkdir logs
[Root @ denet2 bin] #./startup. sh
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar
[Root @ denet2 bin] #

[Root @ denet2 bin] # ps-e extends grep java
[Root @ denet2 bin] #
[Root @ denet2 bin] #./startup. sh
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar
[Root @ denet2 bin] # ps-e extends grep java
[Root @ denet2 bin] # env restart grep CL
CLASSPATH =/usr/local/jdk/lib/tools. jar
[Root @ denet2 bin] # vi catalina. sh
... Start
Java $ CATALINA_OPTS-classpath $ CP-Djava. security. manager-Djava. security. policy = $ CATALINA_HOME/conf/catalina. policy-Dcatalina. home = $ CATALINA_HOME org. apache. catalina. startup. bootstrap "$ @" start >>$ CATALINA_HOME/logs/catalina. out 2> & 1 &

Echo "java $ CATALINA_OPTS-classpath $ CP-Djava. security. manager-Djava. security. policy = $ CATALINA_HOME/conf/catalina. policy-Dcatalina. home = $ CATALINA_HOME org. apache. catalina. startup. bootstrap "$ @" start >>$ CATALINA_HOME/logs/catalina. out 2> & 1 &"
Else
Java $ catalina_opts-classpath $ CP-dcatalina. home = $ catalina_home Org. apache. catalina. startup. bootstrap "$ @" Start >>$ catalina_home/logs/Catalina. out 2> & 1 &
Echo "Java $ catalina_opts-classpath $ CP-dcatalina. home = $ catalina_home Org. apache. catalina. startup. bootstrap "$ @" Start >>$ catalina_home/logs/Catalina. out 2> & 1 &"
............
[Root @ denet2 bin] #./startup. Sh
Using classpath:/usr/local/tomcat/bin/Bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/JDK/lib/tools. jar
Java-classpath/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar-Dcatalina. home =/usr/local/tomcat/bin org. apache. catalina. startup. bootstrap start>/usr/local/tomcat/bin/logs/catalina. out 2> & 1 &
[Root @ denet2 bin] #
[Root @ denet2 bin] # java-classpath/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar-Dcatalina. home =/usr/local/tomcat/bin org. apache. catalina. startup. bootstrap start
Couldn't find or load essential class 'java/lang/object' java. lang. NoClassDefFoundError java/lang/Object
Aborted (core dumped)
[Root @ denet2 bin] # which java
/Usr/bin/java
[Root @ denet2 bin] # which java-
/Usr/bin/java
/Usr/local/JDK/bin/Java
[Root @ denet2 bin] # chmod 000/usr/bin/Java
[Root @ denet2 bin] # which Java
/Usr/local/JDK/bin/Java

[Root @ denet2 bin] # Java-classpath/usr/local/tomcat/bin/Bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/JDK/lib/tools. jar-dcatalina. home =/usr/local/tomcat/bin Org. apache. catalina. startup. bootstrap start
Permission denied
[Root @ denet2 bin] # cp/usr/bin/Java/usr/bin/java_old
[Root @ denet2 bin] # cp/usr/local/JDK/bin/Java/usr/bin/Java
[Root @ denet2 bin] # which Java-
/Usr/bin/Java
/Usr/local/JDK/bin/Java
[Root @ denet2 bin] # java-classpath/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar-Dcatalina. home =/usr/local/tomcat/bin org. apache. catalina. startup. bootstrap start
[Root @ denet2 lib] # java
Error: can't find libjava. so.
[Root @ denet2 bin] # export PATH =/usr/local/jdk/bin: $ PATH
[Root @ denet2 bin] # java-classpath/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar-Dcatalina. home =/usr/local/tomcat/bin org. apache. catalina. startup. bootstrap start
[Root @ denet2 logs] # java-classpath/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar-Dcatalina. home =/usr/local/tomcat/bin org. apache. catalina. startup. bootstrap
Exception in thread "main" java. lang. NoClassDefFoundError: org/apache/catalina/startup/Bootstrap
[Root @ denet2 bin] # java-classpath/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar-Dcatalina. home =/usr/local/tomcat org. apache. catalina. startup. bootstrap start
Apache Tomcat/4.0-dev

[Root @ denet2 bin] # vi catalina. sh
...
TOMCAT_HOME =/usr/local/tomcat
If ["$ CATALINA_HOME" = ""]; then
# CATALINA_HOME = 'pwd'
CATALINA_HOME = $ TOMCAT_HOME
Fi
...
[Root @ denet2 bin] #./catalina. sh
[Root @ denet2 bin] #./startup. sh
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar
Java-classpath/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar-Dcatalina. home =/usr/local/tomcat
Org. apache. catalina. startup. Bootstrap start>/usr/local/tomcat/logs/catalina. out 2> & 1 &
[Root @ denet2 bin] #
[Root @ denet2 bin] # ps-e extends grep java
18058 tty2 00:00:07 java
[Root @ denet2 bin] # killall java
[Root @ denet2 bin] #./startup. sh
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar
Java-classpath/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar-Dcatalina. home =/usr/local/tomcat
Org. apache. catalina. startup. Bootstrap start>/usr/local/tomcat/logs/catalina. out 2> & 1 &
[Root @ denet2 bin] # ps-e extends grep java
18367 tty2 00:00:02 java
[Root @ denet2 bin] # lynx http: // localhost: 8080
[Root @ denet2 bin] # vi/etc/profile
.........
# Set JDK envrioment
Export JDK_HOME =/usr/local/jdk
Export CLASSPATH = $ JDK_HOME/lib/tools. jar
Export PATH = $ JDK_HOME/bin: $ PATH
Export JAVA_HOME = $ JDK_HOME

# Set TOMCAT enverionment
Export TOMCAT_HOME =/usr/local/tomcat
Export PATH = $ TOMCAT_HOME/bin: $ PATH
Export CLASSPATH = $ CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar
........
[Root @ denet2/root] # env implements grep PATH
CLASSPATH =/usr/local/jdk/lib/tools. jar:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar
PATH =/usr/local/tomcat/bin:/usr/local/jdk/bin:/usr/kerberos/bin:/sbin:/usr/bin: /usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin
[Root @ denet2/root] #

[Root @ denet2 bin] #./startup. sh
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar
Java-classpath/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar:/usr/local/jdk/lib/tools. jar-Dcatalina. home =/usr/local/tomcat
Org. Apache. Catalina. startup. Bootstrap Start>/usr/local/tomcat/logs/Catalina. out 2> & 1 &
[Root @ denet2 bin] # ps-E extends grep Java
18367 tty2 00:00:02 Java

[Root @ denet2 bin] # vi Catalina. Sh
.....
If [-F $ java_home/lib/tools. jar]; then
CP = $ CP: $ java_home/lib/tools. Jar
Fi
CP = $ classpath #/*** changed ***/
Echo using classpath: $ CP
........

... Start:

Elif ["$1" = "start"]; then

Shift
Touch $ catalina_home/logs/Catalina. Out
If ["$1" = "-Security"]; then
Echo using security manager
Shift
Java $ CATALINA_OPTS-classpath $ CP-Djava. security. manager-Djava. security. policy = $ CATALINA_HOME/conf/catalina. policy-Dcatalina. home = $ CATALINA_HOME org. apache. catalina. startup. bootstrap "$ @" start >>$ CATALINA_HOME/logs/catalina. out 2> & 1 &
Else
Java $ CATALINA_OPTS-classpath $ CP-Dcatalina. home = $ CATALINA_HOME org. apache. catalina. startup. bootstrap "$ @" start >>$ CATALINA_HOME/logs/catalina. out 2> & 1 &
Fi

...........

[Root @ denet2/root] # killall java; startup. sh
Using CLASSPATH:/usr/local/jdk/lib/tools. jar:/usr/local/tomcat/bin/bootstrap. jar:/usr/local/tomcat/bin/servlet. jar
[Root @ denet2/root] # ps-e extends grep java
18757 tty1 00:00:07 java
[Root @ denet2/root] # lynx http: // localhost: 8080

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.