Tuesday, 18 August 2015

Auto ssh from one linux instance to another remote linux server

Auto-ssh from one server to another:
--------------------------------------
Source machine:
At home location of user create .ssh dir

cd .ssh
ssh-keygen -t rsa

The above command creates a file id_rsa.pub

Dest machine:
mkdir .ssh
cd .ssh

copy the contents of id_rsa.pub  to destination server below location
vi /root/.ssh/authorized_keys

Thats it, now you should ssh without any password prompt from source machine remote instance

Monday, 17 August 2015

How to forward apache httpd webserver 80 port to any other internal ports based on web context


I have got a requirement to setup Sonar and Nexus servers in one Linux instance ( AWS EC2) where my infra team allows only port 80 to access that server from external world, so I need to look on a work around to access both servers on single port.
              Practically hosting two services with same port is not possible instead I have used Apache httpd web-server to perform the port forwarding to to the respective service based on the context provided in the web URL.

The below are the steps which I have followed to make this setup work successfully

1.  Install Sonar and Nexus as usual like stand alone or hosting on Tomcat container etc.
2.  In my current setup My sonar is running on port 9000 and Nexus is on 8081, both ports are not accessible from external world, so I did the the apache httpd setup in this instance
3.  Install apache httpd in your linux machine with the help of below command using root user.  yum install httpd
4.  open the httpd.conf file   ( /etc/httpd/conf/httpd.conf) and add below entries

<VirtualHost *:80>
  ProxyPreserveHost On
  ProxyRequests Off
  ProxyPass /nexus http://localhost:8080/nexus
  ProxyPassReverse /nexus http://localhost:8080/nexus
  ProxyPass /sonar http://localhost:9000/sonar
  ProxyPassReverse /sonar http://localhost:9000/sonar
  <Proxy *>

        Order deny,allow
        Allow from all
  </Proxy>
</VirtualHost>

5.  Now restart your apache webserver with below command
/etc/init.d/httpd restart
That’s it now you should be able access the sonar and nexus URL’s without the respective ports and with standard context as below



Chiranjeevi Patel
Chiranjeevi.aec@gmail.com

Friday, 31 July 2015

Gitblit setup on Linux instance

****** GitBlit Setup ****

Server Setup on Linux machine
-----------------------------
1. Download the gitblit war file from below link
   http://dl.bintray.com/gitblit/releases/gitblit-1.6.2.war
 
   Downlaod JDK from below link and extract at root location (/root/jdk1.7)
   http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-i586.tar.gz
 
2. Setup a Tomcat app server on linux machine ( Tomcat7)
   -Download jdk1.7 from oracle site( google it you will get)
   -Download tomcat from below link
    http://apache.arvixe.com/tomcat/tomcat-7/v7.0.62/bin/apache-tomcat-7.0.62.tar.gz
   -Extract the tar.gz file with below command at /root/ lcoation
   - $tar -zxvf apache-tomcat-7.0.62.tar.gz
   - The above command will create a directory apache-tomcat-7.0.62, cd to this directory
     cd /root/apache-tomcat-7.0.62/bin
   - open catalina.sh file in this location ( /root/apache-tomcat-7.0.62/bin/catalina.sh)
     add JAVA_HOME at starting of the line as shown below
     JAVA_HOME="/root/jdk1.7"

3. Copy the downloaded gitblit.war file to tomcat webapps location
    $cp gitblit.war /root/apache-tomcat-7.0.62/webapps/
4. Restart tomcat server
     $cd /root/apache-tomcat-7.0.62/bin
     $./startup.sh

5. Access the gitblit from browser with an admin user
   http://192.168.146.129:8080/gitblit   (admin/admin)
 
6. Create a repository with README initial commit

7. Create the users from dashboard by clicking on admin user link -> users option
   create a user harry and password harry, then under permisisons tab provide access to the respective repo and respectvie access
   ex:
   gitrepo --> RW ( push and pull access)

Client setup on developer machine
---------------------------------
1. Download git client from below link and install it in your windows desktop
   http://git-scm.com/download/win
2. Install it as it is, how you generally install any windows msi/exe files
3. open git bash from start program and create a dir at your home location on gitbash
   C:\Users\harry>mkdir .ssh
   cd .ssh
   Enter below command and just enter 3 times
   ssk-keygen -t rsa
   This will create three files under .ssh diretory, open id_rsa.pub file and copy the public key then add the sam through gitblit web UI under your profile sections
4. Click on harry user name on gitblit dashboard, select ssh keys option then add above copied public key there.

5. Now clone the repo to your machine by running below command to create local repo/workspace

git config --global user.name "harry"
git config --global user.email "harry@gmail.com"

    git clone ssh://harry@192.168.146.129:29418/repo1.git
    cd repo1
    touch Hello.txt
    git add Hello.txt
    git commit -m"sample commit"
    git push origin master

Thursday, 7 June 2012

All about SCM

You can establish a fully automated and continuous Build, Release, and Deployment infrastructure for all of your software development activities in a fraction of the time and cost it takes for you to search, interview, hire, train, and retain a full-time on-site Build & Release Engineer”

It’s about creating values for you and your company.  I obsess about Build and Release, that’s because I’m really good at it.  No software development should be without a battle hardened Build and Release infrastructure.  Nobody likes surprises when it comes to their software releases.  Whether a release is big or small, it should be traceable and reproducible in every step of the development cycle.   You need to be “quick to market” and be able to scale when market demand grows.  The best way to prepare your company for such events will be to establish a Build and Release infrastructure.  This is where I can help..
From my extensive experience in the field, I noticed many organizations ranging from start-ups to fortune 500 companies often have deficiencies in areas of Software Build and Release Management. These deficiencies are a direct result of the lack of talented resources in this particular field.
Many companies tend to rotate Software Engineers for Software Configuration Management related duties because of the lack of funding to recruit a full-time Build/Release Engineer. This can result in wasteful development cycles for the Software Engineers involved. However, the issue further magnifies in smaller organizations when there just aren’t enough tasks to warrant the hiring of a full-time Build or Release Engineer. 
There are also instances where companies do have the resources for a full-time Build/Release Engineer but have an extremely hard time recruiting one.  At times, the recruitment process can take up to 6+ months to a year to place a qualified candidate.  During this time frame, the quality of the builds and releases suffer due to the lack of established formal processes and infrastructure to enforce these processes.
I offer full Software Build, Release, and Configuration Management consulting services and solutions. Consulting services and solutions include but are not limited to:

Software Build Management Services & Solutions

  • Specializing in cost effective Open Source technologies
  • Implement continuous integration builds
  • Fully adapts to agile methodologies
  • Fully automate software builds
  • Fully automate distribution
  • Fully automate build results publishing and notification
  • Integrate automated unit testing into software builds
  • Complete and robust automated build solution
  •  
  • Software Release Management Services

    • Assess current process and (if needed) improves it
    • Establish a new release process fulfilling all the requirements of your organization
    • Develop checks and balances to existing processes to ensure accurate software artifact deliveries
    • Implement MD5, SHA check sums to ensure bit integrity and traceability
    • Implement access control infrastructure on released artifact distribution to ensure highest level of security
     
  • SCM Solutions: Framework and Infrastructure Development

    • Assess current infrastructure and recommend improvements (if needed) for optimal performance gain
    • Develop an entire automated build and release framework from the foundation leveraging available Open Source tools
    • Ensure framework to be fully portable and scalable
    • Establish a robust SCM infrastructure to support the organization’s development ambition
    • Expertise with in-house as well as cloud based solutions
     

Why AllSCM as your Build, Release, and SCM Consultant?

  • 6+ years of experience in the field of Software Build and Release and counting
  • Practical and hands-on implementation of countless SCM frameworks and infrastructures
  • Quickest way to get your build and release infrastructures established/stablized
  • Most cost effective way for smaller groups/organizations to establish a formal SCM infrastructure using stable and actively maintained Open Source tools.
  • Security conscious to safeguard source codes with the industry’s best practices
  • Agile process driven to promote efficient software builds and releases
 Need more info contact me : chiranjeevi.aec@gmail.com