Showing posts with label AWS. Show all posts
Showing posts with label AWS. Show all posts

HAProxy (High Availability Proxy)

HAProxy(High Availability Proxy) is an open source load balancer which can load balance any TCP service. It is particularly suited for HTTP load balancing as it supports session persistence and layer 7 processing.





HA Proxy Setup  :

I was working with Apache Webserver from very long but when I jumped into the world of NodeJS I started loving websockets. Soon I was planning to integrate my PHP applications with NodeJS. I was happy to use both, till I was not running both the applications on default web service port 80. But when I tried to configure Apache virtual hosting for proxying my request to NodeJS server port, it was not allowing my websocket communication to happen. I tried alot of modules but didn’t got success. And after alot of googling I found something which helped me to achieve what I need. Once I configured HAProxy on my system I was able to serve both applications, PHP and NodeJS through port 80 just by virtual hosting of HAProxy.

Setting up a SVN Server on a EC2 Instance (Ubuntu 14.04 LTS)

Setting up an SVN server on my EC2 instance (on AWS), is a major problem whenever we connect svn using key-file(key.pem for AWS).
Here’s my situation:
  • I have a micro EC2 instance hosted with Amazon.
  • I used a non-standard port for ssh access
  • I have a pem file provided by Amazon for access through ssh
  • I run Ubuntu 14.04 Server on my EC2 instance
  • On the client side, I’m running Ububtu 14.04 Desktop
With that out of the way, the first thing I had to do was insure svn was installed on my server and Desktop :
sudo apt-get install -y subversion

Then, on my EC2 instance, I want to create both the directory where I’ll store repositories, and the subsequently, create the repository itself. Permissions and ownership are of the utmost importance. This worked for me:
sudo mkdir -p /srv/svn/
sudo chown ubuntu:ubuntu /srv/svn/
svnadmin create /srv/svn/{repo_name}
Mind the {rep_name} placeholder above 

vim /svnrepos/conf/svnserve.conf
In that file add these three lines:
anon-access = none
auth-access = write
password-db = passwd
Create a password file:
vi /svnrepos/conf/passwd
In that file add a line for your user:
# add users in the format : user = password
tony = mypassword