linux install tomcat

Install Tomcat7 on Ubantu14.04!

In Java web development, most of them use the tomcat server, and most companies use the linux system to deploy the server. The following is the detailed process of installing tomcat under the linux system.

The first step, first we have to go to the tomcat official website to download apache-tomcat-7.0.59.tar.gz, of course, there is also tomcat8 now, all the same, the instructions are in order to demonstrate this process.


After downloading the server software, we have to unzip it.

The second step is to decompress the downloaded apache-tomcat-7.0.5.tar.gz into a folder and rename it to tomcat7

To unzip the file package, a user with administrator privileges is required. I usually switch the user directly to root,

: Sudo tar zxvf apache-tomcat-7.0.5.tar.gz

(named tomcat7) sudo mv apache-tomcat-7.05 tomcat7

After decompression, the configuration file in tomcat needs to be written, so remember to modify the permissions, chmod 777 file.


The third step is to configure environment variables

tomcat7 needs to configure the environment in two places. Open a terminal and do the following:

         1) Open the system configuration file, add environment variables, note that jdk must be installed before running tomcat


          $:sudo gedit /etc/profile


         At this time, the system environment configuration file is opened, and the following sentences are added after the file:


          export CLASSPATH=$CLASSPATH:%JAVA_HOME/lib/tools.jar

          export TOMCAT_HOME=/usr/tomcat7/apache-tomcat-7 //The directory decides by yourself

          export CATALINA_HOME=$TOMCAT_HOME

          export PATH=$PATH:$TOMCAT_HOME/bin


         Save and exit.


         2) Enter the bin directory in the decompressed folder of tomcat7


         $:cd /usr/tomcat7/apache-tomcat-7 /bin

         $:sudo gedit catalina.sh


         At this time, tomcat7's own configuration file is opened. We find the sentence cygwin=false and add it above this sentence:


         JAVA_HOME=/usr/lib/jvm/jdk1.7

Save and exit.
The fourth step, run tomcat7

         Enter the bin directory of tomcat and execute the following statement:

         The command to start tomcat:


         $sudo ./startup.sh


         Command to close tomcat:


         $sudo ./shutdown.sh
Step 5, check whether tomcat7 is running

         $: ps -ef|grep tomcat

         If there is a tomcat process, it is running.


Open the browser, enter: http://localhost:8080 in the address bar , if the tomcat7 page appears, congratulations, the installation is successful!

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326690755&siteId=291194637