Thursday, March 31, 2011

Ubuntu Linux: Uninstall / Remove Any Installed Software

GUI Package Management Tool

synaptic is graphical management tool of software packages. It allows you to perform all actions of the command line tool apt-get in a graphical environment. This includes installing, upgrading, downgrading and removing of single packages or even upgrading your whole system.
Just click on System > Administration > Synaptic Package Manager
Now you can select any package and click on Mark for Removal popup meni. You can also start GUI tool from command line, enter:$ synaptic &

Command Line Package Management Tool

apt-get is the command-line tool for handling packages. It is used for adding / removing / updating packages.

Uninstall / Delete / Remove Package

Just use the following syntax:
sudo apt-get remove {package-name}
For example remove package called mplayer, enter:$ sudo apt-get remove mplayer
Remove package called lighttpd along with all configuration files, enter:$ sudo apt-get --purge remove lighttpd
To list all installed package, enter:\dpkg --list
dpkg --list | less
dpkg --list | grep -i 'http'

Tuesday, March 29, 2011

htpasswd Tutorial

If you would like to have a set of web pages that are protected, requiring a username/password to gain access, this tutorial will show you how to set it up. This is geared towards the Unix Apache httpd servers used on holly, lamar, and www.colostate.edu. If you are using another web server, you'll need to check that server's documentation to see how to do this.

Steps to Password-protect a Directory

First, create a subdirectory in your web area. For the sake of this tutorial, I have created the "protect" directory. Set the permissions on the directory so that the server has read/execute. I do this by using the local command chgrp-www to set the group to the www group. This is the group that the server runs under at Colorado State University for the lamar, holly and www servers. I have used the -sd flag which sets "set group id" for a directory. This will then force any files you create within the protect directory to the www group, so if you ftp files to this directory they will be automatically readable by the server but not by any other user on the system. I then cd into the protect directory.
cd ~ric/public_html
mkdir protect
chmod g+r,g+x,o-r,o-x protect
chgrp-www -sd protect
cd protect

Monday, March 28, 2011

How to fix “X: user not authorized to run the X server, aborting.”?

This is just a simple tips to solve a error message when you start your X session with “startx” command as normal user. The error message may be like this:

blackgod@debian:~$ startx

xauth: creating new authority file /home/blackgod/.Xauthority

X: user not authorized to run the X server, aborting.


In linux, by default root user is allowed to run X server in most cases. So you don’t face this issue while running “startx” as root user.

Basically the Xorg X server needs to be configured to to authorize this user. Where should we configure this?

/etc/X11/Xwrapper.config – This file has as setting called “allowed_users”. It can accept three values:

1. root
2. anybody
3. console

The above values are self explanatory. You can edit this value to set as anybody for normal user to start X server. If normal user starts X server from console, console can also be set. It can be like this.


allowed_users=anybody

In Debian and its derivatives like Ubuntu, you can run the following command to do it in user friendly screen as shown below.


# dpkg-reconfigure x11-common


Nagios : Ubuntu Quickstart

Introduction

This guide is intended to provide you with simple instructions on how to install Nagios from source (code) on Ubuntu and have it monitoring your local machine inside of 20 minutes. No advanced installation options are discussed here - just the basics that will work for 95% of users who want to get started.

These instructions were written based on an Ubuntu 6.10 (desktop) installation. They should work for an Ubuntu 7.10 install as well.

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/


4 Steps to Define Nagios Contacts With Email and Pager Notification

Nagios is one of the best open source server and network monitoring solutions available.  Using the flexible nagios framework, you can monitor pretty much anything (including database and custom application). This article, using 4 simple steps, explains how to setup contact definitions who will get notification when a host or service has any issues.
 
Earlier we also discussed about how to setup Nagios and monitor Windows servermonitor Linux Servermonitor VPN sessions and monitor network switch.

1. Define Generic Contact Template in templates.cfg

Nagios installation gives a default generic contact template that can be used as a reference to build your contacts. Please note that all the directives mentioned in the generic-contact template below are mandatory. So, if you’ve decided not to use the generic-contact template definition in your contacts, you should define all these mandatory definitions inside your contacts yourself.
 
The following generic-contact is already available under /usr/local/nagios/etc/objects/templates.cfg. Also, the templates.cfg is included in the nagios.cfg by default as shown below.