Posts

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 generate SSL Key, CSR and Self Signed Certificate using OpenSSL.

Image
I have already discussed how to generate SSL certificate using keytool over here . In this article, I am going to explain how can you achieved the same thing using OpenSSL tool. The three differnet files that I am going to generate i.e. : waheedtechblog.key waheedtechblog.csr waheedtechblog.crt Generate Private key : waheedtechblog.key openssl genrsa -des3 -out waheedtechblog.key 1024 Generate a Certificate Signing Request (CSR) Using above generated key file, We will now create the CSR file openssl req -new -key waheedtechblog.key -out waheedtechblog.csr Generate a Self-Signed SSL Certificate openssl x509 -req -days 365 -in waheedtechblog.csr -signkey waheedtechblog.key -out waheedtechblog.crt These file can be used to enable SSL in Apache Server. Sometime, we need to remove passphrase to run key in Apache Server, if you get such issue while enabling SSL in Apache Server then run following command to remove p...

Configure Shibboleth Idp to achieve Single Sign-on with Zendesk

Image
1. Introduction Shibboleth is standards-based, open source middleware software which provides web single sign-on across or within organizational boundaries. It allows sites to make informed authorization decisions for individual access of protected online resources in a privacy-preserving manner. Shibboleth Identity Provider supports the SAML2 specification and is therefore ideal for use with Zendesk. This document will describe the steps required to configure Shibboleth 2.0 Identity Provider to achieve single sign-on with Zendesk. 2. Install Shibboleth IdP The V2 Shibboleth Identity Provider is a standard Java web application based on the Servlet 2.4 specification and should run for the most part in any compatible servlet container. For this setup, I am going to use Apache Tomcat 7. Install and configure Apache tomcat 7 Download the Shibboleth Identity Provider (V2.4.4) software package. Unzip the archive and uncomment <security-constraint>, <login-config...

How to install Maven on CentOS

Image
Steps to install and configure Maven on CentOS Download the tar.gz file from Apache Maven site Untar the file at some location (Eg: /opt/maven) tar x z f <filename> Add the environment variable to ~/.bash_profile file cd $HOME vi ~/.bash_ profile Append PATH variable with maven path Add M2_HOME variable export M2_HOME Save and restart your system Verify maven installation mvn --version

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 install and Configure Apache Http Server on Cent OS

Image
Here are the steps to install and configure Apache WebServer on Cent OS : Install Apache HTTP Server (By default Cent OS comes with Apache) yum install httpd Set to Chkconfig to start on boot chkconfig --level 235 httpd on Uncomment below line from configuration( /etc/httpd/conf/httpd.conf ) file NameVirtualHost *:80 Restart Apache Http Server service httpd restart Verify Apache Server Goto your browser and check localhost or localhost.localdomain It will display Apache Test Page

How to install and configure MySQL on Cent OS

Here are the steps to install and configure MySQL on Cent OS : Install MySql Server yum install mysql-server mysql php-mysql Set to Chkconfig to start on boot chkconfig –level 235 mysqld on Start the MySQL service service mysqld start Set the password for all domains myql -u root SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new-password'); SET PASSWORD FOR 'root'@'localhost.localdomain' = PASSWORD('new-password'); SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('new-password'); Exit and verify the MySQL version exit mysql --version mysql Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1