Wednesday, January 28, 2009

Setting NTP Server On Fedora Core 6

NTP or network time protocol is a protocol that will synchronize the time of a computer client or server to another server or reference time source, such as a radio or satellite receiver or modem. Typical NTP configurations utilize multiple redundant servers and diverse network paths in order to achieve high accuracy and reliability.
Follow the below setup to install your ntp server:

1. install ntp: $ yum install -y ntp

2. edit ntp.conf: $ vi /etc/ntp.conf
example of ntp.conf:
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict -6 ::1

# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.rhel.pool.ntp.org
#server 1.rhel.pool.ntp.org
#server 2.rhel.pool.ntp.org
#server mst.sirim.my prefer
#server my.pool.ntp.org

#broadcast 192.168.1.255 key 42 # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 key 42 # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 key 42 # manycast client

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
#server mst.sirim.my prefer
#server my.pool.ntp.org

# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
driftfile /var/lib/ntp/drift

# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys

# Specify the key identifiers which are trusted.
#trustedkey 4 8 42

# Specify the key identifier to use with the ntpdc utility.
#requestkey 8

# Specify the key identifier to use with the ntpq utility.
#controlkey 8

3. If the server you are setting up do not have internet connection, you can synchronize it with the local time of the server itself. Just comment the server part, and change it to 127.127.1.0. The sratum level is for determining what level this time server is set up for. Stratum 0 usually refers to real clock, for example atomic (cesium, rubidium) clocks or GPS clocks or other radio clocks. Stratum 1 is the machine connected to stratum 0 devices.

#server mst.sirim.my prefer
#server my.pool.ntp.org
server 127.127.1.0
fudge 127.127.1.0 stratum 10

4. synchronize the server's time with the ntp server: $ ntpdate -du mst.sirim.my

5. start ntp service: $ /etc/init.d/ntpd start

In the client machine, just type: $ ntpdate -du ntpservername. You can also put this command in crontab for the client to be update frequently

Tuesday, January 13, 2009

Installing NTP Server on Ubuntu 8.10 (Intrepid Ibex)

gede@Telkom-Time-Server:~$ sudo apt-get install ntp

Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
ntp-doc
The following NEW packages will be installed:
ntp
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 487kB of archives.
After this operation, 1221kB of additional disk space will be used.
Get:1 http://id.archive.ubuntu.com intrepid-updates/main ntp 1:4.2.4p4+dfsg-6ubuntu2.2 [487kB]
Fetched 487kB in 2s (175kB/s)
Selecting previously deselected package ntp.
(Reading database ... 155079 files and directories currently installed.)
Unpacking ntp (from .../ntp_1%3a4.2.4p4+dfsg-6ubuntu2.2_amd64.deb) ...
Processing triggers for man-db ...
Setting up ntp (1:4.2.4p4+dfsg-6ubuntu2.2) ...
* Starting NTP server ntpd

Ubuntu Server:Install GUI and Webmin in Ubuntu 8.10 (Intrepid Ibex) Guide

1) Install desktop Environment

First you nee to make sure you have enabled Universe and multiverse repositories in /etc/apt/sources.list file once you have enable you need to use the following command to install GUI

sudo apt-get update

sudo apt-get install ubuntu-desktop

The above command will install GNOME desktop if you want to install KDE desktop use the following command

sudo apt-get install kubuntu-desktop

2) Install Webmin

Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.Currently There is no Webmin package in the Ubuntu repositories.This tutorial will explain how to Install Webmin in Ubuntu Intrepid Ibex

You can install webmin for your server web interface to configure apache2,mysql,FTp servers and many more.Now we will see how to install webmin in Ubuntu 8.10

Preparing your system

First you need to install the following packages

sudo aptitude install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl

Now download the latest webmin using the following command or from here

wget http://garr.dl.sourceforge.net/sourceforge/webadmin/webmin_1.441_all.deb

Now we have webmin_1.441_all.deb package install this package using the following command

sudo dpkg -i webmin_1.441_all.deb

This will complete the installation.

Ubuntu in particular don’t allow logins by the root user by default. However, the user created at system installation time can use sudo to switch to root. Webmin will allow any user who has this sudo capability to login with full root privileges.

Now you need to open your web browser and enter the following

https://your-server-ip:10000/

Installing Apache on Ubuntu 7.10 (Gusty Gibbon)

From the terminal screen, type “sudo apt-get install apache2″:

Note: The default document root is “/var/www/”.

noland@mojito:~$ sudo apt-get install apache2
[sudo] password for noland:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-mpm-worker apache2-utils apache2.2-common libapr1 libaprutil1 libpq5
Suggested packages:
apache2-doc
The following NEW packages will be installed:
apache2 apache2-mpm-worker apache2-utils apache2.2-common libapr1 libaprutil1 libpq5
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 2182kB of archives.
After unpacking 6226kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com gutsy/main libapr1 1.2.7-8.2ubuntu1 [112kB]
Get:2 http://us.archive.ubuntu.com gutsy/main libpq5 8.2.5-1.1 [227kB]
Get:3 http://us.archive.ubuntu.com gutsy/main libaprutil1 1.2.7+dfsg-2build1 [70.2kB]
Get:4 http://us.archive.ubuntu.com gutsy/main apache2-utils 2.2.4-3build1 [346kB]
Get:5 http://us.archive.ubuntu.com gutsy/main apache2.2-common 2.2.4-3build1 [946kB]
Get:6 http://us.archive.ubuntu.com gutsy/main apache2-mpm-worker 2.2.4-3build1 [439kB]
Get:7 http://us.archive.ubuntu.com gutsy/main apache2 2.2.4-3build1 [41.8kB]
Fetched 2182kB in 2s (730kB/s)
Selecting previously deselected package libapr1.
(Reading database ... 99159 files and directories currently installed.)
Unpacking libapr1 (from .../libapr1_1.2.7-8.2ubuntu1_i386.deb) ...
Selecting previously deselected package libpq5.
Unpacking libpq5 (from .../libpq5_8.2.5-1.1_i386.deb) ...
Selecting previously deselected package libaprutil1.
Unpacking libaprutil1 (from .../libaprutil1_1.2.7+dfsg-2build1_i386.deb) ...
Selecting previously deselected package apache2-utils.
Unpacking apache2-utils (from .../apache2-utils_2.2.4-3build1_i386.deb) ...
Selecting previously deselected package apache2.2-common.
Unpacking apache2.2-common (from .../apache2.2-common_2.2.4-3build1_i386.deb) ...
Selecting previously deselected package apache2-mpm-worker.
Unpacking apache2-mpm-worker (from .../apache2-mpm-worker_2.2.4-3build1_i386.deb) ...
Selecting previously deselected package apache2.
Unpacking apache2 (from .../apache2_2.2.4-3build1_all.deb) ...
Setting up libapr1 (1.2.7-8.2ubuntu1) ...
Setting up libpq5 (8.2.5-1.1) ...Setting up libaprutil1 (1.2.7+dfsg-2build1) ...

Setting up apache2-utils (2.2.4-3build1) ...
Setting up apache2.2-common (2.2.4-3build1) ...
Module alias installed; run /etc/init.d/apache2 force-reload to enable.
Module autoindex installed; run /etc/init.d/apache2 force-reload to enable.
Module dir installed; run /etc/init.d/apache2 force-reload to enable.
Module env installed; run /etc/init.d/apache2 force-reload to enable.
Module mime installed; run /etc/init.d/apache2 force-reload to enable.
Module negotiation installed; run /etc/init.d/apache2 force-reload to enable.
Module setenvif installed; run /etc/init.d/apache2 force-reload to enable.
Module status installed; run /etc/init.d/apache2 force-reload to enable.
Module auth_basic installed; run /etc/init.d/apache2 force-reload to enable.
Module authz_default installed; run /etc/init.d/apache2 force-reload to enable.
Module authz_user installed; run /etc/init.d/apache2 force-reload to enable.
Module authz_groupfile installed; run /etc/init.d/apache2 force-reload to enable.
Module authn_file installed; run /etc/init.d/apache2 force-reload to enable.
Module authz_host installed; run /etc/init.d/apache2 force-reload to enable.

Setting up apache2-mpm-worker (2.2.4-3build1) ...
* Starting web server apache2 OK ]

Setting up apache2 (2.2.4-3build1) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place

You can now place your files in "/var/www/"

Monday, January 12, 2009

gOS 3.1 Gadgets (SP1) Linux for The Rest of Us

gOS 3.1 Gadgets instantly launches Google Gadgets for Linux on startup, introducing over 100,000 possible iGoogle and Google Gadgets to the desktop.

Google Documents, Calendar, and Mail launch in Mozilla Prism windows to closer resemble desktop applications.

The newest release of WINE 1.0 is included to now support thousands of Windows software for our advanced users.

gOS 3.1 Gadgets is based on the solid Linux distribution base of Ubuntu 8.04.1.

Link : http://www.thinkgos.com/gos.php

Friday, January 09, 2009

Installing OpenNMS on Debian-Based Distributions

These instructions cover installation for most Debian-Based distributions (Debian, Ubuntu, etc.)

Add the OpenNMS Repository to Your sources.list

First, you need to tell apt-get how to find OpenNMS. Add the following contents to your /etc/apt/sources.lists file:

 deb http://debian.opennms.org stable main
deb-src http://debian.opennms.org stable main

(If you wish the latest development version of OpenNMS, which may include features not available in the current stable release, use unstable instead of stable.)

 deb http://debian.opennms.org unstable main
deb-src http://debian.opennms.org unstable main

Add the OpenNMS PGP Key to APT

The official OpenNMS packages are signed with a GPG / PGP key. The fingerprint for the official release key is:

 22EE DDA6 8698 B02F B2EC  50B7 062B 8A68 4C4C BBD9

You will need to tell APT about the key:

 wget -O - http://debian.opennms.org/OPENNMS-GPG-KEY | sudo apt-key add -

On Debian 4.0 (etch) and Ubuntu 7.10 (gutsy) or newer

As Sun Java has been put under the GPL it's sufficient to type "apt-get install opennms" since Debian 4.0 (etch) or Ubuntu 7.10 (gutsy); the dependencies will be fulfilled automatically.

On older Debian and Ubuntu releases

Installing on older Debian or Ubuntu releases involves additional steps to get a Sun Java 5 or Java 6 JDK. Instructions are available online, but if possible, save yourself the trouble and use a newer release that includes Sun Java in the default repositories.

Configure OpenNMS

First, for the purposes of convenience, we are going to set the $OPENNMS_HOME environment variable before running any commands.

 export OPENNMS_HOME=/usr/share/opennms

(If you are not using a bourne-compatible shell, you may need to use different syntax.)


Configure Your Database

OpenNMS needs to be able to connect to PostgreSQL as the "postgres" user (by default) over a TCP/IP connection.

RedHat-based systems
/etc/init.d/postgresql start
/sbin/service postgresql start
pg_hba.conf and postgresql.conf are in /var/lib/pgsql/data
Debian-based systems
/etc/init.d/postgresql-X.X start
pg_hba.conf and postgresql.conf are in /etc/postgresql/X.X/main
Mac OS X (Fink)
/sw/bin/pgsql.sh start

Edit pg_hba.conf to Allow postgres to Authenticate

To allow the "postgres" user to connect, you will need to edit your database's pg_hba.conf file, which is usually created on installation or the first startup of PostgreSQL, depending on your distribution: By default, it will have something like this at the bottom:

 local   all         all                               ident sameuser
host all all 127.0.0.1/32 ident sameuser
host all all ::1/128 ident sameuser

You will need to change "ident sameuser" to "trust":

 local   all         all                               trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust

Edit postgresql.conf to Allow TCP/IP Connections

You may also need to change the postgresql.conf to allow TCP/IP connections, if it cannot do so already. On older PostgreSQL versions, this is enabled with the flag:

 tcpip_socket = true

On newer PostgreSQL versions, this is enabled with:

 # you can use "*" to listen on all addresses
listen_addresses = 'localhost'

Restart the Database

Once you've made these changes, you need to restart your database.

Create the opennms Database

If not done, use "sudo -u postgres createdb -U postgres -E UNICODE opennms" to create the database in postgres.

Insert the IPLIKE Stored Procedure in the Database

If this is your first time installing OpenNMS or iplike, you should make sure that iplike is configured in your database. First you need to install the iplike package from OpenNMS package repositories.

For RPM-based distributions using YUM:

 yum install iplike

For DEB-based distributions using APT (use suffix pgsql74, pgsql81, pgsql82, or pgsql83 according to the version of PostgreSQL on your system):

 apt-get install iplike-pgsql83

If the OpenNMS database is already configured, you are good to go. If not, you have to issue manually:

 install_iplike.sh

Tell OpenNMS Where to Find Java

OpenNMS needs to know where to find Java to be able to start up. To tell it how to do so, you run $OPENNMS_HOME/bin/runjava like so:

 $OPENNMS_HOME/bin/runjava -s

This will search $JAVA_HOME and other common locations for your JDK. If you wish to use a specific JDK, you can run it with the -S flag instead:

 $OPENNMS_HOME/bin/runjava -S /usr/java/jdk1.5.0_12/bin/java

Add the JAVA_HOME in /etc/default/opennms

 JAVA_HOME=/usr

Initialize OpenNMS and the Database

Next, you need to run the OpenNMS installer, which will initialize the OpenNMS database, and do some other basic setup. Upon upgrade, you should run this command again to make sure your database schema and other things required at startup are up-to-date.

In most cases, you can just run:

 $OPENNMS_HOME/bin/install -dis

Sometimes you may need to tell OpenNMS where to find libjicmp.so; in that case, you can use the -l option (OpenNMS 1.3.5 and higher):

 # i386 example
$OPENNMS_HOME/bin/install -dis -l /usr/lib/jni:/usr/lib
# x86_64 example
$OPENNMS_HOME/bin/install -dis -l /usr/lib64/jni:/usr/lib64

Start OpenNMS

You should have a basic OpenNMS installation ready now, so start it up:

 sudo /etc/init.d/opennms start

As of OpenNMS 1.3.7, by default, the web UI will come up using the embedded Jetty servlet container, on port 8980. Open your browser and point it at:

 http://yourhost:8980/opennms/

the user name and password are both "admin" to start.