Posts

Showing posts with the label Linux

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

How to install SVN Client on CENT OS 6

It is quite easy to install SVN Client using YUM command line manage utility on CENT OS 6. Install : # yum clean all # yum install subversion Verify Subversion :  # svn --version Thanks..!!!

How to extract a JSON value from a BASH script

Requirement : I was working on shell script where I need to get Id value from JSON and I tried so many thing but unable to get it without using any other tools. So, After trying so many failure attempt, I end up with this site (A big thanks to you) which resolved my issue. Here is how I fetched value from JSON, JSON = <YOUR_JSON> PROPERTY_TO_FETCH="<VALUE>" (In my case, it was "id") ID = `echo $JSON| sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $PROPERTY_TO_FETCH` echo ${ID ##*|} Which will print the value of 'id' from JSON.

How to set permanent IP in Ubuntu ?

Image
Steps : *) Open the interfaces file :           sudo vi /etc/network/interfaces If you are using DHCP you will see the following lines :           auth eth0           iface eth0 inet dhcp  *) To make it static, Change the line iface eth0 inet dhcp to iface eth0 inet static and add the following just below it: address 10.35.34.209 (IP address that you need to set) netmask 255.255.255.0 (Default mask which in this case is the default class c subnet) gateway 10.35.34.1 (Typically your router’s IP address) network 10.35.34.0 (The network that this machine is running on) broadcast 10.35.34.255 Here is a screenshot of how it should look below : *) Once you save this file you need to restart your networking service.        sudo /etc/init.d/networking restart or         sudo service networking restart Note :   /etc/init.d/networking restart command i...

What is RPM and How to build your RPM?

Introduction RPM (RPM Package Manager) is a popular utility for installing software on Unix-like systems, particularly Red Hat Linux. The name RPM variously refers to the .rpm file format. I t is an open packaging system available for anyone to use. It allows users to take source code for new software and package it into source and binary form such that binaries can be easily installed and tracked and source can be rebuilt easily. It also maintains a database of all packages and their files that can be used for verifying packages and querying for information about files and/or packages. Design Goals RPM provides the capability to install an entire application with a single command, to track the files it put on the system, and to remove those files by using another single command. Make it easy to get packages on and off the system. Make it easy to verify a package was installed correctly. Make it easy for the package builder. Make it start with original s...

chkconfig Command Examples

chkconfig command is used to setup, view, or change services that are configured to start automatically during the system startup. chkconfig has five distinct functions: adding new services for management, removing services from management, listing the current startup information for services, changing the startup information for services, and checking the startup state of a particular service. chkconfig --list [ name ] chkconfig --add name chkconfig --del name chkconfig [ --level levels ] name < on | off | reset > chkconfig [ --level levels ] name   OPTIONS --level levels Specifies the run levels an operation should pertain to. It is given as a string of numbers from 0 to 7. For example, --level 35 specifies runlevels 3 and 5. --add name This option adds a new service for management by chkconfig . --del name The service is removed from chkconfig management. --list name This option lists all of the services which chkconfig...

How to find exact version of Red Hat Linux

[root@localhost ]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.2 (Tikanga) For others: Slackware: /etc/slackware-version Mandrake: /etc/mandrake-release Red Hat: /etc/redhat-release Fedora: /etc/fedora-release

How to install libflashplayer.so on linux

When we trying to install the flash player for your linux operating system, we download file libflashplayer.so but we do know where to put this file. This article guild you step by step to install the flash player for linux. Step 1: Go to Adobe website and download you suitable version of flash player libflashplayer.so 32-bit/64bit . Then extract it to libflashplayer.so File. Step 2: cd to the folder has file libflashplayer.so and install If you are using FireFox: sudo mv libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so   If you are using Google Chrome + Firefox sudo mv libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so sudo mkdir /opt/google/chrome/plugins sudo cp /usr/lib/flashplugin-installer/libflashplayer.so  /opt/google/chrome/plugins Thanks.

Basic Linux Commands

*) How to extract tr.gz. file To extract one or more members from an archive :               tar -zxvf {file.tar.gz} For example, If your tar name is backup.tar.gz, enter the following at a shell prompt:               tar -zxvf backup.tar.gz *) How to run .bin file Change the permission of the file you downloaded to be executable. Type the following command:               $ chmod +x file.bin Start the installation process or run .bin file.Type the following command:               ./file.bin For example if .bin file name is application.bin. Type:         $ chmod +x application.bin         $ ./application.bin *) How to set a BASH variable equal to the output from a command? Use $(), which I find easier to read, and allows for nesting.         OUTPUT=$(ls -1) echo $OUTPUT *) How to read IP ...

How to Set JAVA_HOME / PATH variables Under Linux

Image
After installing Java Development Kit on Linux/Unix, you may still need to do some configuration to get Java ready for running or compiling Java programs. The following instruction will guide you through the process of setting up JDK for software development. In Linux, ~/.bash_profile is a startup script which generally runs once. This particular file is used for commands which run when the normal user logs in. Common uses for .bash_profile are to set environment variables such as PATH, JAVA_HOME, to create aliases for shell commands, and to set the default permissions for newly created files. Set JAVA_HOME / PATH for single user Login to your account and open .bash_profile file $ cd $HOME $ vi ~/.bash_profile Set PATH and JAVA_HOME as follows:   PATH=$PATH:$HOME/bin:/usr/jdk1.6.0_30/bin JAVA_HOME=/usr/jdk1.6.0_30 Note: Don't delete the previous PATH, Just append the jdk path after : like "/usr/jdk1.6.0_30/bin" as above . export PATH export JAVA_...