Apache Ant : Install Apache Ant on Linux Machine

Apache Ant is a Java library and command-line tool to automate the repetitive tasks and helps to build software. Ant is flexible and does not impose coding conventions. It supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications.

Install Apache Ant 


1) Download Ant
$ wget http://www.us.apache.org/dist/ant/binaries/apache-ant-1.9.2-bin.tar.gz
2) Extract using tar command
$ sudo tar xvfvz apache-ant-1.9.2-bin.tar.gz -C /opt
3) Check files if installed
$ sudo ln -s /opt/apache-ant-1.9.2 /opt/ant
4) Setup ANT environment variable by creating file called ant.sh under /etc/profile.d/ directory
$ vi /etc/profile.d/ant.sh
5) Add the following contents
export CLASSPATH=.
6) Save and close the file. Make it executable using the following command
$ chmod +x /etc/profile.d/ant.sh
7) Set the environment variables permanently by running the following command
$ source /etc/profile.d/ant.sh
8) Reboot your system.
9) Check the ant version using command
$ ant -version
10) Done
Maven : Install Maven on Linux Machine
In the previous post we have seen how to install JBoss web server on linux machine. This post will guide you to install Maven on the linux machine.

Maven is a project management tool from Apache based on POM (Project Object Model). It is declarative; All you have to do is create a pom.xml file and put your source in the default directory and it will take care of the rest.

Install Maven

1) Download Maven-tool
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
2) Install using yum command
sudo yum install -y apache-maven
3) Check version
mvn --version
4) Done
Back << Install JBoss on Linux                       Next >> Install Apache Ant on Linux
JBOSS Web Server : Install JBoss on Linux Machine

In the previous post we have seen how to install and setup MySQL on the linux machine. This post will guide you to install JBoss web server. JBoss is web server built on Apache and Tomcat 

Install JBoss Web Server

1) Download zipped JBoss 7.1.x in /opt directory

# wget http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.tar.gz -P /var/tmp
2) Extract using tar command 
# tar -zxf /var/tmp/jboss-as-7.1.1.Final.tar.gz -C /opt
3) Remove the zipped file using rm command
# rm -f /var/tmp/jboss-as-7.1.1.Final.tar.gz
4) Running JBOSS as root is a security risk. Run JBoss using a dedicated system user which will run the JBoss server using the sudo powers.
# useradd -r jboss -d /opt/jboss-as-7.1.1.Final

# chown jboss: -R /opt/jboss-as-7.1.1.Final
5) Enable access to JBoss interface by editing standalone.xml
# vim /opt/jboss-as-7.1.1.Final/standalone/configuration/standalone.xml
6) Change local IP ( address to public IP of machine
<interface name="management">
   <inet-address value="${jboss.bind.address.management:}"/>
<interface name="public">
   <inet-address value="${jboss.bind.address:}"/>
7) Set-up Jboss to run as a service
# cp /opt/jboss-as-7.1.1.Final/bin/init.d/jboss-as-standalone.sh /etc/init.d/jboss
# chmod +x /etc/init.d/jboss
# mkdir /etc/jboss-as
8) Create configuration file 
# vim /etc/jboss-as/jboss-as.conf
and add the following configuration parameters
9) Start JBoss service
# service jboss start
10) Done
Back << Install MySQL on Linux                                                     Next >> Install Maven on Linux
MySQL : Install MySQL on Linux Machine using yum

In the previous post we have seen how we can install java on the linux machine. This post will guide you how to install MySQL on linux machine using yum command.

Install MySQL

1) To install mysql server type the following yum command:

# yum install mysql-server mysql

2) Turn on mysql service, type the following chkconfig command

# chkconfig mysqld on

3) Start/Stop/Restart using one of the command

# service mysqld start
# service mysqld restart
# service mysqld stop

4) Set root user password

# mysqladmin -u root password NEWPASSWORD

5) Edit /etc/sysconfig/iptables to Add firewall rule

# vi /etc/sysconfig/iptables

6) Add line  

-A INPUT -m state --state NEW,ESTABLISHED -m tcp -p tcp --dport 3306 -j ACCEPT

7) Save and close by pressing Esc and :wq and hit enter

8) Restart iptable service

# service iptables restart

9) Done

Back << Install Java on Linux Machine                 Next >> Install JBoss on Linux Machine

Java : Install on Linux machine using yum command

Java is an object oriented language that can be installed on the linux machine using yum command. Follow these simple steps

1) Check list of available java versions

# sudo yum search java | grep -i --color JDK
2) Use yum command to install OpenJDK
# sudo yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel
3) Set JAVA_HOME environment variable using export command
# export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
4) Done