Archive for the ‘Install’ Category



Install PDFlib PHP on cPanel Dedicated server

Saturday, June 27th, 2009

One web developer contacted us and requested us to install PDFlib on their cPanel dedicated server which has PHP 5. As you must be knowing that PDFlib is not supported in the current cPanel easyapache, and especially with PHP 5 so we installed PDFlib Lite manually for him. Here is how we had installed it for them:

Download the pacakge, their official site is www.pdflib.com

root@server# wget http://www.pdflib.com/binaries/PDFlib/703/PDFlib-Lite-7.0.3.tar.gz
root@server#  tar xvzf PDFlib-Lite-7.0.3.tar.gz
root@server#  cd PDFlib-Lite-7.0.3
root@server#  ./configure --prefix=$HOME/usr --without-java
root@server#  make
root@server#  make install

Once this is done, we built PDFlib DSO by the below commands:

root@server#  cd ~/tmp
root@server#  pecl download pdflib
root@server#  tar xvzf pdflib-*.tgz
root@server#  cd pdflib-*
root@server#  phpize
root@server#  ./configure --with-pdflib=$HOME/usr
root@server#  make
root@server#  make test

Then, copied the PDFlib extensions to a seperate directory:

root@server#  cd ~
root@server#  mkdir extensions
root@server#  cp ~/tmp/pdflib-*/modules/pdf.so ~/extensions

Added the extensions in the php.ini using the below steps:

root@server#   php -i | grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

Add the below line in php.ini

root@server#  nano /usr/local/lib/php.ini

extension_dir = "/root/extensions"
extension = "pdf.so"

Save php.ini file
Create a test PHP file under your domain to check if it works, below is the test code:


<?php

try {
$p = new PDFlib();

/*  open new PDF file; insert a file name to create the PDF on disk */
if ($p->begin_document(”", “”) == 0) {
die(”Error: ” . $p->get_errmsg());
}

$p->set_info(”Creator”, “hello.php”);
$p->set_info(”Author”, “Rainer Schaaf”);
$p->set_info(”Title”, “Hello world (PHP)!”);

$p->begin_page_ext(595, 842, “”);

$font = $p->load_font(”Helvetica-Bold”, “winansi”, “”);

$p->setfont($font, 24.0);
$p->set_text_pos(50, 700);
$p->show(”Hello world!”);
$p->continue_text(”(says PHP)”);
$p->end_page_ext(”");

$p->end_document(”");

$buf = $p->get_buffer();
$len = strlen($buf);

header(”Content-type: application/pdf”);
header(”Content-Length: $len”);
header(”Content-Disposition: inline; filename=hello.pdf”);
print $buf;
}
catch (PDFlibException $e) {
die(”PDFlib exception occurred in hello sample:\n” .
“[" . $e->get_errnum() . "] ” . $e->get_apiname() . “: ” .
$e->get_errmsg() . “\n”);
}
catch (Exception $e) {
die($e);
}
$p = 0;
?>

You need to get the below output in PDF format within your browser.

Hello world!
(Says PHP)

Let us know if this was helpful for you?

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Install ImageMagick on dedicated cPanel server

Sunday, February 8th, 2009

If you need the version ImageMagick-6.4.9-2 to be installed on your cPanel dedicated server, we have followed the below steps which worked perfectly.

First, download the tar using the below command:

root# wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
root# tar -zxvf ImageMagick.tar.gz
root# cd ImageMagick-6.4.9-2
root#./configure
root# make
root# make install

You can check the path for the installed ImageMagick by the command:

root# which convert
/usr/local/bin/convert
root# convert -v | head -n 1 | cut -c 22-26
6.4.9

OR

root# convert -v | grep Version:
Version: ImageMagick 6.4.9-2 2009-02-07 Q16 OpenMP http://www.imagemagick.org

That’s it!

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Install Asterisk on linux dedicated server

Saturday, January 24th, 2009

Asterisk is the world’s leading open source telephony engine and tool kit. Offering flexibility unheard of in the world of proprietary communications, Asterisk empowers developers and integrators to create advanced communication solutions…for free.

Asterisk® is released as open source under the GNU General Public License (GPL), and it is available for download free of charge. Asterisk® is the most popular open source software available, with the Asterisk Community being the top influencer in VoIP.

Official site : www.asterisk.org

Let’s start installing it on the server now.

Login to your server as root.

I am using asterisk 1.4 (I have done this on 64 bit server – make sure to download the right tarball) – you can download asterisk by the command:

root# wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.23.tar.gz

Now, we will start the installation process. If you get any errors of dependencies you will have to install it. I have installed it using yum ( few were ncurses, gcc, gcc-c++, zaptel, subversion) – install ncurses before the installation starts this will make “make menuconfig” command work perfect.

root# tar zxvf asterisk-1.4.23.tar.gz
root# cd asterisk-1.4.23
root#./configure
root# make menuconfig    -- hit 'x' to save and exit with default setting
root# make
root# make install
root# make samples
root# asterisk

Now, open the ports in the firewall by the commands:

root# iptables -I INPUT -p tcp --dport 8088 -j ACCEPT
root# iptables -I INPUT -p udp --dport 8088 -j ACCEPT
root# service iptables save
root# service iptables restart

root# iptables -I INPUT -p tcp --dport 5308 -j ACCEPT
root# iptables -I INPUT -p udp --dport 5308 -j ACCEPT
root# service iptables save
root# service iptables restart

Asterisk is installed, now proceeding to installation of Asterisk-GUI

svn checkout http://svn.digium.com/svn/asterisk-gui/branches/2.0/ asterisk-gui
cd asterisk-gui/
./configure
make
make install

Edit /etc/asterisk/http.conf with your favourite editor and change the following lines:

enabled=yes
enablestatic=yes
bindaddr=123.123.123.123

Where 123.123.123.123 is your server IP.

This enables the HTTP server, enables it to serve static content (the GUI itself) and binds to the standard address, so that any browser from a remote machine can access it.

Now, configuring the manager access
Edit /etc/asterisk/manager.conf and change the following lines:

enabled = yes
webenabled = yes

Then add a new section at the end of the file


[admin]
secret = supportfacility
read = system,call,log,verbose,command,agent,user,config
write = system,call,log,verbose,command,agent,user,config

This will allow a user called admin to connect with the password supportfacility and do nearly everything on the system.

Now restart Asterisk by the command:

root# asterisk

Do one last check with the command

make checkconfig

If everything goes well, and you get a “Good Luck” connect with your browser to:

http://Server-IP:8088/asterisk/static/config/cfgbasic.html

Username: admin
Password: supportfacility

This will take sometime and then you will get the below URL.

http://Server-IP:8088/asterisk/static/config/index.html

Start configuring your Asterisk now.

Best of luck!

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Install ImageMagick using yum

Saturday, November 8th, 2008

First of all you may ask what is ImageMagick? It is a software suite for image manipulation and display, ImageMagick supports hundreds of image formats on a dedicated server on which it is installed.

Following are the commands to install ImageMagick using yum

root# yum install glib
root# yum install glib2
root# yum install libpng
root# yum install libjpeg
root# yum install libtiff
root# yum install ghostscript
root# yum install freetype
root# yum install ImageMagick
root# yum install ImageMagick-perl

That’s it

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Install munin on Plesk dedicated server

Friday, October 31st, 2008

Get your servers monitored by munin and you can see the output in graphical view for the following:

  • load average
  • memory usage
  • CPU usage
  • MySQL throughput
  • eth0 traffic and more…

I have used centos for munin installation. The steps for installation are as below:

Add rpmforge repositories

root# rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
root# yum -y install munin

My document root is /var/www/html/ (Plesk server)

root# cp -r /var/www/munin /var/www/html/
root# chown -R munin:munin /var/www/html/munin

Now, restart apache server

root# /etc/init.d/httpd restart

Now, check it using the browser

http://xxx.xxx.xxx.xxx/munin (xxx.xxx.xxx.xxx is your server IP)

Now, add a munin node – for this do the following

root# yum -y install munin-node

Now configure it using editor of your choice

root# nano /etc/munin/munin-node.conf

Find the line and make the necessary changes

* Allow the graph server (server.example.com/xxx.xxx.xxx.xxx) to poll the node.
allow ^xxx\.xxx\.xxx\.xxx$

Start the munin node on your server

root# service munin-node start
root# nano /etc/munin/munin.conf
[client.example.com]
address xxx.xxx.xxx.xxx
use_node_name yes

Remember to open port tcp/4949 in the firewall of the node

root# iptables -A INPUT -p tcp --dport 4949 -j ACCEPT

Let us know if this helped you.. your feedback is very vital for us.

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Install VNCserver on linux (Remote desktop linux)

Tuesday, October 28th, 2008

Windows can be connected using Remote Desktop, linux users can connect to shell (ssh) using ssh clients like putty. Now, what if you need to view linux gnome desktop and that too remotely? Yes, this is possible with VNC ( Virtual Network Computing ) server. I will show you how to install it on centos.

You’ll need gnome desktop environment – if it is not installed on your system you can get it installed using yum; the commands are:

root# yum groupinstall "X Window System"
root# yum groupinstall "GNOME Desktop Environment"

If you get any errors about dependencies, I am sure you know how to get those packages installed.

Now, the VNC server is installed with the X Windows system. We will configure the VNC server now:

Edit the /etc/sysconfig/vncservers file with your favourite editor and uncomment the following two lines:

VNCSERVERS="5:root" # display port and username
VNCSERVERARGS[2]="-geometry 800×600 -nolisten tcp -nohttpd -localhost"

Set password to VNC Server

root# vncpasswd

Edit the local config file in the root folder:

nano ~/.vnc/xstartup
Replace "twm &"   with "gnome-session &"

To start VNC server issue command

root# vncserver :5

To stop VNC server issue command

root# vncserver -kill :5

Connecting with VNC client

Start VNC Server by issuing the command

root# vncserver :5

Open your favourite VNC client and type your server’s IP followed by the port number

xxx.xxx.xxx.xxx:5 (where xxx.xxx.xxx.xxx is the IP)

5 is the port set within the /etc/sysconfig/vncservers file

VNC login

Enter your servers password and access the linux remote desktop.

VNC authentication

Here is your remote desktop

VNC server

Did this post help you? please leave your feedback for us.


ionCube autoinstaller script

Thursday, October 16th, 2008

ionCube php loader is the PHP extension that decodes encrypted PHP files on runtime, usually this is already installed on any web server whether it be used for shared hosting, reseller hosting or on your dedicated web servers.

If for some reason you don’t have it installed on your linux server, you can use the below shell script created by one of our system administrator.

Create a file named ioncubeinstaller.sh and paste the below code in the file:


#!/bin/bash
# Supportfacility.com

WHO=$(whoami)
if [ ${WHO} == "root" ]
then
echo "Script Initialized ..."
else
echo "You must be logged in as root to install ionCube Loader."
echo "Terminating ..."
exit 0
fi

echo "Changing directory"

cd /usr/local/

echo "Done."

if [ -e ioncube_loaders_lin_x86.tar.gz ]
then
rm -f ioncube_loaders_lin_x86.tar.gz
fi

echo "Downloading files"

wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz

echo "Done."

echo "Installing files"

tar -zxvf ioncube_loaders_lin_x86.tar.gz

echo "Done."

echo "Changing ownership"

chown -R root.root ioncube

echo "Done."

phpline=`php -v | grep ^PHP | cut -f2 -d " "| awk -F "." '{print "zend_extension=\"/usr/local/ioncube/ioncube_loader_lin_"$1"."$2".so\""}'`
phpinifile=`php -i | grep php.ini | grep ^Configuration | cut -f6 -d" "`

echo "Adding line $phpline to file $phpinifile"
echo "$phpline" >> $phpinifile

rm -f ioncube_loaders_lin_x86.tar.gz

echo "Ioncube installed sucessfully"

Then, change the permissions of the file to 755

root# chmod 755 ioncubeinstaller.sh

And execute it with

root# ./ioncubeinstaller.sh

This has been tested on cPanel, Plesk, DirectAdmin dedicated servers and will work on any linux server

Let us know if this script was helpful for you.

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


Install chkrootkit

Monday, June 2nd, 2008

chkrootkit is a tool to locally check for signs of a rootkit. It contains:

chkrootkit: shell script that checks system binaries for rootkit modification.
ifpromisc.c: checks if the interface is in promiscuous mode.
chklastlog.c: checks for lastlog deletions.
chkwtmp.c: checks for wtmp deletions.
check_wtmpx.c: checks for wtmpx deletions. (Solaris only)
chkproc.c: checks for signs of LKM trojans.
chkdirs.c: checks for signs of LKM trojans.
strings.c: quick and dirty strings replacement.
chkutmp.c: checks for utmp deletions.

Installation procedure:

cd /
wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
tar -zxvf chkrootkit.tar.gz
cd chkrootkit-0.48
make sense

You can now execute: /chkrootkit-0.48/chkrootkit

For more information of chkrootkit you can check here

That’s it!

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


How to install nmap on CentOS

Thursday, April 17th, 2008

nmap (Network Mapper) is a free and open source utility. Here, we will use it to see the ports open on your cPanel server are. To install nmap on your cPanel server, use the following command:

yum install nmap

This will install nmap on your server, to check it use the command:

nmap localhost

That’s it!

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.


AntiDOS Configuration in APF on cPanel web server

Wednesday, April 9th, 2008

It is assumed that you have already installed APF (Advanced policy firewall) on your cPanel dedicated web server. Once, APF is installed do the following:

Edit the antidos configuration file of APF with the command:

nano /etc/apf/ad/conf.antidos

Find the string LP_KLOG=”0″ and change it to LP_KLOG=”1″

Now, find for CONAME=”Your Company”

Enter your company name within quotes for example

CONAME=”SupportFacility.Com”

Now find for the string USR_ALERT=”0″ and change it to USR_ALERT=”1″

This is so that you can receive email alerts.

Now enter your email address here:

USR=”something@yourdomain.com”

Now you have to set it in cron for this give the following command:

crontab –e

*/5 * * * * root /etc/apf/ad/antidos -a >> /dev/null 2>&1

This will run antidos every five minutes.

This article is released by SupportFacility.Com — the leaders in providing outsourced technical support, live chat support & help desk support for web hosts. Interested ? Opt for a trial now.