tomcat does not start on linux - linux

This is what I have done so far
Downloaded tomcat 7
Installed Java
Set JAVA_HOME and CATALINA_HOME
Now I am running the startup.sh and it does nothing but display this
bash-4.1$ pwd
/scratch/user/Installs/apache-tomcat-7.0.42/bin
bash-4.1$ ./startup.sh
Using CATALINA_BASE: /scratch/user/Installs/apache-tomcat-7.0.42
Using CATALINA_HOME: /scratch/user/Installs/apache-tomcat-7.0.42
Using CATALINA_TMPDIR: /scratch/user/Installs/apache-tomcat-7.0.42/temp
Using JRE_HOME: /scratch/user/Installs/jdk1.7.0
Using CLASSPATH: /scratch/user/Installs/apache-tomcat-7.0.42/bin/bootstrap.jar:/scratch/user/Installs/apache-tomcat-7.0.42/bin/tomcat-juli.jar
What is missing here? Any pointers? All I want to do is install tomcat on this Linux box and deploy a simple application

I was able to resolve this issue after taking a look at the logs. Apparently, this is all that is displayed when the tomcat is started. I would expect something like "tomcat is running" which is not the case.

Related

Run a program as a service on Debian/Linux

I have an older jetty server I want to turn into as a service on a Debian OS. It should start automatic each time I restart the computer.
Manually I start the server with the two following commands:
root#myserver:/# cd /opt/jdk/jetty
root#myserver:/opt/jdk/jetty# java jetty
Anyone know how to do this ?
If you want to start any program on booting you can add that entry in rc.local.
java /opt/jdk/jetty/jetty
It will start on reboot

Where can I find the Tomcat 7 installation folder on Linux AMI in Elastic Beanstalk?

I have a elastic beanstalk linux-tomcat ami instance with the sample application installed and working off the public dns. I'm able to ssh into the
instance but cannot find where tomcat 7 lives (ie. the conf directory to edit server.xml). I've tried this with a 64 and 32 bit ami. Any ideas on where I might find this? I looked under:
/etc
/usr/share
I did find a elasticbeanstalk-tomcat7-deployment file under tmp (was empty).
I did a:
sudo yum install tomcat7
and the sample application is also being served up from :8080 and working on the public DNS. So I (think) have 2 tomcat servers running on the same beanstalk instance. In that case, I'm trying to find where the Tomcat 7 folders are (serving pages on port 80).
Since late 2012, it is usually under /usr/share/tomcat7.
Prior to that, it was usually found under /opt/tomcat7.
Not sure if this would be helpful. I am using a similar Amazon Linux AMI, which has tomcat7 living under /usr/share/tomcat7.
If tomcat is already running on your machine you can try:
ps -ef | grep tomcat
or
ps -ef | grep java
to check where it's running from.
If you want to find the webapp folder, it may be over here:
/var/lib/tomcat7/webapps/
But you also can type this to find it:
find / -name 'tomcat_version' -type d
Use "whereis" command.
$ whereis tomcat8 tomcat8: /usr/sbin/tomcat8 /etc/tomcat8
/usr/libexec/tomcat8 /usr/share/tomcat8
As of October 3, 2012, a new "Elastic Beanstalk for Java with Apache Tomcat 7" Linux x64 AMI deployed with the Sample Application has the install here:
/etc/tomcat7/
The /etc/tomcat7/tomcat7.conf file has the following settings:
# Where your java installation lives
JAVA_HOME="/usr/lib/jvm/jre"
# Where your tomcat installation lives
CATALINA_BASE="/usr/share/tomcat7"
CATALINA_HOME="/usr/share/tomcat7"
JASPER_HOME="/usr/share/tomcat7"
CATALINA_TMPDIR="/var/cache/tomcat7/temp"
Following environment variables worked for me on Debian Wheezy 7 and Tomcat 7:
CATALINA_HOME=/usr/share/tomcat7
CATALINA_BASE=/var/lib/tomcat7
CATALINA_TMPDIR=/tmp/tomcat7
(I did create /tmp/tomcat7 manually)
As of 6-6-15 the Web Root location is at /tmp/deployment/application/ROOT using Tomcat.
My server is CentOS 7, and I install tomcat by:
sudo yum install tomcat
sudo yum install tomcat-webapps tomcat-admin-webapps
I found my webapps folders in:
/usr/share/tomcat/
and
/var/lib/tomcat/
In my case on Ubuntu 16.04 server, and default tomcat installation it's under:
/var/lib/tomcat8

Tomcat Server fails when startup in Linux

Getting below exception while executing startup.sh for Tomcat. How is this caused and how can I solve it?
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
I'm using RedHat Linux, tomcat version is 6.0.26
When I use java simply I face the same exception.
I set the JAVA_HOME and path varaible in /etc/profile as
JAVA_HOME=/usr/java/jdk1.6.0_30
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
look at this blog
This is probably java configuration issue.
Make sure JAVA_HOME is setup correctly
Can you post output of this command?
java -version
Are you able to run any other java app? Or problem just with tomcat?

installing grails in linux

I am new to using Linux. I installed grails by setting env variable GRAILS_HOME and added ot to PATH variable. I also exported both and when I typed in grails command.. It worked fine. When I closed that terminal session and opened a another new session, all the env variables that I had set up has all gone.
I was wondering how to have them available for all sessions.
Any help is appreciated
Thanks
Edit the .bashrc file of the user launching Grails.
Add the same lines as your commands:
GRAILS_HOME=/home/of/grails
export GRAILS_HOME
PATH=$PATH:$GRAILS_HOME/bin
you need to add $GRAILS_HOME/bin to the PATH (rather than $GRAILS_HOME)
Update
The best way to install Grails on Linux/Mac is to use GVM.
GVM is a tool for managing parallel Versions of multiple Software Development Kits on most Unix based systems. It provides a convenient command line interface for installing, switching, removing and listing Candidates.
In addition to Grails, you can also use GVM to manage your installation of
Groovy
Griffon
Gradle
vert.x
If you have an Ubuntu (or equal) installation. You could add a repository to it. It should do all the stuff for you:
sudo add-apt-repository ppa:groovy-dev/grails
sudo apt-get update
sudo apt-get install grails
you need to set them under ~/.bashrc file and then type source ~/.bashrc in your terminal so you don't have to close and re-open it again.
In /etc/profile.d/ create a script name grails.sh:
export GRAILS_HOME=/opt/grails
export PATH=$GRAILS_HOME/bin:$PATH
Change /opt/grails to where you unzipped grails.
This will make it available for all users.
If you are on ubuntu define the GRAILS_HOME variable with its installation path in /etc/environment and edit the system path variable as shown in second line
GRAILS_HOME=/opt/grails
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/grails2/bin:"
Groovy Grails Installation:
Before starting up install JAVA on linux system
Check java version using command
$> java -version
Install grails on Linux using Installing-a-grails-development-environment-on-linux
Before installing grails will need to install GVM (Grails version manager) from GVM Tool Installation
After installation of GVM from the above link, we will be able to run Grails sample application. Check it out with command
$> grails -version
Check Environment variable is set or not for Java as well as Grails with command
$> printenv
Create demo application and run the server for Grails using:
$> grails create-app demo
Go to path
$> cd demo/
Run the server
$> grails run-app
Run the server on specific port 9090
$> grails run-app -Dserver.port=9090
Tools and running environment set up for Groovy Grails:
Install GGTS (Groovy Grails Tool Suit) using GGTS with Eclipse IDE and tool
Select Eclipse package on linux from the above link:
YouTube Video Tutorial:
All Grails documentation video tutorials for the installations and running sample application is present here YouTube Channel

Apache Tomcat server on linux

I have installed java and tomcat appache server on linux.
When i am going to start tomcat using ./startup.sh command on linux server,
it gives output as
Using CATALINA_BASE: /usr/src/apache-tomcat-5.5.28
Using CATALINA_HOME: /usr/src/apache-tomcat-5.5.28
Using CATALINA_TMPDIR: /usr/src/apache-tomcat-5.5.28/temp
Using JRE_HOME: /usr/src/jdk1.6.0_16
Using CLASSPATH: /usr/src/apache-tomcat-5.5.28/bin/bootstrap.jar
but server is not started.
after that when i am firing javac command ,it generates following error
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
i am not getting the right reason for that.
I am new with linux.
Please help me.
Thanks in advance
Could not reserve enough space for object heap.
Looks like there is not enough memory given for the initialisation.
Check the given memory...and reconfigure your memory size for the JVM.

Resources