Showing posts with label tomcat. Show all posts
Showing posts with label tomcat. Show all posts

Friday, 1 July 2016

Several ports (8005, 8080, 8009) required by Tomcat Server at localhost are already in use


Several ports (8005, 8080, 8009) required by Tomcat Server at localhost are already in use

do : netstat -a -o -n

kill process id : taskkill /F /PID 6532

ref : stackoverflow

Saturday, 21 May 2016

Log file in tomcat.


1) catalina.log -- logs all the  log at the time of server start
2) localhost_access_log : logs all the request type and URI
ex :
a) 0:0:0:0:0:0:0:1 - - [21/May/2016:11:21:52 +0530] "GET /voice/p1x/network HTTP/1.1" 200 -
3) server.log : logs "ContainerBackgroundProcessor" info and error stack.
4) error.log : logs all the error stack
5) hostmamager.log :
6) manager.log : logs info about HTMLManager,manager,
ex : INFO: HTMLManager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost'
ex : INFO: HTMLManager: init: Global resources are available
ex : INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'

Tuesday, 26 April 2016

install tomcat on linux


install tomcat

go to /temp dir
sudo wget http://redrockdigimark.com/apachemirror/tomcat/tomcat-7/v7.0.69/bin/apache-tomcat-7.0.69.tar.gz

2) unzip file
tar xzf apache-tomcat-7.0.69.tar.gz

3) move the folder to tomcat7

mv apache-tomcat-7.0.69 /usr/local/tomcat7

4) start the tomcat server.
go to the ./bin/startup.sh

output :
cmd : ./bin/startup.sh
Using CATALINA_BASE:   /usr/local/tomcat7/apache-tomcat-7.0.69
Using CATALINA_HOME:   /usr/local/tomcat7/apache-tomcat-7.0.69
Using CATALINA_TMPDIR: /usr/local/tomcat7/apache-tomcat-7.0.69/temp
Using JRE_HOME:        /usr/java/jdk1.8.0_45/jre
Using CLASSPATH:       /usr/local/tomcat7/apache-tomcat-7.0.69/bin/bootstrap.jar:/usr/local/tomcat7/apache-tomcat-7.0.69/bin/tomcat-juli.jar
Tomcat started.

5) set up user account in conf/tomcat-users.xml.

<!-- user manager can access only manager section -->
<role rolename="manager-gui" />
<user username="manager" password="abc" roles="manager-gui" />

<!-- user admin can access manager and admin section both -->
<role rolename="admin-gui" />
<user username="admin" password="def" roles="manager-gui,admin-gui" />


6) change the port to 8082

go to conf/server.xml  and change the default port from 8080 t0 8082

 <Connector port="8082" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

7) connect to tomcat :
http://xx.xxx.xxx.xxx:8082/manager/html

Monday, 18 April 2016

jenkins tomcat 401 Unauthorized

jenkins tomcat 401 Unauthorized

org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username and password you provided are not correct (error 401)


tomcat 401 Unauthorized

You are not authorized to view this page. If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That file must contain the credentials to let you use this webapp.

org.codehaus.cargo.container.ContainerException: Failed to redeploy [/var/lib/jenkins/jobs/../..SNAPSHOT.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:189)

solution : goto tomcat "conf " directory and open tomcat-user.xml.

check two things.

1) uncomment below code

<tomcat-users>
<role rolename="manager-gui"/>
<user name="tomcat" password="s3cret" roles="standard,manager-gui"/>
</tomcat-users>

2) or add "standard" in the roles.

Saturday, 16 April 2016

start,stop tomcat server on linux

start tomcat server on linux

command : sudo service tomcat start

stop tomcat server on linux

command : sudo service tomcat start

Re-start tomcat server on linux

command : sudo service tomcat restart


Find Out Which Process Is Listening Upon a Port

check what port the tomcat server is using

use : netstat – a command-line tool that displays network connections, routing tables, and a number of network interface statistics.

ex : netstat -tulpn

REF: cybercitz

Friday, 15 April 2016

Know tomcat version on linux

Know tomcat version on linux

sudo rpm -qa | grep tomcat

output : tomcat-7.x.x.

Tuesday, 12 April 2016

org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]A child container failed during start

solution : clean the tomcat server on eclipse and restart the server.