Install and Configure CPAN first time


Before installing CPAN modules make sure perl is installed on server. If perl is not installed, please execute the below command on terminal.

[root@server.local ~]#yum install perl*

The above command will install all perl dependency packages.

Step 1: Download and install CPAN

[root@server.local ~]#yum install perl-CPAN

Step 2: Configure CPAN first time

We need to set some configuration parameters as shown below. Accept all the default values by pressing enter.

[root@server.local ~]#cpan

Sorry, we have to rerun the configuration dialog for CPAN.pm due
to some missing parameters...

CPAN build and cache directory? [/root/.cpan]

If you want, I can keep the source files after a build in the cpan
home directory. If you choose so then future builds will take the
files from there. If you don't want to keep them, answer 0 to the
next question.

How big should the disk cache be for keeping the build directories
with all the intermediate files?

Cache size for build directory (in MB)? [100]

By default, each time the CPAN module is started, cache scanning
is performed to keep the cache size in sync. To prevent from this,
disable the cache scanning with 'never'.

Perform cache scanning (atstart or never)? [atstart]

To considerably speed up the initial CPAN shell startup, it is
possible to use Storable to create a cache of metadata. If Storable
is not available, the normal index mechanism will be used.

Cache metadata (yes/no)? [yes]

The next option deals with the charset your terminal supports. In
general CPAN is English speaking territory, thus the charset does not
matter much, but some of the aliens out there who upload their
software to CPAN bear names that are outside the ASCII range. If your
terminal supports UTF-8, you say no to the next question, if it
supports ISO-8859-1 (also known as LATIN1) then you say yes, and if it
supports neither nor, your answer does not matter, you will not be
able to read the names of some authors anyway. If you answer no, names
will be output in UTF-8.

Your terminal expects ISO-8859-1 (yes/no)? [yes]

If you have one of the readline packages (Term::ReadLine::Perl,
Term::ReadLine::Gnu, possibly others) installed, the interactive CPAN
shell will have history support. The next two questions deal with the
filename of the history file and with its size. If you do not want to
set this variable, please hit SPACE RETURN to the following question.

File to save your history? [/root/.cpan/histfile]
Number of lines to save? [100]

The CPAN module can detect when a module that which you are trying to
build depends on prerequisites. If this happens, it can build the
prerequisites for you automatically ('follow'), ask you for
confirmation ('ask'), or just ignore them ('ignore'). Please set your
policy to one of the three values.

Policy on building prerequisites (follow, ask or ignore)? [ask]

The CPAN module will need a few external programs to work properly.
Please correct me, if I guess the wrong path for a program. Don't
panic if you do not have some of them, just press ENTER for those. To
disable the use of a download program, you can type a space followed
by ENTER.

Where is your gzip program? [/bin/gzip]
Where is your tar program? [/bin/tar]
Where is your unzip program? [/usr/bin/unzip]
Where is your make program? [/usr/bin/make]
Where is your links program? [/usr/bin/links]
Where is your wget program? [/usr/bin/wget]
Warning: ncftpget not found in PATH
Where is your ncftpget program? []
Warning: ncftp not found in PATH
Where is your ncftp program? []
Where is your ftp program? [/usr/kerberos/bin/ftp]
Where is your gpg program? [/usr/bin/gpg]
What is your favorite pager program? [/usr/bin/less]
What is your favorite shell? [/bin/bash]

Every Makefile.PL is run by perl in a separate process. Likewise we
run 'make' and 'make install' in processes. If you have any
parameters (e.g. PREFIX, LIB, UNINST or the like) you want to pass
to the calls, please specify them here.

If you don't understand this question, just press ENTER.

Parameters for the 'perl Makefile.PL' command?
Typical frequently used settings:

PREFIX=~/perl non-root users (please see manual for more hints)

Your choice: [1]
Parameters for the 'make' command?
Typical frequently used setting:

-j3 dual processor system

Your choice: []
Parameters for the 'make install' command?
Typical frequently used setting:

UNINST=1 to always uninstall potentially conflicting files

Your choice: []

Sometimes you may wish to leave the processes run by CPAN alone
without caring about them. As sometimes the Makefile.PL contains
question you're expected to answer, you can set a timer that will
kill a 'perl Makefile.PL' process after the specified time in seconds.

If you set this value to 0, these processes will wait forever. This is
the default and recommended setting.

Timeout for inactivity during Makefile.PL? [0]

If you're accessing the net via proxies, you can specify them in the
CPAN configuration or via environment variables. The variable in
the $CPAN::Config takes precedence.

Your ftp_proxy?
Your http_proxy?
Your no_proxy?
Found /root/.cpan/sources/MIRRORED.BY as of Fri Jul 4 11:57:41 2014

I'd use that as a database of CPAN sites. If that is OK for you,
please answer 'y', but if you want me to get a new database now,
please answer 'n' to the following question.

Shall I use the local database in /root/.cpan/sources/MIRRORED.BY? [y]

Now we need to know where your favorite CPAN sites are located. Push
a few sites onto the array (just in case the first on the array won't
work). If you are mirroring CPAN to your local workstation, specify a
file: URL.

First, pick a nearby continent and country (you can pick several of
each, separated by spaces, or none if you just want to keep your
existing selections). Then, you will be presented with a list of URLs
of CPAN mirrors in the countries you selected, along with previously
selected URLs. Select some of those URLs, or just keep the old list.
Finally, you will be prompted for any extra URLs -- file:, ftp:, or
http: -- that host a CPAN mirror.

(1) Africa
(2) Asia
(3) Europe
(4) North America
(5) Oceania
(6) South America
Select your continent (or several nearby continents) [] 3

(1) Austria
(2) Belarus
(3) Belgium
(4) Bosnia and Herzegovina
(5) Bulgaria
(6) Croatia
(7) Czech Republic
(8) Denmark
(9) Finland
(10) France
(11) Germany
(12) Greece
(13) Iceland
(14) Ireland
(15) Italy
(16) Latvia
16 more items, hit SPACE RETURN to show them
Select your country (or several nearby countries) [] 10

(1) ftp://ftp.lip6.fr/pub/perl/CPAN/
(2) ftp://ftp.oleane.net/pub/CPAN/
(3) ftp://glass.overcloud.pt/CPAN/
(4) ftp://mir1.ovh.net/ftp.cpan.org/
(5) http://cpan.enstimac.fr/
(6) http://ftp.crihan.fr/mirrors/ftp.cpan.org/
(7) http://mirror.ibcp.fr/pub/CPAN/
(8) ftp://cpan.fiat-tux.fr/ (previous pick)
(9) ftp://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/cpan/ (previous pick)
(10) ftp://ftp.ciril.fr/pub/cpan/ (previous pick)
Select as many URLs as you like (by number),
put them on one line, separated by blanks, e.g. '1 4 5'
(or just hit RETURN to keep your previous picks) [8 9 10] 1 2 3

Enter another URL or RETURN to quit: []
New set of picks:
ftp://ftp.lip6.fr/pub/perl/CPAN/
ftp://ftp.oleane.net/pub/CPAN/
ftp://glass.overcloud.pt/CPAN/

commit: wrote /usr/lib/perl5/5.8.8/CPAN/Config.pm

cpan> quit
Lockfile removed.

Step 3: Install Perl Modules using CPAN

[root@server.local ~]# cpan

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support enabled

cpan> install Bundle::CPAN

Just press enter key to accept the CPAN module installation. All your cpan modules are installed under /root/.cpan directory.

Install SparkWeb web chat on Openfire Server


Please make sure your openfire messaging server is up and running. Run the below command to check the status of openfire.

[root@server.local ~]#/etc/init.d/openfire status
openfire is running

Download and Configure Sparkweb

[root@server.local ~]#cd /var/www/html
[root@server.local ~]#mkdir -p webchat && cd webchat
[root@server.local ~]#wget http://www.igniterealtime.org/downloadServlet?filename=sparkweb/sparkweb_0_9_0.zip
[root@server.local ~]#unzip -j sparkweb_0_9_0.zip
[root@server.local ~]#rm sparkweb_0_9_0.zip

Rename SparkWeb.html to index.html and edit the configuration

[root@server.local ~]#mv SparkWeb.html index.html
[root@server.local ~]#vi index.html

Change only one line: Line 32

From:”igniterealtime.org

server: "igniterealtime.org",
connectionType: "socket",
port: "5222",
autoLogin: "false"

To: “server.local

server: "server.local",
connectionType: "socket",
port: "5222",
autoLogin: "false"

Save the file and exit

Open the web browser, type http://server.local/webchat, enter your openfire username and password.

Done!

Audio/Video Chat on Openfire Server


An openfire messaging server have a feature of Audio & Video Chat, it will be useful when your organization looking for video conferencing. This can be achived by setting up the Red5Plugin in Openfire server.

Step 1: Download and install Java

If you want to install latest Java platform, you can download Java RPM packages from:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

[root@server.local ~]#chmod +x jdk-6u26-linux-i586-rpm.bin
[root@server.local ~]#./jdk-6u26-linux-i586-rpm.bin

This binary should automatically install and take care of everything.

After completion of installation check the version by executing this command on terminal

[root@server.local ~]#java -version

Step 2: Setup Red5 Plugin

Download the latest version of Red5 plugin from below link ( do not goto beta).

http://redfire.googlecode.com/files/red5.war

Open a terminal and goto the downloaded file, in our example it’s in /tmp directory.

[root@server.local ~]#cd /tmp
[root@server.local ~]#mv red5.war /opt/openfire/plugins/

To make this effective, we need to restart the openfire server. Wait a few minutes and then run…

[root@server.local ~]#/etc/init.d/openfire stop
[root@server.local ~]#/etc/init.d/openfire start

Step 3: Test Red5 Plugin installed in openfire

Open web browser, type http://localhost:9090 and enter the admin username and password.

Once you logged in, Click on the “Server” tab. Now click on the “Server settings” tab. On the left menu select “HTTP Bindings.” Be sure it is set as “Enabled”. Take note of the bind port (its probably 7070).

Click on the Plugins tab. There should be a “Red5” plugin installed.

Then goto http://localhost:7070/redfire, it will display a “Red5 Test” page pop up. If you get that screent then you have successfully installed Red5 Plugin.

The same changes have been reflected in your installed “Spark Client”. Log out and try log in again you will see the Red5 icon in user chat window.

Now you are able to share your audio & video with your firends.

Setting up Openfire Chat/Messaging Server


Openfire is an instant messaging server that implements the XMPP (Extensible Messaging and Presence Protocol) jabber protcol. It features high performance, a robust administration console, and a full plug-in system.

The Server is 100% Opensource (free of cost). Openfire is a cross platform Application, available for Windows, Linux and Mac Platform.

Here we will look at how to setup an Openfire Instant Messaging Server on CentOS (64 bit) linux.

Step 1: Download and install Openfire

[root@server.local ~]#cd /tmp
[root@server.local ~]#wget http://download.igniterealtime.org/openfire/openfire-3.8.2-1.i386.rpm
[root@server.local ~]#rpm -ivh openfire-3.8.2-1.i386.rpm

Step 2: Install and create MySQL Database

[root@server.local ~]#yum install mysql-server
[root@server.local ~]#mysql -u root –p
mysql> create database openfire;
mysql> create user admin@localhost identified by 'passwd';
mysql> grant all on openfire.* to admin@localhost identified by 'passwd';

Step 3: Start openfire service

[root@server.local ~]/etc/init.d/openfire start
[root@server.local ~]chkconfig openfire on

Step 4: Configure openfire server in browser

Now open the browser , type http://localhost:9090 to configure openfire web installer.

Proceed with the below steps:

>> SELECT LANGUAGE >>

>> DOMAIN NAME / SERVER IP >> ( every thing default unless you are particular about ports)

>> SELECT STANDARD DATABASE CONNECTION >> (if you don't want external, simply select embedded and go further)

>> ENTER DATABASE DETAILS AS BELOW >>
MySQL
com.mysql.jdbc.Driver
dbc.mysql://localhost:3306/openfire
username (enter root here)
password (enter mysql root password)

rest of the things as default. CLICK CONTINUE

>> DEFAULT for Profiles >>

>> ADMINISTRATOR ACCOUNT >> (this the username & password we used to login admin panel)

Step 5: Create new user

In browser, enter http://localhost:9090, you will be prompted to enter the admin username and password. After successful login to admin panel, navigate to Users/Groups and click Create New User on left side screen.

Enter the required details and click Create User button.

Step 6: Installation of Spark Client

Spark is an Open Source messenger. It supports group chat, screen capture, file transfer (small size), offline chat and strong security.

And have advanced features like in-line spell checking, group chat room bookmarks, and tabbed conversations.

Download and install Spark client on your system using below link.

http://www.igniterealtime.org/downloads/index.jsp

Once you have completed the installation, open the Spark Client and enter username, password and hostname/IP address of openfire server.

That’s it. Now you are able to chat with other logged users.

Have a great day 🙂