Tuesday, 9 August 2016

How to Install Bamboo With JIRA & BitBuckeet Integration in Ubuntu




Install Bamboo With JIRA & BitBuckeet Integration in Ubuntu


What is Bamboo?

Bamboo is a continuous integration server from Atlassian, the makers of JIRA, Confluence and Crowd. Bamboo is free for open-source projects.


What is JIRA?

JIRA is a tool developed by Australian Company Atlassian. It is used for bug tracking, issue tracking, and project management. The name "JIRA" is actually inherited from the Japanese word "Gojira" which means "Godzilla". The basic use of this tool is to track issues, and bugs related to your software and mobile apps.


What is BitBucket?

Bitbucket is a web-based hosting service for projects that use either the Mercurial (since launch) or Git (since October 2011) revision control systems. Bitbucket offers both commercial plans and free accounts.


N.B: Get a Bamboo Server/JIRA Server/BitBucket Server License from https://id.atlassian.com/login?application=mac&continue=https://my.atlassian.com
Create a Account here and Get the License Key. And 2 GB Ram Recommanded for the Server.


Step 1: Install Dependencies For Bamboo:


# apt-get install software-properties-common
# add-apt-repository ppa:openjdk-r/ppa
# apt-get update
# apt-get install openjdk-8-jdk

Step 2: Download & Install Bamboo Server:


# wget https://www.atlassian.com/software/bamboo/downloads/binary/atlassian-bamboo-5.10.1.1.tar.gz
# tar -xvf atlassian-bamboo-5.10.1.1.tar.gz
# mv atlassian-bamboo-5.10.1.1 /opt/bamboo
# cd /opt/bamboo

**N.B: Edit the bamboo-init.properties from the bamboo installation directory and set the bamboo home environment:-

# vi /opt/bamboo/atlassian-bamboo/WEB-INF/classes/bamboo-init.properties

### Add the line at last

bamboo.home=/home/bamboo/bamboo-home

---- save and quit (:wq) ----

# mkdir -p /home/bamboo/bamboo-home

Step 3: To bamboo as service & auto-start with system boot follow in steps in given below:


# vi /etc/init.d/bamboo

JAVA_OPTS=" -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx2048m -XX:NewSize=1536m -XX:MaxNewSize=2048m -XX:SurvivorRatio=6  -XX:MaxPermSize=2048m -XX:+DisableExplicitGC"
export JAVA_OPTS
JAVA_HOME=/usr/share/java/
CATALINA_HOME=/opt/bamboo
export CATALINA_HOME
BAMBOO_HOME=/opt/bamboo/bin
START_BAMBOO=/opt/bamboo/bin/startup.sh
STOP_BAMBOO=/opt/bamboo/bin/shutdown.sh
start() {
echo -n "Starting bamboo: "
cd $BAMBOO_HOME
${START_BAMBOO}
echo "done."
}
stop() {
echo -n "Stopping bamboo"
cd $BAMBOO_HOME
${STOP_BAMBOO}
echo "done."
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0

---- save and quit (:wq) ----

# chmod 755 /etc/init.d/bamboo
# update-rc.d bamboo defaults

** Change Bamboo Service Port Number from 8085 to 80:-

# vi /opt/bamboo/conf/server.xml

Line Number 50: Change the port from 8085 to 80

---- save and quit (:wq) ----

# service bamboo restart

Step 4: Check the Bamboo Installation on Browser:


http://IP-Address

Enter the License Key --> Choose Express Installation --> Fill up required field

Step 5: Download & Install JIRA:


# wget https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.1.0-jira-7.1.0-x64.bin
# chmod 755 atlassian-jira-software-7.1.0-jira-7.1.0-x64.bin
# ./atlassian-jira-software-7.1.0-jira-7.1.0-x64.bin

Step 6: Check the JIRA Installation on Browser:


http://IP-Address:8080

Then Follow the Instruction and Install it. Get a JIRA Server License from https://id.atlassian.com/login?application=mac&continue=https://my.atlassian.com
Create a Account here and Get the License Key.


Step 7: Download and Install Dependebicies & BitBucket:


# wget https://downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-4.3.2-x64.bin
# apt-get -y install git
# chmod 755 atlassian-bitbucket-4.3.2-x64.bin
# ./atlassian-bitbucket-4.3.2-x64.bin

Destination Directory: /opt/atlassian/bitbucket
Default location of plugin and other data: /var/atlassian/application-data/bitbucket

N.B: For external database need connector. Download the JDBC Connector.

# wget http://cdn.mysql.com//Downloads/Connector-J/mysql-connector-java-5.1.38.tar.gz
# tar -xvf mysql-connector-java-5.1.38.tar.gz
# cd mysql-connector-java-5.1.38
# cp mysql-connector-java-5.1.38-bin.jar /opt/atlassian/bitbucket/lib
# chown atlbitbucket:atlbitbucket mysql-connector-java-5.1.38-bin.jar
# service atlbitbucket stop
# service atlbitbucket start

Step 8: Check the BitBucket Installation on Browser With Integrated JIRA & Bamboo:


http://IP-Address:7990

Fill up the required field and select Integrate with Jira.
After that provide Jira url connection with port and username with password and select connect.
Select Linked Repository --> Select Add Repository --> Finish.

** To Link Repository From Bitbucket to Bamboo:

Go to Bamboo Administration Right Side Top Panel --> Overview --> Select Application Links from Left Side Panel --> Give the Bamboo Server URL --> Create New Link --> Done.

N.B: Now both Bamboo with JIRA & BitBucket Integration is Done. Find out all the Things altogether from any one server at the Left Top Drop Down List.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

How to Install SSHFS on Centos/RHEL/Ubuntu


Install SSHFS on Centos/RHEL/Ubuntu

** What is SSHFS?

SSHFS is a filesystem based on the SSH File Transfer Protocol (SFTP). On remote side we just need to install SSH server, Since most of SSH servers already support this, there are nothing to do on remote server except installing SSH server. On client side we need to install fuse sshfs packages to mount remote filesystem. Newer version of SSHFS uses FUSE.
We Can user it as Alternative of NFS.

** Features of SSHFS:

1. Based on FUSE (Best userspace filesystem framework for linux)
2. Multithreading: more than one request can be on it’s way to the server
3. Allowing large reads (max 64k)
4. Caching directory contents

** Requirement:

1. 2 Centos/Ubuntu Server
2. SSH Key Authentication on the Servers


Step 1: Stop the IPTables and Selinux, and Update the Date Time on the Servers and SSH Authentication on the Servers:

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

On Server 1:
# ssh-keygen -t rsa (Enter 3 Times)
# ssh-keygen -t dsa (Enter 3 Times)
# cd /root/.ssh
# cat id_rsa.pub >>authorized_keys
# cat id_dsa.pub >>authorized_keys

On Server 2:
# ssh-keygen -t rsa (Enter 3 Times)
# ssh-keygen -t dsa (Enter 3 Times)
# cd /root/.ssh
# cat id_rsa.pub >>authorized_keys
# cat id_dsa.pub >>authorized_keys

** Now Open the authorized_keys file on both Server and Paste the Server 1's Key to Server 2's authorized_keys File and vice-versa.

# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on
# init 6

Step 2: Install FUSE-SSHFS :


For CentOS/RHEL users, Fuse SSHFS is available under epel repository, So make sure you have install epel repository in your system. Now execute following command to install it.

On CentOS/RHEL:

# yum -y install epel-release
# yum install -y fuse-sshfs

On Ubuntu & Dabian:

$ sudo apt-get update
$ sudo apt-get install sshfs

Step 3: Mount Remote Directory :


Lets mount remote server directory using sshfs, make sure remote system has running ssh server with proper ssh connectivity from your system.
First create a mount point:

# mkdir /mntssh

Lets mount the remote directory. For this example we are mounting /home/remoteuser directory from x.x.x.x (remote.example.com) system to our local system.

# sshfs remoteuser@remote.example.com:/home/remoteuser /mntssh

[Sample output]

The authenticity of host 'remote.example.com (x.x.x.x)' can't be established.
RSA key fingerprint is 77:85:9e:ff:de:2a:ef:49:68:09:9b:dc:f0:f3:09:07.
Are you sure you want to continue connecting (yes/no)? yes
remoteuser@remote.example.com's password: yes

Step 4: Verify Mount :


After mounting remote filesystem on local mount point, verify it by running mount command.

# mount

/dev/mapper/vg_svr1-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
remoteuser@remote.example.com:/home/remoteuser on /mntssh type fuse.sshfs (rw,nosuid,nodev)

Also naviate to your mount point, you will see files there from remote system

# cd /mntssh
# ls

Step 5: Mount Directory on System Boot :


If you want to mount remote filesystem automatically each time when your system reboots, Add following entry to /etc/fstab file. Make sure you have have key based ssh setup between remote and local system.

# vi /etc/fstab

remoteuser@remote.example.com:/home/remoteuser /mntssh fuse.sshfs defaults 0 0

--- save & quit (:wq) ---

Step 6: Unmount Directory :


If your work is over and you don’t need anymore the mounted directory, Simply unmount is using following command.

# umount /mntssh

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

Saturday, 6 August 2016

How to Import SSL to the Existing Openfire Server in Linux Server

How to import SSL in the Existing Openfire Installation




What is Openfire?


Openfire is a real time collaboration (RTC) server licensed under the Open Source Apache License. It uses the only widely adopted open protocol for instant messaging, XMPP (also called Jabber).



Step 1: Put the Keys and Certificates:

Put the Cert and the Key and the CA Cert in the /etc/ssl/ Directory

# ll /etc/ssl/

-rw-r--r--  1 root root  4795 Aug  1 11:39 ca-bundle.crt
-rw-r--r--  1 root root  1838 Aug  1 11:39 ca-cert.crt
-rw-r--r--  1 root root  1704 Aug  1 11:39 ca-cert.key

Step 2: Create a Init Script for Run Openfire Run as a Service:

# vi /etc/init.d/openfire

#!/bin/bash
# description: Openfire Service Status
# processname: openfire
# chkconfig: 234 20 80
OPENFIRE_HOME=/opt/openfire

case $1 in
start)
sh $OPENFIRE_HOME/bin/openfire start
;;
stop)
sh $OPENFIRE_HOME/bin/openfire stop
;;
restart)
sh $OPENFIRE_HOME/bin/openfire restart
;;
status)
sh $OPENFIRE_HOME/bin/openfire status
;;
esac
exit 0

---- save & quit (:wq) ----

# chmod 755 /etc/init.d/openfire

Step 3: Create a Shell Script for Importing the Certs  keys to the JAVA Platform:

# vi /mnt/key-import.sh

### Add these lines

JavaDir="/opt/openfire/resources/security" ### Openfire Installation Directory for Store the Imported Keys
PASS="changeit" ### SSl Exportable & Openfire Admin Certificate Stores Passord
cert="ca-cert" ### Cert Name only
certdir="/etc/ssl" ### Cert Directory
tmp="/root" ### Temporary Folder
ca="/etc/ssl/ca-bundle.crt" ### CA Cert Name

test -e "${JavaDir}/truststore" && rm -f "${JavaDir}/truststore"  ### Checking if there is anything stored already in trustore
test -e "${JavaDir}/keystore" && rm -f "${JavaDir}/keystore"  ### Checking if there is anything stored already in keystore

service openfire stop
cat "${certdir}/${cert}.crt" "${ca}" > ${tmp}/"combined.crt"
keytool -import -trustcacerts -storepass $PASS -alias "StartSSL Class 2" -file "${ca}" -keystore "${JavaDir}/truststore"
openssl pkcs12 -export -in "${tmp}/combined.crt" -inkey "${certdir}/${cert}.key" -out "${tmp}/${cert}.p12" -name "${cert}" -CAfile "${ca}" -passout pass:"${PASS}"
keytool -importkeystore -deststorepass "$PASS" -srcstorepass "$PASS" -destkeystore "${JavaDir}/keystore" -srckeystore "${tmp}/${cert}.p12" -srcstoretype PKCS12 -alias "${cert}"
chmod 640 "${JavaDir}/truststore" "${JavaDir}/keystore"
chown openfire:openfire "${JavaDir}/truststore" "${JavaDir}/keystore"
service openfire start

---- save & quit (:wq) ----

# useradd -s /sbin/nologin openfire
# chown -Rf openfire:openfire /opt/openfire
# chmod -Rf 775 /opt/openfire
# vi /etc/sudoers

### Add at last of the File

openfire  ALL=(ALL)       NOPASSWD:ALL

---- save & quit (:wq) ----

N.B: After creating the openfire User can run the Key Import Script, then the Keys will be imported to the Openfire

# sh /mnt/key-import.sh
# ll /opt/openfire/resources/security

-rw-r----- 1 openfire openfire 6117 Aug  1 12:35 keystore
-rw-r----- 1 openfire openfire 1309 Aug  1 12:35 truststore

Step 4: Now login into the Openfire Admin Panel and Do the Rest:

http://<server-ip>:9090
User: admin
Pass: password

Click on TLS/SSL Certificates --> Give the Password that has been Used in the Script to Every Password Section Here one by one --> Save Settings (one by one) --> Done.

Step 5: Login to the Server via SSH and Shutdown Openffire Properly and then Start again:

# service openfire stop
# ps -ef |grep java

## Kill all the Processes that are running for Java

# kill -9 <PID>

Then statr the Openfire Again

# service openfire start

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

Monday, 11 July 2016

How to Install & Configure Docker in Centos/RHEL 6

Install & Configure Docker in Centos/RHEL 6


What is Docker?


Docker is all about making it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code.

In a way, Docker is a bit like a virtual machine. But unlike a virtual machine, rather than creating a whole virtual operating system, Docker allows applications to use the same Linux kernel as the system that they're running on and only requires applications be shipped with things not already running on the host computer. This gives a significant performance boost and reduces the size of the application.



And importantly, Docker is open source. This means that anyone can contribute to Docker and extend it to meet their own needs if they need additional features that aren't available out of the box.



Requirements:-


1. Centos/RHEL 6.X
2. 2 GB RAM (Recommanded)
3. 50 GB HDD
4. Virtual IP on a Virtual NIC (** For production the Virtual IP Will be a Public IP)

** Here the Virtual IP is: 10.100.100.118 & the Virtual NIC is eth0:1

Step 1: Stop the Selinux, and Update the Date Time on the Server :



# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on

Step 2: Install & Configure Docker :



# yum -y install epel-release
# yum -y update
# yum -y install docker-io
# service docker start
# chkconfig docker on
# service iptables save

Note: ** Now the IPTales will save with all the Rules & Chains will save to the IPTables Main File.



Step 3: Download Images and Configure Docker Container :



Note: ** What kind of OS need that can be find by the Docker Search, Here using the centos6.6 Image for Example, For find a Image with the Version Run the Below Command-



# docker search <OS> (i.e., # docker search ubuntu)

** We are doing with Centos 6.6-
** To download an Image Run the Below Command

# docker pull centos:6.6

** To see the Downloaded Image Run the Below Command

# docker images

** To create a Docker Instance With a Dedicated IP and with the Port Binding for Accessing the VMs from Outside Do the Following things



# cd /etc/sysconfig/network-scripts/
# cp ifcfg-eth0 ifcfg-eth0:1
# vi ifcfg-eth0:1

### Delete All Lines and Add these Lines

DEVICE=eth0:1
TYPE=Ethernet
UUID=0c1b31b3-bcde-4a28-b2b0-581d3f01e33a
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=10.100.100.118
NETMASK=255.255.0.0
GATEWAY=10.100.1.1

---- save & quit (:wq) ----

# ifup eth0:1

** If the NIC doesn't comes up then Run the Below Command-



# service network restart

# ifconfig

** Check the NIC's once that every NIC is up.



** Now Create a Docker Container with the IP 10.100.100.118 with Port Bind to Host Port 5000 to Container's 22 Port-



# docker run -i -t -p <IP>:<Host Port>:<Container's Port> --privileged --name <Any Name> <Image name> <Command> ## --privileged is for run the container with a Root Privileges

# docker run -i -t -p 10.100.100.118:5000:22 --privileged --name NEWVM centos:6.6 /bin/bash

** After run this Command you will Enter into the Container



[root@df4b1cb88bd8 /]# yum -y install openssh*
[root@df4b1cb88bd8 /]# vi /etc/ssh/sshd_config

## Uncomment the Line at Line Number 42
PermitRootLogin yes

---- save & quit (:wq) ----

# service sshd restart
# chkconfig sshd on

** Set root Password; for here its Passw0rd



# passwd root
# netstat -tulpn |grep 22

** To check that the SSH port is Running and Open.



** Now connect the Container from Outside by the IP: 10.100.100.118 Port: 5000 User: root Pass: Passw0rd



Step 4: Set the Httpd for the Created Container with the Virtual IP with 8080 Port :



# service iptables save
# docker stop NEWVM
# docker commit NEWVM newimage02
# docker run -i -t -p 10.100.100.118:5000:22 -p 10.100.100.118:8080:80 --privileged --name NEWVM newimage02 /bin/bash

[root@df4b1cb88bd8 /]# service sshd restart
[root@df4b1cb88bd8 /]# exit

# service iptables save

** Connect the VM through SSH from Outside by the IP: 10.100.100.118 Port: 5000 User: root Pass: Passw0rd



[root@df4b1cb88bd8 /]# yum -y install httpd httpd-devel
[root@df4b1cb88bd8 /]# service httpd restart
[root@df4b1cb88bd8 /]# chkconfig httpd on

** Now check on Brwoser Apache Default Page Will come:



http://10.100.100.118:8080

Step 5: Set the MySLQ for the Created Container with the Virtual IP with 3030 Port :



# service iptables save
# docker stop NEWVM
# docker commit NEWVM newimage01
# docker rm NEWVM
# docker run -i -t -p 10.100.100.118:5000:22 -p 10.100.100.118:3030:3306 --privileged --name NEWVM newimage01 /bin/bash

[root@df4b1cb88bd8 /]# service sshd restart
[root@df4b1cb88bd8 /]# exit

# service iptables save

** Connect the VM through SSH from Outside by the IP: 10.100.100.118 Port: 5000 User: root Pass: Passw0rd



[root@df4b1cb88bd8 /]# yum -y install mysql-server mysql-devel
[root@df4b1cb88bd8 /]# service mysqld restart
[root@df4b1cb88bd8 /]# chkconfig mysqld on
[root@df4b1cb88bd8 /]# mysql_secure_installation

Step 6: Some Special Notes:-



** After Restarting the Docker Container/Main Server if the SSH not working with the Virtual/Public IP the have to login into the Docker and Restart the SSH once.



** To check the Docker Containers Lists-



# docker ps -a

# docker exec -it <Container Name> /bin/bash
[root@df4b1cb88bd8 /]# service sshd restart
[root@df4b1cb88bd8 /]# service httpd restart

Then check the SSH & Http Connections Again

** To take Backup of a Container or Create an Image from a Container Run the Following Command:-



# docker commit <Container Name/ID> <New Image Name>
# docker commit NEWVM image01

** To Check the Ports that Which Host Port Assign to Which Container's Port Run the Following Command:-



# docker port <Container Name/ID>
# docker port NEWVM


*** If Need to Open more that the Existing port for the Container then do the Following Things:-



# docker stop <Container Name/ID>
# docker commit <Container Name/ID> <New Image Name>
# docker rm <Container Name/ID>
# docker run -i -t -p <Virtual IP>:<Physical Host>:<Container's Port> -p <Virtual IP>:<Physical Host>:<Container's Port> -p <Virtual IP>:<Physical Host>:<Container's Port> --privileged --name <New Container Name> <The Saved Image Name> /bin/bash

** Then Check the Container As Previously Described



Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

How to Install & Configure Apache for both GUI & CLI mode on CentOS/RHEL 6.X

Install & Configure Apache for both GUI & CLI mode on CentOS/RHEL 6.X


What is ApacheGUI?


This tools is a free and open source package designed for system administrators to manage the functionality of Apache Web Server from a browser, such as edit configuration and web document files directly from browser, download, search or visualize Apache Logs in real time, install, edit or remove Apache modules, view runtime statistics or detailed graphs transactions of Apache HTTP Server.



Step 1: Stop the Selinux, and Update the Date Time on the Server :



# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

# service iptables stop
# chkconfig iptabes off
# yum -y install ntpd
# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on

Step 2: Install Java of your choise. here installed open jdk you can install oracle java also:



# yum -y install httpd httpd-develjava

Step 3: Download ApacheGUI:



# cd /opt
# wget http://jaist.dl.sourceforge.net/project/apachegui/1.11-Linux-Solaris-Mac/ApacheGUI-1.11.0.tar.gz
# tar -zxvf ApacheGUI-1.11.0.tar.gz
# cd ApacheGUI/bin

Step 4.Start the server:



# ./run.sh
# service iptables stop

If you want to Change the server port from 9999.

# vi /opt/ApacheGUI/tomcat/conf/server.xml

find 9999 and change to any port you like.

Step 5. Configure Apache GUI:



Browse : http://Server-IP/Domain:9999/ApacheGUI/



Use following credentials to login into ApacheGUI tool If Asked

Username: admin
Password: admin

Step 6. Configure Apache GUI from Web Panel :


Next, the tool will prompt you on How Apache Web Server was installed?
Choose Package option, if you installed Apache on RHEL/CentOS using yum package management tool and hit OK to move forward.

Server Root: /etc/httpd
Primary Configuration File: /etc/httpd/conf/httpd.conf
Configuration Directory: /etc/httpd
Log Directory: /logs
Modules Directory: /etc/httpd/modules
Binary File: /usr/sbin/apachectl
Username: root
Password: redhat
Password: redhat

** After you finish hit on Submit button to apply configuration and you’re done.
** Now you can control Apache Web Server with all its configuration files and edit web documents directly from your browser

Step 7. Create init script for Apache GUI :



# vi /etc/init.d/apache-gui

#!/bin/sh
#
#
# System startup script for apache-gui
#
### BEGIN INIT INFO
# Provides: apache-gui
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start the apache-gui
# Description:       Start the apache-gui
### END INIT INFO
#
# chkconfig: 2345 20 80
# description: Runs the apache-gui
# processname: apache-gui
#
# Source function library
. /etc/init.d/functions

case "$1" in
    start)
    cd /opt/ApacheGUI/bin/
./run.sh
       ;;
    stop)
   cd /opt/ApacheGUI/bin/
./stop.sh
        ;;
restart)
cd /opt/ApacheGUI/bin/
./stop.sh
./run.sh
    *)
        echo $"Usage: $0 {start|stop}"
        exit 2
esac
exit $?

--- save & quit (:wq) ---

# chmod 755 /etc/init.d/apache-gui

** Start apchegui as the service now.

# service apache-gui start
# service apache-gui stop
# chkconfig apache-gui on

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

Tuesday, 19 April 2016

How to Install SVN With WebSVN (Web Panel) in Centos/RHEL 6.X

Install SVN With WebSVN on CentOS/RHEL 6.X

What is SVN?

Apache Subversion (often abbreviated SVN, after the command name svn) is a software versioning and revision control system distributed as free software under the Apache License. Software developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation.

What is WebSVN?

WebSVN offers a view onto your subversion repositories that’s been designed to reflect the Subversion methodology. You can view the log of any file or directory and see a list of all the files changed, added or deleted in any given revision. You can also view the differences between two versions of a file so as to see exactly what was changed in a particular revision.

Requirements:

1. Apache
2. Subversion
3. php
4. WebSVN

Step 1: Stop the IPTables and Selinux, and Update the Date Time on the Server :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on
# init 6

Step 2: Install & Configure SVN/Subversion with Apache :

A. Install Required Packages:

# yum install -y mod_dav_svn subversion svn httpd httpd-devel php

B. Create subversion.conf file:

# vi /etc/httpd/conf.d/subversion.conf

### add these lines ###

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<location /repos>
DAV svn
SVNParentPath /var/www/svn/Repos
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /var/www/svn/secure/svn-users
AuthzSVNAccessFile /var/www/svn/secure/svn-access-control
Require valid-user

</location>

--- save & quit (:wq) ---

C. Create SVN Directory Tree:

# mkdir -p /var/www/svn/{Repos,secure}
# touch /var/www/svn/secure/svn-access-control
# touch /var/www/svn/secure/svn-users
# service httpd restart

Step 3: Configure some Test Repo & create User for SVN :

A. Create Repo and User:

# cd /var/www/svn/Repos
# svnadmin create testrepo
# chmod -Rf 777 testrepo
# htpasswd -cm /var/www/svn/secure/svn-users testuser (after that give password for "testuser" twice)

B. Modify svn-access-control for Repos Permisions:

# vi /var/www/svn/secure/svn-access-control

### add these lines
[groups]

admin = testuser
testrepo = testuser

[/]
@admin = rw

[testrepo:/]
@testrepo = rw

--- save & quit (:wq) ---

# service svnserve restart

### Check the Svn repo with the url: http://<ip-of-server>/repos/testrepo
username: testuser
password: (Password)

C. update the Repo to Revision 1

# mkdir -p /mnt/svn-structure-template/{trunk,branches,tags}
# svn import -m 'Initial import' /mnt/svn-structure-template/ http://localhost/repos/testrepo

Step 4: Install and Configure WebSVN :

# cd /var/www/html
# wget http://websvn.tigris.org/files/documents/1380/49057/websvn-2.3.3.zip
# unzip websvn-2.3.3.zip
# mv websvn-2.3.3 websvn
# cd /var/www/html/websvn/include
# cp distconfig.php config.php
# vi config.php

### add these lines

// Configure these lines if your commands aren't on your path.
//
$config->setSVNCommandPath('/usr/bin'); // e.g. c:\\program files\\subversion\\bin
$config->setDiffPath('/usr/bin');
// For syntax colouring, if option enabled...
$config->setEnscriptPath('/usr/bin');
$config->setSedPath('/bin');
// For delivered tarballs, if option enabled...
$config->setTarPath('/bin');
// For delivered GZIP'd files and tarballs, if option enabled...
$config->setGZipPath('/bin');
//
$config->parentPath('/svn/');
$extEnscript[".pl"] = "perl";
$extEnscript[".py"] = "python";
$extEnscript[".sql"] = "sql";
$extEnscript[".java"] = "java";
$extEnscript[".html"] = "html";
$extEnscript[".xml"] = "html";
$extEnscript[".thtml"] = "html";
$extEnscript[".tpl"] = "html";
$extEnscript[".sh"] = "bash";

## $config->addRepository('Repo_Path', 'Repo_Url', NULL, 'Repo_User', 'Repo_Pass'); If more Repo added just copy the below Line and Modify it for the New Repo to Access on WebSVN

$config->addRepository('/var/www/svn/testrepo', 'http://192.168.72.243/repos/testrepo', NULL, 'testuser', 'redhat');

--- save & quit (:wq) ---

# vi /etc/httpd/conf/httpd.conf

### After line number 312 add these lines

<Directory "/var/www/html/websvn">
DirectoryIndex index.html index.php index.cgi index.pl
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

--- save & quit (:wq) ---

# service httpd restart

### Check the WebSVN Now on url: http://<ip-of-server>/websvn

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

Friday, 15 April 2016

How to install Netdata on Centos/RHEL 6.X


Install Netdata on Centos/RHEL 6.X

What is Netdata?

netdata is a extremely optimized Linux utility that provides real-time (per second) performance monitoring for Linux systems, applications, SNMP devices, etc. and shows full interactive charts that absolutely render all collected values over the web browser to analyze them.

Step 1: Stop the IPTables and Selinux, and Update the Date Time on the Server :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on
# init 6

Step 2: Netdata Installation on Linux Systems :

# yum install -y zlib-devel gcc make git autoconf autogen automake pkgconfig

Step 3: clone the netdata repository from git and run netdata installer script to build it :

# cd /mnt
# git clone https://github.com/firehol/netdata.git --depth=1
# cd netdata
# ./netdata-installer.sh

Step 4: Now it’s time to start netdata by executing the following command from the terminal & You can also stop netdata by terminating it’s process with killall command as shown :

# /usr/sbin/netdata
# killall netdata

N.B: Note: Netdata saves on exit its round robbin database information under /var/cache/netdata file, so that when you start again netdata, it will continue from where it was stopped last time.

Step 5: Updating netdata & Restart the netdata and Check on Browser:

# cd /mnt/netdata
# git pull
# ./netdata-installer.sh

http://IP-Address:19999

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

Thursday, 10 March 2016

How to Install WAMP Server on Windows Server 2008/2012 R2


What is WAMP?

WampServer is a Windows web development environment. It allows you to create web applications with Apache2, PHP and a MySQL database. Alongside, PhpMyAdmin allows you to manage easily your Database


Requirement:

A. Apache Server (httpd-2.2.22-win32-x86-no_ssl.msi)
B. PHP (php-5.x.x-Win32-VC9-x86.zip)
C. DotNet Framework 4.0 (dotNetFx40_Full_x86_x64.exe)
D. Mysql Installer Community (mysql-installer-community-5.6.10.1.msi)
E. PhpMyAdmin (phpMyAdmin-4.5.5-english.zip)

Step 1. Install & Configure Apache Server (httpd-2.2.22-win32) :

Download Link:

http://a.mbbsindia.com//httpd/httpd-2.4.18.tar.gz

Next->I Acceept->Next->Give Network Domain (ex:- deb.com)-> Server Name (ex:- apache)-> Administrator email Address(ex:- ddas@kminfosystems.com)->Next-> Choose Custom-> Next->Click on Change & select the Directory (ex-c:\webserver\apche)->Next->Install->Finish.

N.B: ex-c:\webserver\apache make this structure if using this structure

Step 2. Go to Web Browser & type :

http://localhost or http://Your-IP-Address

Step 3. Install & Configure PHP :

Download Latest Version of Php:

http://windows.php.net/downloads/releases/

Extract php-5.x.x-Win32-VC9-x86.zip-> Rename 'php-5.x.x-Win32-VC9-x86' to 'php'-> Cut The php folder-> Open C:\webserver-> Paste.

Open 'php' Folder->find the file named 'php.ini-development'->Rename 'php.ini-development' to 'php.ini'-> Open httpd.conf (Location: C:\webserver\apache\conf\httpd.conf)-> Find

<IfModule !mpm_netware_moudle> & Paste the following Lines-

LoadModule php5_module "C:\webserver\php\php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:\webserver\php"

Open the Directory 'htdocs' (C:\webserver\apache\htdocs)-> and make a .php file named info.php-> type:

<?php
phpinfo();
?>

--Save the file.

--Restart the Apache Service.

Step 4. Open the Browser & type :

http://localhost/info.php or http://Your-IP-Adress/info.php

Step 5. Install DotNet Framework 4.0. :

Download .NET:

https://download.microsoft.com/download/B/A/4/BA4A7E71-2906-4B2D-A0E1-80CF16844F5F/dotNetFx45_Full_setup.exe

Step 6. Install Mysql Installer Community :

Download The Latest Version:

http://cdn.mysql.com//Downloads/MySQLInstaller/mysql-installer-community-5.6.28.0.msi

Install Mysql Product-> I Accept-> Next-> Skip-> Next-> Choose 'Server Only'-> Next-> Next-> Execute->
Next-> Check on Advance Configuration-> Next-> Type Mysql Root Password (redhat)->Next->Next->
Check on General Log-> Next-> Next-> Finish.

Go to Start->All Programs->MySQL->MySQL Server 5.6->MySQL 5.6 Command Line Client
Password : redhat

-show databases;
-exit;

Step 7. Install & Configure phpMyAdmin :

Download The Latest Version:
https://www.phpmyadmin.net/downloads/

Extract phpMyAdmin-4.5.5-english.zip-> Rename 'phpMyAdmin-4.5.5-english.zip' to 'pma'-> Cut The pma folder-> Open C:\webserver\apache\htdocs-> Paste.

Open the 'pma' folder-> find the file named 'config.sample.inc.php'-> Rename the file
'config.sample.inc.php' to 'config.inc.php'

Step 8. Go to C:\webserver\php :

Open 'php.ini' file-> Find those three lines

;extension=php_mbstring.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll

Uncomment those Lines & modify look like this :

extension="c:\webserver\php\ext\php_mbstring.dll"
extension="c:\webserver\php\ext\php_mysql.dll"
extension="c:\webserver\php\ext\php_mysqli.dll"

--Save the File.

Open httpd.conf (Location: C:\webserver\apache\conf\httpd.conf)-> Find

<IfModule dir_module> Just add index.php after index.html

index.html index.php

--Save the File

--Restart the Apache Service.

Step 9. Open the Browser & type :

http://localhost/pma or http://Your-IP-Address/pma
User Name : root
Enter The Mysql Password : redhat

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

Wednesday, 2 March 2016

How to Install Tomcat 9 With Java 9 On CentOS/RHEL 6.X



Install Tomcat 9 With Java 9 On Centos/RHEL 6

Step 1: Stop the IPTables and Selinux, and Update the Date Time on the Server :

# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

SELINUX=disabled ###(Change enabled to disabled)

--- save & quit (:wq) ---

# service ntpd restart
# ntpdate pool.ntp.org
# chkconfig ntpd on
# init 6

Step 2: Download & Install Java 9 :

# cd /opt
# wget http://download.java.net/java/jdk9/archive/104/binaries/jdk-9-ea+104_linux-x64_bin.tar.gz
# tar -zxvf jdk-9-ea+104_linux-x64_bin.tar.gz
# cd jdk-9/
# alternatives --install /usr/bin/java java /opt/jdk-9/bin/java 2
# alternatives --config java

There may Be more that 1 programs which provide 'java'. Select the version Which is downloaded.

Selection    Command
-----------------------------------------------
*  1           /opt/jdk1.7.0_71/bin/java
 + 2           /opt/jdk1.8.0_45/bin/java
   3           /opt/jdk1.8.0_66/bin/java
   4           /opt/jdk-9/bin/java
 
Enter to keep the current selection[+], or type selection number: 4

# alternatives --install /usr/bin/jar jar /opt/jdk-9/bin/jar 2
# alternatives --install /usr/bin/javac javac /opt/jdk-9/bin/javac 2
# alternatives --set jar /opt/jdk-9/bin/jar
# alternatives --set javac /opt/jdk-9/bin/javac

# vi /etc/profile.d/java.sh

#!/bin/bash
JAVA_HOME=/opt/jdk-9/
PATH=$JAVA_HOME/bin:$PATH
export PATH JAVA_HOME
export CLASSPATH=.

--- Save & Quit (:wq) ---

# chmod +x /etc/profile.d/java.sh
# source /etc/profile.d/java.sh
# export JAVA_HOME=/opt/jdk-9/
# export PATH=PATH:/opt/jdk-9/bin

* Check the installed Java Version:

# java -version

java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+104-2016-02-03-214959.javare.4385.nc)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+104-2016-02-03-214959.javare.4385.nc, mixed mode)

Step 3: Download and Install Tomcat 9 :

# cd /opt
# wget http://www.us.apache.org/dist/tomcat/tomcat-9/v9.0.0.M3/bin/apache-tomcat-9.0.0.M3.tar.gz
# tar -zxvf apache-tomcat-9.0.0.M3.tar.gz
# mv apache-tomcat-9.0.0.M3 /usr/local/tomcat9

** Create a init script for run the Tomcat as a service:

# vi /etc/init.d/tomcat

#!/bin/bash
# description: Tomcat Start Stop Restart-SOM
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/opt/jdk-9
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/local/tomcat9

case $1 in
start)
sh $CATALINA_HOME/bin/startup.sh
;;
stop)
sh $CATALINA_HOME/bin/shutdown.sh
;;
restart)
sh $CATALINA_HOME/bin/shutdown.sh
sh $CATALINA_HOME/bin/startup.sh
;;
esac
exit 0

--- save & quit (:wq) ---

# chmod 755 /etc/init.d/tomcat

# vi /usr/local/tomcat9/conf/tomcat-users.xml

### Add these lines in between "<tomcat-users>" Tag. Change the Password and Username.

<role rolename="manager-gui" />
<user username="manager" password="redhat" roles="manager-gui" />

<role rolename="admin-gui" />
<user username="admin" password="redhat" roles="manager-gui,admin-gui" />

--- save & quit (:wq) ---

# service tomcat restart
# chkconfig tomcat on

*** Check on Browser: http://<IP_Address>:8080
Click on Manager App and Login with Manager Creds
Click on Host manager and Login with Admin Creds

Step 4: Configure Virtual Host on Tomcat 9 :

N.B: There is some problem with Apache Solr and Railo with Java 9. Seems Java 9 doesn't Work properly for Apache Solr & Railo. So for now Here doing with a sample war file Virtual Hosting. Virtual Host Name test.com (For Example).

# vi /etc/hosts

### add the virtual to hosts file

192.x.x.x test.com

--- save & quit (:wq) ---

## Download sample.war file

# cd /opt
# wget https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war
# cd /usr/local/tomcat9
# cp -r webapps/ test.com
# mv test.com/ROOT test.com/ROOT.bak
# cp /opt/sample.war /usr/local/tomcat/test.com/ROOT.war

### Configure the server.xml file for virtual Hosting

# vi /usr/local/tomcat9/conf/server.xml

### add this line

<Host name="test.com"  appBase="test.com" unpackWARs="true" autoDeploy="true"/>

--- save & quit (:wq) ---

# service tomcat restart

*** Check on Browser: http://test.com:8080

Step 5: Apache Reverse Proxy for Tomcat Virtual Hosts :

# yum -y install httpd httpd-devel

# vi /etc/httpd/conf.d/test.com.conf

### Add these Lines

<VirtualHost *:80>
    ServerAdmin email-address
    ServerName test.com
    ServerAlias www.test.com


    ProxyRequests Off
    ProxyPreserveHost On
    <Proxy *>
       Order allow,deny
       Allow from all
    </Proxy>


    ProxyPass / http://test.com:8080/
    ProxyPassReverse / http://test.com:8080/


    ErrorLog /logs/test.com-error_log
    CustomLog /logs/test.com-access_log common

</VirtualHost>

--- save & quit (:wq) ---

# mkdir /logs
# service tomcat restart
# service httpd restart

*** Check on Browser: http://test.com

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.

Sunday, 7 February 2016

How to Install LAMP Server on Centos/RHEL 6.X

LAMP Server on Centos/RHEL 6.X

Step 1: Install Apache

# yum -y install httpd httpd-devel

Start httpd Service

#/etc/init.d/httpd start

Edit httpd.conf file

# vi /etc/httpd/conf/httpd.conf

### Just Add this Line
#ServerName www.example.com:80
ServerName (ip address of server):80

--- Save &amp; Quit (:wq) ---

Step 2: Go to /var/www/html and Make A HTML page

# vi index.html

Restart httpd Service:

#/etc/init.d/httpd restart

Step 3: Install MySQL Database Server

# yum -y install mysql mysql-server mysql-devel

Start Mysqld Service

# /etc/init.d/mysqld start

Changing MySQL Root Password:

# mysql
mysql&gt; USE mysql;
mysql&gt; UPDATE user SET Password=PASSWORD('sql') WHERE user='root';
mysql&gt; FLUSH PRIVILEGES;
mysql&gt; exit

Check by logging:

#mysql -u root -p
Enter Password:

mysql&gt; show databases;
++
| Database |
++
| information_schema |
| mysql |
++
2 rows in set (0.00 sec)

mysql&gt; exit

Step 4: Install PHP5 Scripting Language

# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml

Step 5: Create a file named /var/www/html/info.php

# vi /var/www/html/info.php

phpinfo();
?&gt;

--- Save &amp; Quit (:wq) ---

# /etc/init.d/httpd restart

Step 6: Then point your browser to http://ip address/info.php

http://(Your-IP/Hostname)/info.php

Step 7: Download this phpMyAdmin rpm

# cd /var/www/html
# wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.14/phpMyAdmin-4.0.10.14-all-languages.tar.gz

Extract the tar File &amp; Rename it :

# tar -zxvf phpMyAdmin-4.0.10.14-all-languages.tar.gz
# ls
# mv phpMyAdmin-4.0.10.14-all-languages phpmyadmin
# ls

Edit the /etc/httpd/conf/httpd.conf File :

# vi /etc/httpd/conf/httpd.conf
Add those Lines :


Options +Indexes +Multiviews
DirectoryIndex index.php index.html
AllowOverride All
Allow from all

--- Save &amp; Quit (:wq) ---

Rename the config.sample.inc.php File

# mv config.sample.inc.php config.inc.php

Step 8: Start the httpd &amp; mysql Service on Boot &amp; stop iptables &amp; Disable the selinux

# chkconfig httpd on
# chkconfig mysqld on
# service iptables stop
# chkconfig iptables off
# setenforce 0

Point your browser to

http://(Your-IP/Hostname)/phpmyadmin

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.