Posted by Rishikesh Vispute
Categories: Tomcat
What is WEB-INF directory ? The WEB-INF directory is for your default Web application and is located under your home directory. You can also create other Web applications by creating subdirectories under your home directory and create a WEB-INF directory under it, or you can upload a war file in the home directory. The war [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
What is Tomcat? Tomcat is Java driven Web Application Server which Provides support for Java web applications. ie. JSP technologies. -WAR (Web Application aRchive) files – Has a self-contained HTTP server CATALINA_HOME /usr/local/jakarta/tomcat CATALINA_BASE /usr/local/jakarta/tomcat JAVA_HOME ( The path to the JDK ) JAVA_HOME=/usr/local/jdk Logs : /usr/local/jakarta/tomcat/logs/catalina.out tail -f /usr/local/jakarta/tomcat/logs/catalina.out | egrep domain.com By default, [ Read More ]
disable directory listing,Tomcat + cpanel,web.xml file,tomcat,cpanel,index.jsp
Error: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context Solution : When I have access site in browser then catalina.out logs show the above error and the database is not connected , I have tried all of the possibilities but this issue is sorted with following solution. I have moved the mysql-connector-java-*.jar file from [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
What is appbase and docbase ? Ans : appBase : The Application Base directory for this virtual host. This is the path-name of a directory that may contain web applications to be deployed on this virtual host. You may specify an absolute path name for this directory, or a path name that is relative to [ Read More ]
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
If domain does not points to the server and you want to access .jsp pages by using the temporary URL (ex: http://domain.com/~username ) Solution: Add the following code in server.xml file under the virtual host entry for any domain. <Listener className=”org.apache.catalina.startup.UserConfig” directoryName=”public_html” homeBase=”/home” userClass=”org.apache.catalina.startup.HomesUserDatabase”/> For example : Web files would need to be in directories [ Read More ]
How to install tomcat 6 on the linux server ? When you have installed tomcat by using Easy-Apache then it installed Tomcat 5.5 and if you want to installed Tomcat 6.0 then you need to made some necessary changes on the server. 1) First install Tomcat 5 by using Easy-Apache means java is also installed [ Read More ]
How to start/stop tomcat by using ” /etc/init.d/tomcat” command. Ans : 1) Check linux server run level by using following command who -r If runlevel is 3 then create the file vi /etc/rc.d/init.d/tomcat and add the following code ==================================== #!/bin/sh JAVA_HOME=/usr/local/jdk; export JAVA_HOME TOMCAT_HOME=/usr/local/jakarta/tomcat; export TOMCAT_HOME $TOMCAT_HOME/bin/catalina.sh $* ==================================== Save the file and then change [ Read More ]
Installing the JavaFX SDK on Ubuntu Linux or OpenSolaris Access the URL http://java.sun.com/javafx/downloads/ and Download JavaFX 1.2.3 SDK for Linux platformon your local machine And Upload by using ftp or file manager under the /usr/local directory cd /usr/local chmod a+x javafx_sdk-1_2-linux-i586.sh sh javafx_sdk-1_2-linux-i586.sh Then it ask the yes or no then enter the “yes” means [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
How to include file in the .jsp pages : <%@ include file=”footer.jsp” %>
Database Connection by using jsp page . The URL based mysql connection is ================================= jdbc:mysql://serverip address/DATABASENAME?user=USERNAME&password=PASSWORD ================================= OR ================================= <!– Database connection settings –> <property name=”connection.driver_class”>com.mysql.jdbc.Driver</property> <property name=”connection.url”>jdbc:mysql://localhost/database_name</property> <property name=”connection.username”>databses_user</property> <property name=”connection.password”>password</property> <!– configuration pool via c3p0–> ================================= OR ================================= try { Class.forName(“com.mysql.jdbc.Driver”).newInstance(); // here we are connecting to localhost, port 3306. Change it to [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
Enable HTTPS on Tomcat If you are looking to enable HTTPS in Tomcat first thing you will have to do is generating a server certificate for your website. A key tool command which comes with your JRE( Java Runtime Environment). Open a command shell which should know how to find your Java runtime environment properly. [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
How to check JSP and Tomcat version ? You can easily check the JSP version. You need to create test.jsp page under your account and add the following code into that file and access the test.jsp page by using browser ” http://domainname/test.jsp ” then it shows the tomcat version ,JSP version and servlet version. ================== [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
Error : All domains shows the tomcat default page Solution: The problem I get is that all requests now are being sent to tomcat. The two html/php apps show the tomcat default page (but when you click on the links they are dead links). The problem due the httpd.conf file. The mod_jk.so entry not present [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
Error : javax.servlet.ServletException: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (Unknown initial character set index ’192′ received from server. Initial client character set can be forced via the ‘characterEncoding’ property.); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Unknown initial character set index [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
Index 1] Introduction 1.1 Introduction Of Jsp 1.2 Introduction Of Tomcat 2] Requirements Of Hardware And Software Tomcat. 3] Installation Of And Java And Tomcat 3.1] How To Install Java 3.2] How To Install Tomcat 4] Configuration of Tomcat and JSP 4.1] Structure of JSP 4.2] Configuration of Tomcat 5] How To Enable .Jsp Page [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
You can use the following code for Database connection in jsp page. <!– Database connection settings –> <property name=”connection.driver_class”>com.mysql.jdbc.Driver</property> <property name=”connection.url”>jdbc:mysql://localhost/database_name</property> <property name=”connection.username”>databses_user</property> <property name=”connection.password”>password</property> <!– configuration pool via c3p0–> Note : Replace database_name = exact database name, databses_user = exact database username password = exact database password
Posted by Rishikesh Vispute
Categories: Tomcat
Tomcat Server Control with Wget and the Tomcat Manager Tags: * Tomcat Using wget and the Tomcat manager, you can script remote tomcat deploys, undeploys, starts, stops, and status. First, make sure the tomcat manager is installed and running. (see: Configuring the Tomcat Manager) Status Now, we can get the status of all deployed apps [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
Some tomcat related command 1) How to check version of Tomcat root@server []# cd /usr/local/jakarta/tomcat/bin root@server []# sh version.sh 2] How to start and stop tomcat root@server []#/usr/local/jakarta/tomcat/bin/./startup.sh For Start root@server []#/usr/local/jakarta/tomcat/bin/./shutdown.sh For Stop root server[~]# /scripts/restartsrv tomcat 3] How to check tomcat error logs /usr/local/jakarta/tomcat/logs/catalina.err or /usr/local/jakarta/tomcat/logs/catalina.out 4] Create symlinks for start and stop [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
What if I like to access the servlets directly via port 80 instead of using :portnumber on my URL? You can do a trick, Edit apache virtual host entry and add the JkMount directive. For example: I wanted to access a servlet which was under seed directory of my document root. I was able to [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
Why do you have to use port 8080 to use tomcat? Ans: The default port for http servers is 80. Tomcat defaults to using port 8080 instead to avoid an installation of tomcat automatically being seen as a public web server. Instead, tomcat be can setup and tested first using port 8080 and switched to [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
How To Install Java Download j2sdk-1.4.2 from Sun Download center http://developers.sun.com/downloads/ Here I have used j2sdk-1_4_2_18-linux-i586-rpm.bin which will install j2sdk using RPMS and set the Path of JAVA_HOME automatically #chmod +x j2sdk-1_4_2_09-linux-i586.bin #./j2sdk-1_4_2_09-linux-i586.bin Now Check if Java is installed on the server using command java -version [root@vps907 ~]# java -version java version “1.6.0_07? Java(TM) SE [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
Introduction Of Tomcat Since Apache doesn’t support JSP out of the box, we need to add something else to the mix to provide that support. Unfortunately, JSP is too complicated to be supported by a simple Apache module; thus, we need to install an entirely new program to provide that support, then instruct Apache to [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
What is mount point for tomcat? <IfModule mod_jk.c> JkMount /*.jsf ajp13 JkMount /servlet/* ajp13 JkMount /servlets/* ajp13i </IfModule>
If you are looking to enable HTTPS in Tomcat first thing you will have to do is generating a server certificate for your website. A key tool command which comes with your JRE( Java Runtime Environment). Open a command shell which should know how to find your Java runtime environment properly. If you are using [ Read More ]
Posted by Rishikesh Vispute
Categories: Tomcat
If you are facing following error when restarting the tomcat service or check the java version on the server. =============================== Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. =============================== then you need to increase the java heap size by using following commnad. [ Read More ]