How to configure vpn client on Linux

This has been tested under RHEL 4/5, CentOS 4.4/5 and fedora 8 (kernel version 2.6.15+)

I found and stored few required rpm packages from various places that you will download from given.

http://www.4shared.com/file/113579629/ee5e0aed/libglade-017-11i386.html

http://www.4shared.com/file/113579642/2fd674e3/libglade-devel-017-11i386.html

http://www.4shared.com/file/113579654/dfaee097/libxml-1817-8i386.html

http://www.4shared.com/file/113579677/7491d3af/libxml-devel-1817-8i386.html

http://www.4shared.com/file/113579714/ba004fa4/php4-pcntl-449-1fc5i386.html

http://www.4shared.com/file/113579747/5e7eea5b/php4-pcntl-gtk-102-4fc5i386.html

http://www.4shared.com/file/113579758/d7dac68b/pptp-172-3fc5i386.html

http://www.4shared.com/file/113579764/f541d963/pptpconfig-20060821-1fc5noarch.html

After downloading these first you will have to install lib packages and then pptp packages

rpm -ivh –nodeps libglade-0.17-11.i386.rpm libglade-devel-0.17-11.i386.rpm  libxml-1.8.17-8.i386.rpm libxml-devel-1.8.17-8.i386.rpm

rpm -ivh pptp-1.7.2-3.fc5.i386.rpm pptpconfig-20060821-1.fc5.noarch.rpm php4-pcntl-gtk-1.0.2-4.fc5.i386.rpm php4-pcntl-4.4.9-1.fc5.i386.rpm

now go to the given image that I would like to show how I added vpn connection

1) open vpnclient configuration launchpad with “pptpconfig”

pptp1

2)  Now create your profile with all the details and add

pptp3

Now you have to set you external route or tunnel IP range into it for that click on “Routing” and set  “All to Tunnel” and update your profile.

Now start your vpn client.

–Ravi

Automate script for hp_ltt with read option

Hello Friends,

Many days back, I have configured this storageworks devices of HP and nowadays one of my friend is having like the same issue’s with the os’s to configuring HP storageworks, he has been doing manual driver scan with hp_ltt tool every time when system has been rebooted. Actually there some thing missing with os’s but still this scripts work for him now.

#!/usr/bin/expect  –
# This expect script is useful and working with driver Diagnostic automated tool
# I have tested this over “HP StorageWorks Library and Tape Tools”
# Please change the option number 10 for rescan as per mention in your hp_ltt script.
# Some older hp_ltt script it has option number 9, so please check once this option.
# If you have any queries about this script please send email on ravi <at> indiangnu <dot> org
set timeout -1
spawn ./hp_ltt
match_max 100000
send — “\r”
# Look for prompt
expect “ommand>”
# Send option 1 for hardware scan
send — “1\r”
send — “\r”
# Look for  prompt
expect “ommand>”
# Send option 3 for continue
send — “3\r”
send — “\r”
# Look for prompt
expect “ommand>”
# send option 10 for rescan
send — “10\r”
send — “\r”
# Look for prompt
expect “ommand>”
# Send 1 (exit) from L & TT
send — “1\r”
send — “\r”
expect eof

Suggestion : You have to run this expect script under the $HOME folder of hp_ltt script.

-Ravi

Configure the Tape Library in Linux

To check autoloader/library detected or not, give command

[root@localhost ~]# cat /proc/scsi/scsi

If it is not show changer, Do following steps

Check the version of Redhat Linux

If it is Redhat Linux 3

Add following line in /etc/modules.conf

“options scsi_mod max_luns=255”

“options scsi_mod scsi_noreportlun=1”

If it is Redhat Linux 4

Add following line in /etc/modprobe.conf

“options scsi_mod max_luns=255”

“options scsi_mod scsi_noreportlun=1”

Then create new initrd file…..

[root@localhost ~]#cd /boot

Rename initrd file

[root@localhost ~]# mv initrd-`uname –r`.img initrd-`uname-r`.main

e.g. mv initrd-2.6.9-42.EL.img initrd-2.6.9-42.EL.main

[root@localhost ~]# mkinitrd initrd-`uname –r`.img `uname –r`

e.g. mkinitrd initrd-2.6.9-42.EL.img 2.6.9-42.EL

At the end REBOOT your Linux box.

-Thanks

Ravi

How to Apache-Tomcat on Linux

What is Tomcat

Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.

From the authors point of view: –tomcat.apache.org
Prerequisites
– java

Download java

Go to http://java.sun.com/javase/downloads/?intcmp=1281 choose your platform and follow the steps on the site.

Installing the binaries
The installation of the Java Developer’s Kit is pretty straightforward if if you retrieve the RPM for it. If you have to download the RPM from Sun’s site, it isn’t acutally in RPM format yet. It’ll be called something like j2sdk-xxx-linux-rpm.bin. chmod 700 it and execute it. This will run the Sun EULA and after you agree to it, generate the actual RPM file.

Execute the binary:
chmod +x jdk-xxx-linux-i586-rpm.bin

After the RPM is produced, install it simply by running rpm -ivh jdk-xxx-linux-i586-rpm. This will install the JDK in /usr/java/jdk.x.x.  You need to modify the user’s .bash_profile to include /usr/java/jdk/bin in the path so the executables will run. What I usually do is make a symbolic link called /usr/java/jdk that points to this /usr/java/jdk.x.x. That way I don’t have to update my path in the .bash_profile every time I install a new version of the JDK.

You should also set your JAVA_HOME in the .bash_profile with something like  export JAVA_HOME=/usr/java/jdk
or on bash promt of user

[root@localhost]# JAVA_HOME=/usr/java/jdk; export JAVA_HOME

Download the latest stable release of tomcat from http://mirrors.24-7-solutions.net/pub/apache/tomcat/tomcat-5/v5.5.26/bin/apache-tomcat-5.5.26.tar.gz

after downloading apache-tomcat-5.x.x.tar.gz extract it into /usr/local/

Installing the binaries
cd /usr/local

tar -xvzf apache-tomcat-5.x.x.tar.gz

cd apache-tomcat-5.x.x

cd bin

rm *.bat

To enable the Tomcat manager, you need to modify /usr/local/apache-tomcat-5.x.x/conf/tomcat-users.xml add a user »admin« or with the role »manager«. The result should look like this:

<?xml version=’1.0′ encoding=’utf-8′?>
<tomcat-users>
<role rolename=”manager”/>
<role rolename=”tomcat”/>
<role rolename=”role1″/>
<user username=”both” password=”tomcat” roles=”tomcat,role1″/>
<user username=”tomcat” password=”tomcat” roles=”tomcat”/>
<user username=”admin” password=”password” roles=”manager”/>
<user username=”role1″ password=”tomcat” roles=”role1″/>
</tomcat-users>

Now you should be able to startup tomcat:

/bin/sh /usr/local/apache-tomcat-5.x.x/bin/startup.sh

You should now be able to connect to: http://localhost:8080/index.jsp

Thanks

Ravi

yum for RHEL

There is more to Red Hat Enterprise Linux 5 (RHEL5) than Xen. I, for one, think people will develop a real taste for YUM (Yellow dog Updater Modified), an automatic update and package installer/remover for RPM systems.

YUM has already been used in the last few Fedora Core releases, but RHEL4 uses the up2date package manager. RHEL5 will use YUM 3.0. Up2date is used as a wrapper around YUM in RHEL5. Third-party code repositories, prepared directories or websites that contain software packages and index files, will also make use of the Anaconda-YUM combination.

Essentially, YUM automatically computes dependencies and figures out what actions need to happen in order to successfully install packages. The Yellowdog Update Modified package manager is actually a variant of the Yellowdog Update Package (YUP), which is used by the Yellowdog Linux project to manage its applications. Yum is a version of YUP that is compatible with RPMs.

Using YUM makes it much easier to maintain groups of machines without having to manually update each one using RPM. Some of its features include:

  • Multiple repositories

  • Simple config file

  • Correct dependency calculation

  • Fast operation

  • RPM-consistent behavior

  • comps.xml group support, including multiple repository groups

  • Simple interface

RHEL5 moves the entire stack of tools which install and update software to YUM. This includes everything from the initial install (through Anaconda) to host-based software management tools, like system-config-packages, to even the updating of your system via Red Hat Network (RHN). New functionality will include the ability to use a YUM repository to supplement the packages provided with your in-house software, as well as plugins to provide additional behavior tweaks.

YUM automatically locates and obtains the correct RPM packages from repositories. It frees you from having to manually find and install new applications or updates. You can use one single command to update all system software, or search for new software by specifying criteria.

Keep in mind that it is always useful to keep your packages in a local YUM repository. The advantage of this is that when you install a package, YUM will automatically resolve any dependencies, not only by downloading the necessary packages from the other repositories you might have in you list, but also by using your local repository as a resource for potential dependencies. When installing a package with YUM, you must have already created RPM packages for all your dependences. That way, YUM can resolve all the dependencies. You won’t be able to install your package if the dependencies do not exist in the repositories on your list.

Creating your own repository in RHEL5

To install the RPM, you’ll need to type this command:

# yum install createrepo

What this will do is put all your customer RPM packages in a directory, where you can then create the necessary metadata that is needed for your local repository. You would do that by running this command:

# createrepo /mnt/fc_local_repo/

Your local YUM repository has been created. Whenever you put in any new RPMs, you’ll have to run this command, so that the new repository metadata gets updated. To install an RPM package and all the other packages that it depends on, you only need to run:

# yum install my_package.RPM

To install the package group MySQL Database, enter the command:

# yum groupinstall “MySQL Database”

If you need to upgrade the packages for MYSQL: # yum groupupdate “MySQL Database”

To search for packages which provide for Mail Transfer Agents (MTAs), or that have MTA in the name:

# yum provides MTA

Let’s say we want to update our entire system. It’s as simple as typing:

# yum update

To activate automatic daily updates:

/sbin/chkconfig –level 345 yum on; /sbin/service yum start

Configuring access to repositories in RHEL5

To add an extra repository, place a definition file in the /etc/yum.repos.d/ directory on your system. Package providers make the definition files for their repositories available on their websites. You must have root access to add a file to the definitions directory. To copy the definition file example.repo, type this command:

# cp example.repo /etc/yum.repos.d/

The configuration file for each repository should include a gpgkey setting. This setting specifies the location of a public key that verifies the packages provided by that repository. This public key is automatically imported the first time that you install software from the repository.

In conclusion, if you have used YUM before, you should have no problem getting used to this change in RHEL5. If you have not used YUM, once you get passed the initial learning curve, I’m certain that you will love it.

for Yum for RHE4 just checkout official centos wiki pages on centos.org

http://wiki.centos.org/HowTos/PackageManagement/YumOnRHEL

Thanks

Ravi

apt-get installation for rhel4 (Update 4)

apt-get – APT package handling utility.

apt-get, that I use a lot that made my life easy going on Debian.So now using same on RHEL.This is how one can use apt-get on RHEL.

root@localhost:~#vi /etc/apt/sorces.list.d/os.list (add following mirror )

repomd http://apt.sw.be redhat/el4/en/x86_64/dag/

root@localhost:~#apt-get update

root@localhost:~#apt-cache search pkg

root@localhost:~#apt-get install pkg

root@localhost:~#apt-get remove pkg

Thanks

Ravi

Installing Zabbix (Server and Agent) On Ubuntu Gusty 7.10

I will use the system SFPAZABBIX with the IP address 192.168.3.180 as the Zabbix server, and I’ll install a Zabbix agent on the same system (so that it can monitor itself)

The Zabbix server can store its information in a MySQL or PostgreSQL database. We use MySQL here, so we install the MySQL server and client first using apt-get:

$ sudo apt-get install mysql-server mysql-client

Create a password for the MySQL user root (replace yourrootsqlpassword with the password you want to use):

$ sudo mysqladmin -u root password yourrootsqlpassword

Installing apache2 php5 for web interface.

$ sudo apt-get install apache2 php5 php5-gd

Afterwards, we can install the Zabbix server, Zabbix agent, and the Zabbix web interface with a single command:

$ sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent

Apt installation will be asked a few questions:

Like mysql root user password and Zabbix database password, give mysql root password there that we created already.

This should create a MySQL database called Zabbix.

Next we must edit the Zabbix agent configuration in /etc/zabbix/zabbix_agentd.conf. Replace Server=localhost with Server=127.0.0.1 (to avoid lookup problems of localhost) and specify the hostname of the current system in the Hostname line:

$ sudo vi /etc/zabbix/zabbix_agentd.conf

[...]

Server=127.0.0.1

[...]

Hostname=SFPAZABBIX

[...]

Then we restart the Zabbix agent:

$ sudo /etc/init.d/zabbix-agent restart

Finally, we must specify the password of our zabbix MySQL user in the Zabbix web interface configuration:

$ sudo vi /etc/zabbix/dbconfig.php

<?
$DB_TYPE='MYSQL';
$DB_SERVER='localhost';
$DB_DATABASE='zabbix';                                            
$DB_USER='root';
$DB_PASSWORD='mysqlrootpassword';
?>

Restart services for zabbix server & agent
 
/etc/init.d/zabbix_server restart
/etc/init.d/zabbix_agent restart

That's it. you can now open
http://SFPAZABBIX/zabbix or http://192.168.3.180/zabbix in a browser.
Log in with the username Admin and no password:

zabbix login 
Afterwards, go to Configuration TAB and configure Zabbix.

zabbix config

If you have problems with Zabbix,
please check the Zabbix logs:
  • /var/log/zabbix-agent/zabbix_agentd.log
  • /var/log/zabbix-server/zabbix_server.log
The Zabbix configuration files for the server, agent, and web interface are as follows:
  • /etc/zabbix/apache.conf
  • /etc/zabbix/dbconfig.php
  • /etc/zabbix/zabbix_agentd.conf
  •  /etc/zabbix/zabbix_server.conf
### -Taking backup of Zabbix server database using below script-#### #! /bin/sh # script for dumping the contents of a zabbix MySQL database # this script will create a compressed mysqldump of the specified database savePath=/zabbix/   fileName="ZabbixDBbackup" # filename for the backup note the dateVar=$(date +%Y-%m-%d) # date variable to append to filename mysqldump -u root -p@toor8 zabbix | gzip > $savePath$fileName-$dateVar.gz ####-Schedule cronjob for Zabbix is as follows -#### @daily /bin/sh /zabbix/backupforzabbix.sh         #zabbix db backup daily midnight ####-Append existing zabbix db backup on zabbix db -###### Go to where is the zabbix db backup path ( i.e. /zabbix), check date & go for newer date when zabbix was running in good condition. (ls -l commands output give you the newer date) Unzip the compressed file and rename it to dbfilename.sql  (with sql extension)Now go to mysql CLI prompt$ sudo mysql -u root -p Type mysqlroot password mysql> use zabbix; mysql> \. filename.sqlabove command append the tables of zabbix database. Thanks Ravi

How to wordpress on Ubuntu Gusty 7.10


You should already have Apache, MySQL, and PHP installed (a typical LAMP setup). If you don’t have those installed yet, there are plenty of tutorials out there that will help you install them. Note that this walkthrough will probably also work for recent versions of Debian Linux (the distro that Ubuntu is based on)

The first thing to do is to install the wordpress package using apt-get.

$sudo apt-get install wordpress

If you get an error message that the package wordpress cannot be found, it is most likely because you do not have multiverse servers enabled for apt-get. Here’s how to add them. First, edit /etc/apt/sources.list

$sudo vi /etc/apt/sources.list

Add the following two lines (it doesn’t particularly matter where you add them, or even if you have duplicate lines).

deb http://us.archive.ubuntu.com/ubuntu/ gusty main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ gusty main restricted universe multiverse

Now tell apt-get to update its package list and you should be able to find wordpress.

$sudo apt-get update

Okay, WordPress is now installed. Next we have to configure Apache to tell it about WordPress.

$sudo vi /etc/apache2/apache2.conf

At the bottom of the file add the following lines:

Alias /blog /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
</Directory>

This will install WordPress to http://yourdomain.com/blog/. If you want it to go somewhere else, just adjust the path accordingly.

Now we have to tell Apache to reload its configuration files.

$sudo /etc/init.d/apache2 reload

Next, we are going to create a database in MySQL for WordPress to use. First, login to MySQL.

$mysql -u root -p

If you have never used MySQL before, the default root password is blank. Now would be a good time to set one.

Next we are going to create a database for WordPress to use. I’m going to be very imaginative and name the database “wordpress”.

mysql> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.00 sec)

Now we have to create a database user for wordpress. This part is important; you could just use the same user for all of your applications, but if something went wrong, you could lose all of your data. By creating a separate MySQL user for each application, you are limiting your damage. I’m going to be imaginative again and choose the name “wordpress_user” for the WordPress database user account. You might want to pick a better password than fluffy; that’s simply what I’m using for this demonstration.

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress_DB_user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

Now let’s make sure that these changes took:

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

We are done with MySQL now, so let’s quit.

mysql> quit;
Bye

Next we are going to modify WordPress’s configuration file to tell it about the database and user we just created for it. But first, we have to deal with a little idiosyncrasy. The Ubuntu WordPress package creates a symbolic link to /etc/wordpress/ for its configuration file, but we aren’t going to be using anything in /etc/ for our installation. So first, get rid of the symbolic link. Don’t worry, this is just deleting a link, it’s not actually deleting any files. The default wp-config.php will remain in /etc/wordpress/ if you really want it.

$sudo rm /usr/share/wordpress/wp-config.php

Now copy the sample configuration over to the main configuration location.

$sudo cp /usr/share/wordpress/wp-config-sample.php /usr/share/wordpress/wp-config.php

Now let’s edit the configuration.

$sudo vi /usr/share/wordpress/wp-config.php

Remember the database name, user account, and password that we just set in MySQL? We are going to input these into the configuration file and save it.

define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'wordpress_DB_user'); // Your MySQL username
define('DB_PASSWORD', 'password'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

We’re almost done. Now we just use WordPress’s built-in installation script. Go to http://yourdomain.com/blog/wp-admin/install.php and follow the directions. Write down the auto-generated password it gives you.

Now we’re going to login to WordPress. Go to http://yourdomain.com/blog/wp-login.php and login with the account ‘admin’ and the password you just wrote down. Now everything is working! The first thing you should do is change the password to the admin account. This option can be accessed from the “Users” tab along the top of the screen.

We have one more thing to do. We’re going to install a plugin for WordPress called “Spam Karma”. This plugin will defend your site from comment spam, which is a much bigger problem than you’d realize, especially if your site starts getting really popular. Luckily, it’s very easy to install the plugin. Go to the plugins directory, download the plugin using wget, and unzip it.

$cd /usr/share/wordpress/wp-content/plugins/
$wget http://wp-plugins.net/sk2/sk2_final.zip
$unzip sk2_final.zip

Now, go back into the admin console of your blog, go to the Plugins tab, and click on the Activate button next to Spam Karma.

That’s it; you’re done! Try writing your first post on WordPress, or configure your site’s look and feel.

Thanks

Ravi

Hello world!

This is my first post, and always keep trying for write good posts.

So everyone keep reading linux posts here.

Thanking you,

Ravi