user2854207
user2854207

Reputation:

how to start the tomcat server in linux?

i tried to install

   1.yum install -zxvf apache-tomcat-6.0.47.tar.gz then 
   2.  export TOMCAT_HOME=/home/mpatil/softwares/apache-tomcat-6.0.37
   3. [root@localhost mpatil]# echo $TOMCAT_HOME 
      /home/mpatil/softwares/apache-tomcat-7.0.47

while starting tomcat by using this command

   4.[root@localhost mpatil]# /startup.sh 
bash: /startup.sh: No such file or directory 

i don't know why it showing like this.

my file in

      5.[root@localhost mpatil]#  find /home -type f -name   apache-tomcat-6.0.37.tar.gz
/home/mpatil/Downloads/apache-tomcat-6.0.37.tar.gz

what i tried before this is is correct or not? --please tell me my question is how to start a tomcat server in linux.Please tell me..

Upvotes: 24

Views: 267822

Answers (8)

Du-Lacoste
Du-Lacoste

Reputation: 12777

To run Apache Tomcat server in Linux following ways can be used. Let me share the difference as well since I see some got confusions with the multiple ways Apache Tomcat Server can be started.

The catalina.sh is the main control script for Tomcat. Following are the multiple ways of running tomcat:

./catalina.sh run

Passing "run" argument for catalina.sh --> starts the Tomcat in the foreground and displays the running logs in the same console. when the console terminal is closed it will terminate the tomcat.

./catalina.sh start

Passing "start" argument for catalina.sh --> starts the Tomcat in the background. Since in background no issues closing down the terminal. The logs need to be viewed as below: tail -f $CATALINA_HOME/logs/catalina.out

./startup.sh 

The last way is firing the startup.sh to start your Tomcat server. If you Vi the script you can see it calls catalina.sh script passing start as the argument. This will be running in background as well.

Upvotes: 1

vinas
vinas

Reputation: 31

I know this is old question, but this command helped me!

Go to your Tomcat Directory
Just type this command in your terminal:

./catalina.sh start

Upvotes: 3

Jason
Jason

Reputation: 61

Use ./catalina.sh start to start Tomcat. Do ./catalina.sh to get the usage.

I am using apache-tomcat-6.0.36.

Upvotes: 6

user4890101
user4890101

Reputation:

Go to your Tomcat Directory with : cd/home/user/apache-tomcat6.0

  • sh bin/startup.sh.>> tail -f logs/catelina.out.>>

Upvotes: 1

Neeraj Gahlawat
Neeraj Gahlawat

Reputation: 1679

Go to the appropriate subdirectory of the EDQP Tomcat installation directory. The default directories are:

On Linux: /opt/server/tomcat/bin

On Windows: c:\server\tomcat\bin

Run the startup command:

On Linux: ./startup.sh

On Windows: % startup.bat

Run the shutdown command:

On Linux: ./shutdown.sh

On Windows: % shutdown.bat

Upvotes: 0

Anand Dwivedi
Anand Dwivedi

Reputation: 1500

cd apache-tomcat-6.0.43 ====: Go to Tomcat Directory 
sh bin/startup.sh   =====: Start the tomcat on Linux 
sh bin/shutdown.sh   ======:Shut Down the tomcat on Linux
tail -f logs/catelina.out ====: Check the logs  

Upvotes: 3

linux_fanatic
linux_fanatic

Reputation: 5167

The command you have typed is /startup.sh, if you have to start a shell script you have to fire the command as shown below:

$ cd /home/mpatil/softwares/apache-tomcat-7.0.47/bin
$ sh startup.sh 
or 
$ ./startup.sh 

Please try that, you also have to go to your tomcat's bin-folder (by using the cd-command) to execute this shell script. In your case this is /home/mpatil/softwares/apache-tomcat-7.0.47/bin.

Upvotes: 49

Omar Faroque Anik
Omar Faroque Anik

Reputation: 2609

if you are a sudo user i mean if you got sudo access:

      sudo sh startup.sh 

otherwise: sh startup.sh

But things is that you have to be on the bin directory of your server like

cd /home/nanofaroque/servers/apache-tomcat-7.0.47/bin

Upvotes: 5

Related Questions