How to Configure an Application on Tomcat Server

Apache Tomcat is an open source web server for provided by Apache. It is use for implementation of Java Web Server, Java Servlet, Java Expression Language and Web Socket technologies. An Apache tomcat is available for Windows and Linux both OS. You can install Apache Tomcat web server and host your application. You can follow below steps for Apache tomcat installation and URL configuration in windows server.

  • Download Apache Tomcat application from Apache.org
  • Before going to install tomcat, you have to install JRE(JAVA RUNTIME ENVIRONMENT). You can download from Oracle site.
  • Open Tomcat setup file, you will see Apache Tomcat Welcome page, Click NextApache
  • Accept License agreement, Click I Agree
  • Keep default in Choose Components window, Click Next
  • Change port according to your requirement and set User Name & Password for tomcat admin console, Click Next
  • Browse your JRE installation Path, click Next
  • Check Destination folder location, Click Next
  • Click Finish
  • Open xml file from C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf location.
  • After successfully install, browse http://localhost:8080. You will see Apache Tomcat page like thisApache PageSetup Application in Apache Tomcat
  • Open xml file from C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf location.
  • Go to bottom of the file and add new host like this and save.<Host name=”myapplication” appBase=”webapps\myapplication” unpackWxARs=”true” autoDeploy=”true” xmlvalidation=”false” xmlnamespaceaware=”false” ><Alias>myapplication.com</Alias><Valve className=”org.apache.catalina.valves.AccessLogValve” directory=”logs” prefix=”myapplication_log” suffix=”.txt” pattern=”common” resolvehost=”false” /></Host>
  • Restart Apache Tomcat Service from service manager.

Setup HTTPS in Apache Tomcat

  • Open xml file from C:\Program Files\Apache Software Foundation\Tomcat 9.0\conf location.
  • Add certificate details in server.xml file, according to this.<Connector port=”443″ protocol=”HTTP/1.1″ SSLEnabled=”true” sslEnabledProtocols=”TLSv1,TLSv1.1,TLSv1.2″ useURIValidationHack=”false”maxThreads=”150″ scheme=”https” secure=”true” keystoreFile=”C:\certificatepath\certificate.pfx”keystorePass=”CertPassword” SSLCACertificateFile=”C:\cacertificatepath\cacertificate.crt” keystoreType=”PKCS12″clientAuth=”false” maxPostSize=”0″/>
  • Restart Tomcat service again.
  • Check your application in browser
  • https://localhost

 

You Must Also Read

Microsoft Server 2008 is Going to End of Support Life

 

Leave a Reply

Your email address will not be published. Required fields are marked *