Posts

Showing posts with the label tomcat

How to enable multiple domains in Apache Server using Name-Based VirtualHosts and SSL

Scenario: I have an Apache Server(SSL enabled) and tomcat running on my machine and there is one application (app1) hosted on tomcat which is only accessible from Apache Server. You cannot access it directly from tomcat. Now you want to access app1 using multiple domains i.e. domain1.waheedtechblog.com annd domain2.waheedtechblog.com should point to the same application which is hosted on tomcat. (I want to implement different Authentication mechanism based on different domains) Solution: The above case can be achieved using NameBased VirtualHosts and SSL. First you need to uncomment following lines form ${apache}/conf/httpd.conf file LoadModule ssl_module modules/mod_ssl.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_http_module modules/mod_proxy_http.so Include conf/extra/httpd-ssl.conf then goto ${apache}/conf/extra/httpd-ssl.co...

How to install and configure Apache Tomcat 7 on Cent OS

Image
Here are the steps to install and configure Apache Tomcat 7 on Cent OS : Make sure you have JAVA 6 or later version installed on your machine. Java --version Download Tomcat7 Archive wget http://www.us.apache.org/dist/tomcat/tomcat-7/v7.0.64/bin/apache-tomcat-7.0.64.tar.gz Untar it at some location (eg: /opt/tomcat7) tar xzf apache-tomcat-7.0.64.tar.gz Start the tomcat (bydefault it will start at port 8080) sh /opt/tomcat7/bin/startup.sh Verify Apache Tomcat Server Goto your browser and check http:// localhost: 8080 or http://127.0.0.1:8080 Stop the tomcat sh /opt/tomcat7/bin/shutdown.sh [Optional] To access admin|manager pages, you need to create user accounts. Add below lines inside <tomcat-users></tomcat-users> tags in ${tomcat7}/conf/tomcat-users.xml file. <role rolename="manager-gui"/> <user username="manager...

How to enable SSL on apache Tomcat 7.0

Image
This tutorial shows how to enable SSL support for Apache Tomcat web server. Requirement *) Apache Tomcat 5.0 *) JDK 1.5 Note: if you have JDK below 1.4, you need to install Java Secure Socket Extensions (JSSE) To install and configure SSL support on Tomcat, you need to follow these simple steps. Generating the KeyStore file: *) Create a keystore file to store the server's private key and self-signed certificate by executing the following         command. *) Enter command line and change directory to your JAVA\bin folder. (Default path is: C:\Program         Files\Java\jre6\bin). *) Type “keytool –genkey –alias tomcat –keyalg RSA" and press Enter.         Where tomcat is an alias name and RSA is a key algorithm. *) Type your password for the keystore. (Default password is: changeit). In this example, I’ll use password as “password" Enter general information about this Certificate. The example is the image be...