Centos5.3yum install Tomcat Java

Source: Internet
Author: User
I installed tomcat and jiava with yumintalltomcat5 today. So where is tomcat installed? How to Start tomcat? How can I deploy my own website in Linux? With the above three questions, we began to explore. First, let's go to the/usr/bin directory and check ,...

Today, tomcat and jiava are installed with yum intall tomcat5, so where is tomcat installed? How to Start tomcat? How can I deploy my own website in Linux? With the above three questions, we began to explore.
First, go to the/usr/bin directory and check whether there is anything about tomcat.
Cd/usr/bin
In this directory, we can find an executable file called Tomcat 5. now we can execute this file.
Run the following command: tomcat:
Found JAVA_HOME:/usr/bin /..
Please complete your/etc/tomcat5/tomcat5.conf so we won't have to look for it next time
Using CATALINA_BASE:/usr
Using CATALINA_HOME:/usr
Using CATALINA_TMPDIR:/usr/temp
Using JRE_HOME:
Usage: dtomcat5 (commands ...)
Commands:
Debug Start Catalina in a debugger
Debug-security Debug Catalina with a security manager
Jpda start Start Catalina under JPDA debugger
Run Start Catalina in the current window
Run-security Start in the current window with security manager
Start Start Catalina in a separate window
Start-security Start in a separate window with security manager
Stop Stop Catalina
Stop-force Stop Catalina (followed by kill-KILL)
Version What version of tomcat are you running?
No matter what the mess is.
Go to/etc/init. d/to see if there is anything about tomcat.
Cd/etc/init. d/
In this directory, we will also find an executable file called tomcat 5, which truly manages tomcat startup and shutdown. type the following command:
/Etc/init. d/tomcat5 start
At this time, you will get the following prompt:
Starting tomcat5: [OK]
This indicates that Tomcat 5 has been started.
In this case, you can check the ports opened in the system service and enter the following command:
Netstat-nat
We can see that port 8080 is in the listening status and the local address is 127.0.0.1. This indicates that Tomcat 5 has been started successfully!
Okay. open the browser and type http: // 127.0.0.1: 8080 in it. The result is a blank page (not a page for failed connection). why? After tomcat is installed in Windows, the welcome page for tomcat appears immediately after you type the above address! In fact, after tomcat is installed in windows, the welcome page (index. jsp) has been installed, but these items have been removed from tomcat that comes with centos. Now let's look for the webapps directory we really want to see. Go to the following Directory:
Cd/var/lib
In this directory, we will see a directory named tomcat5. enter this directory and perform the following operations:
Cd tomcat5
Ll
We will see the following information:
Drwxr-xr-x 6 root 4096 05-28 12:36 common
Drwxr-xr-x 4 root 4096 05-28 server
Drwxr-xr-x 4 root 4096 05-28 12:36 shared
Drwxrwxr-x 3 root tomcat 4096 05-28 webapps
Okay. isn't the last webapps directory we are looking?
In this directory, there is nothing in it? It's no wonder that after we started Tomcat 5, we couldn't see anything in the browser? So I copied the ROOT directory under the windows directory to webapps, and entered http: // 127.0.0.1: 8080/in the browser to see the welcome interface of tomcat.
In fact, after tomcat is installed by default, centos only uses/var/lib/tomcat5 as the Directory for deploying applications. to set the tomcat server, you must find its installation directory, at least we should know the server. where is the xml file? Some people on the Internet say they want to enter the/usr/share/tomcat5 Directory. we will find that the/usr/share directory does not exist at all. In fact, Fedora8 has put all the configuration files of tomcat5 under the/etc/tomcat5/Directory. in this directory, you can find all the configuration files about tomcat5.
Finally, let's sort out the ideas: after centos yum installs tomcat, it will separately put the configuration file under the/etc/directory, because the/etc directory is the directory where the Linux operating system stores system configuration files! Then, it stores the files related to the user application in the/var/lib directory. This is quite different from what we are used to in Windows. in the user's opinion, the next software in Windows is under a Directory (in fact, this is not the case in the system), so we feel convenient, but this definitely hinders our understanding of the true nature of the software.
 

From: Tenhlf blog

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.