Thursday, 18 April 2013

How to Install Tomcat 7 on Ubuntu 12



Install Tomcat 7 on Ubuntu             

Step: 1

Install java check this post 

                         Step: 2
Download Tomcat 7 tar.gz binary distribution from Here.
                          Step: 3
Unpack it using following command.
tar -xvzf apache-tomcat-7.0.35.tar.gz
                           Step :4
Move it to a more appropriate location using following command.
sudo mv apache-tomcat-7.0.35/ /usr/local/tomcat7
                           Step :5
Open up /usr/local/tomcat7/bin/catalina.sh file using following command
vim /usr/local/tomcat7/bin/catalina.sh
Add following two lines in there after the first line.
JAVA_HOME="/usr/java/jdk1.7.0_11" 
JRE_HOME="/usr/java/jdk1.7.0_11/jre"

                           Step :6

Open /usr/local/tomcat7/conf/tomcat-users.xml and Then add a manager-gui & admin-gui role along with user details as below.

#vi /usr/local/tomcat7/conf/tomcat-users.xml
remove the </tomcat-users> tag and insert below line

<!-- user admin can access manager and admin section both -->
<role rolename="admin-gui" />
<user username="admin" password="redhat" roles="manager-gui,admin-gui" />

</tomcat-users>
:wq!

                            Step :7
Start the Tomcat server using following command.

sudo/usr/share/tomcat7/bin/catalina.sh run
                              Step :8
Verify Tomcat installation using the following URL

http://127.0.0.1:8080


Or

http://localhost:8080

To login as the manager, use the following URL, provide the relevant username and password

http://localhost:8080/manager/html



                                         

How to install nagios in Linux step by step



                   

What is nagios ?

Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. It has been designed to run under the Linux operating system. The monitoring daemon runs intermittent checks on hosts and services you specify using external "plugins" which return status information to Nagios. When problems are encountered, the daemon can send notifications out to administrative contacts in a variety of different ways (email, instant message, SMS, etc.). Current status information, historical logs, and reports can all be accessed via a web browser.



Nagios Features

Nagios has a lot of features, making it a very powerful monitoring tool. Some of the major features are listed below:

Monitoring of network services (SMTP, POP3, HTTP, NNTP, PING, etc.)

Monitoring of host resources (processor load, disk and memory usage, running processes, log files, etc.)

Monitoring of environmental factors such as temperature



What You'll End Up With
If you follow these instructions, here's what you'll end up with:
  • Nagios and the plugins will be installed underneath /usr/local/nagios
  • Nagios will be configured to monitor a few aspects of your local system (CPU load, disk usage, etc.)
  • The Nagios web interface will be accessible at http://localhost/nagios/
Required Packages
Make sure you've installed the following packages on your Ubuntu installation before continuing.
  • Apache 2
  • PHP
  • GCC compiler and development libraries
  • GD development libraries
You can use apt-get to install these packages by running the following command for Ubuntu for redhat and fedora use yum install command 

1. Installation Process............

For Linux and Fedora
# yum -y install httpd* ( To install Apache)
# yum -y install php* (To install PHP)
# yum -y install gcc, yum -y install gcc-c++, yum -y install glibc (To Install GCC )
# yum -y install gd gd-devel (To Install GD)


For Ubuntu and Debian
$sudo apt-get install apache2
$sudo apt-get install libapache2-mod-php5
$sudo apt-get install build-essential

2. Create a new nagios user account and give it a password.
# useradd nagios
Create a new nag group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to that group.
# groupadd nagcmd
# usermod -a -G nagcmd nagios
# usermod -a -G nagcmd apache
3. Download the Package
Download nagios tar file along with the plugins
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.3.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz


4. Install the Package
Now go to the folder or directory where you have downloaded the files. In my case it is Download or /tmp and the below command ...........To install Nagios

# cd /tmp
# tar xzf nagios-3.2.0.tar.gz
# cd nagios-3.2.0
# ./configure –with-command-group=nagcmd
# make all
# make install
# make install-init
# make install-config
# make install-commandmode

5. Configure the Web Interface
Install the Nagios web config file in the Apache conf.d directory.
make install-webconf
Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Restart Apache to make the new settings take effect.
service httpd restart 
 
7.Compile and Install the Nagios Plugins
# cd /tmp
# tar xzf nagios-plugins-1.4.11.tar.gz
# cd nagios-plugins-1.4.11
# ./configure –with-nagios-user=nagios –with-nagios-group=nagios
# make
# make install

8. Start Nagios
Now start Nagios and add it to the list of system services.
# service nagios start
/etc/init.d/nagios start
# chkconfig nagios on
9. Login to the Web Interface
You should now be able to access the Nagios web interface at the URL below. You'll be prompted for the username (nagiosadmin) and password you specified earlier.
http://localhost/nagios/



10. Add host to Configure file
We are done with the basic installation of nagios and its corresponding plugins. Now, I will show you how to monitor a group of hosts. On successful completion of the installation you will find localhost.cfg in the following path.
/usr/local/nagios/etc/objects/localhost.cfg
In short localhost.cfg is used to define the hosts and services that we want to monitor on the host system.(Host system here refers to the one we want to monitor)
open this file and add the following next to host definition lines.
define host{
use linux-server
host_name rahul-desktop
address 10.10.10.142
}
use – (uses the default template defined in templates.cfg)
host_name – (hostname can be anything)
address- (address of the host)
Now save the file and restart Nagios.
service nagios restart
NOTE: Make sure you dont add anything to this file because if you are new to nagios debugging would be difficult.
Now you can check the output in the browser.
http://localhost/nagios

11. You're Done
Congratulations! You sucessfully installed Nagios. Your journey into monitoring is just beginning. You'll no doubt want to monitor more than just your local machine, so check out the following docs of Nagios official website ..........

CONFIGURE X Window How To Get Your X Back


CONFIGURE X How To Get Your X Back


          In case of pure disaster you can lose your X, and mess up your X-Config file. This tells you how to fix that.
In the case of a failing X you get thrown back to the prompt in a text console in runlevel 3, just to check that do:

$ root   ( not "su" because you´re not logged in as user yet )
< password >
# init 3


This because the following actions should absolutely not be done in another run level. ( In Ubuntu and Debian please boot up in "safe mode" )


We stay logged in as root and first do:

# Xorg -configure

The screen will go black for a few seconds because it will generate an new xorg.conf file, it will put a “xorg.conf.new” in root's home directory ( /root ). . . . so check this with:

# ls   /root
If the file is indeed there we can first check if it works with this command:

# Xorg -config /root/xorg.conf.new

You should get a gray ( or blue ) screen with an X-shaped mouse cursor, this means it´s working. If so we get back to the prompt with:
< Ctrl+Alt+Backspace >

Now we back up the old xorg.conf file, just to be sure we can compare later if needed:

# cp /etc/X11/xorg.conf /etc/X11/xorg.conf-BACKUP

Next we move the new xorg.conf file to its place:

# mv /root/xorg.conf.new /etc/X11/xorg.conf

I hope all went smooth up until now, because then we can:

# reboot

Monday, 8 April 2013

How to Run Windows or Linux in Ubuntu on Virtual Machine

How to Run Windows or Linux in Ubuntu


Guest Operating System : RHEL or Windows
Host Operarting System : Ubuntu 12.04

Steps
1. Download the ISO file of Ubuntu 12.04 or 12.10 from HERE
2. Download the VirtualBox Sofware for the appropriate Host OS. In our case host operating System: Ubuntu HERE



                                                                VirtualBox Download Page

3. After Downloading the VirtaulBox Software,  install  it.
To install run this command on terminal
rahul@rahul-desktop:~/Downloads$ sudo dpkg -i virtualbox-4.2_4.2.6-82870~Ubuntu~precise_i386.deb
4. Open VirtaulBox(Oracle VM). Click on the NEW button.

                                                           Virtual Machine Name & OS type

5. Click on the NEXT button. Assign a name to the Virtual Machine. Select the appropriate OS and version . In our case give OS as LINUX and Version as Redhat.Click on Next Button.

                                                          Virtual Machine :  Memory allocation


6. Select the amount of memory needed for the Virtual Machine according to your RAM size.
Minimum recommended size is 512 MB. Click on Next.

                                                         Create new Virtual Disk Wizard


7. If you want to create a VM using old *.vdi , then select "USE EXISTING HARD DISK". Otherwise
select  "Create New hard Disk".Click Next Button.

8. Create New Virtual Disk Wizard. Select the appropriate File Type. Click Next Button.

                                                        Create new Virtual Disk Wizard

 9. Select Fixed Size or  Dynamic size allocation. Click next Button and select the appropriate size and Location

10. Then click on Create Button.It will take sometime to create the VM.

11. After Completion of the VM , click on Power Off Button or start  to Switch On the button.

12. If you are doing this for the first time, you  will get First Run Wizard. Click on Next Button. You need to provide the location of Ubuntu 12.04.iso,XP.iso  or redhat5.iso downloaded by you.

13. Then it will go through the Installation process of Ubuntu 12.04 or Redhat like any other normal OS installation.
After the installation . It will ask for the reboot of virtual machine(Note : Only virtual machine will be rebooted not your System.)

14. You are ready to go .

                                                           
                                   
                                                            OS: RHEL 5

                                   

                                                    OS:Windows XP



All the Best :)

Sunday, 7 April 2013

How to recover Grub in Ubuntu using Rescue commands

                  How to recover Grub in Ubuntu
If Grub is missing after installing Ubuntu and screen is showing Grub Rescue, then Ubuntu grub rescue or restore has to done. It can be done through Ubuntu Server CD or Ubuntu Desktop CD. 
If at system start up you might be seeing the option Grub Rescue or Grub missing option then you need to follow the below commands.

For Ubuntu grub rescue follow these steps:
1.Boot from the Ubuntu Desktop live CD. 



                      
Select Try Ubuntu.     

2.In Live Desktop session open terminal. 

  Application ->Accessories->Terminal. Or Dash home Type terminal

3. In Terminal tpye sudo fdisk -l  

    It will display all partiton of the disk.
                 
The partation which have Linux under System column is your drive in which ubuntu linux is installed. In screenshot ubuntu partition drive is /dev/sda1.

4. Mount the ubuntu partition drive
       sudo mount /dev/sdXX /mnt  (example 'sudo mount /dev/sda1 /mnt' ,don't miss the spaces.)

5.Only if you have a separate boot partition:
            sudo mount /dev/sdYY /mnt/boot.
 6.  Mount the virtual filesystems:
            
            sudo mount --bind /dev /mnt/dev
            sudo mount --bind /proc /mnt/proc 
            sudo mount --bind /sys /mnt/sys

7.
To ensure that only the grub utilities from the LiveCD get executed, mount /usr     

     sudo mount --bind /usr/ /mnt/usr 
     sudo chroot /mnt  

8. If there is no /boot/grub/grub.cfg or it's not correct, create one using 
           update-grub 
      or  update-grub2
9.Now reinstall Grub  
         grub-install /dev/sdX  (e.g. grub-install /dev/sda. Do not specify the partition number).   
 10. Verify the install 
        sudo grub-install --recheck /dev/sdX
11. Exit chroot : CTRL-D on keyboard.

12. Unmount virtual filesystems:  
           sudo umount /mnt/dev 
           sudo umount /mnt/proc
           sudo umount /mnt/sys 

If you mounted a separate /boot partition:  
           sudo umount /mnt/boot 

13. Unmount the LiveCD's /usr directory:
 

          sudo umount /mnt/usr

14. Unmount last device: 

           sudo umount /mnt
15. Reboot. 
         sudo reboot.

NOTE: If you are getting /usr/sbin/grub-probe: error: cannot stat 'aufs'  error then the possible reason is that you didn't follow the commands listed above.

Saturday, 6 April 2013

How to Download Torrent Files With IDM

How to Download Torrent with fast speed 

Downloading Torrent Files with IDM sounds Awesome.We can easily Download Torrent Files With IDM By Zbigz.com an Alternative To Torrific.com.After The End Of Torrific.com Zbigz.com Came Into Existence and Once again put Smiles On the Faces that where Waiting for s a site from Where They Can Download Torrent Files Via Internet Download Manager.

How To Download Torrent With IDM Via Zbigz.com:

1)Go To A Torrent Site And Download A Torrent,that you want to Download With IDM HERE
2)Go To Zbigz.com
3)Upload The Torrent To zbigz.com and then Click On Go.


                              
4)Then A window Will open asking FOr Free 

                         

5)GO for Free If you have  A free Account.After choosing Free your Torrent Will be Downloaded  by High speed Servers at Zbigz.com  and will be ready For Download as a Zip.
                           

6)Now Just Click On Zip Button And It will Be ready For Download in the Idm


                            
                          

7) Now Torrent Is ready to be Downloaded From Torrent and You Get The Torrent in just A short period Of time Due To IDM Fast Speed.
Enjoy ...........

Tuesday, 2 April 2013

How To Install Video Downloader In Linux Mint / Ubuntu

How To Install JDownloader In Linux Mint / Ubuntu

JDownloader is an awesome and free download manager that supports a large number of file sharing websites.

Here is how to install it on Linux Mint / Ubuntu :
1. First add the appropriate jdownloader PPA by opening Terminal and typing :
sudo add-apt-repository ppa:jd-team/jdownloader


 

2. Next update the Linux Mint / Ubuntu repository by typing :
sudo apt-get update
                     

3. Finally install the jdownloader application :
sudo apt-get install jdownloader


Note : if you try to directly install using step 3, it won’t be recognized as the jdownloader
repository by default is not added to Ubuntu and Linux Mint, hence the first
two steps are required to do that.

This will install it and then launch the web update, once update is complete get
ready to download stuff using the cool JDownloader from within Linux Mint / Ubuntu 
To Start

1.Go to Dash home and type jdownloader And flow the steps ..............

2.This will Update the plugging ......... 



3.Chose the Language and Press OK

4.Copy the link and pest and start downloading





Enjoy Downloading .................