How do i fix the error “License File Expired” ?

First, check the license on http://verify.cpanel.net/ to ensure it is still licensed.
If it is not, please contact who you purchase the license from directly.

If your license lists as active and you see this error when trying to access cPanel or WHM: License File Expired, you will want to ensure that port 2089 is open for outbound TCP traffic.
After verifying that port 2089 is open, check to make sure that this command gives the IP that you expect: lynx -dump http://www.cpanel.net/showip.cgi. If that command shows the expected IP, run this from the command line as root, on the server: /usr/local/cpanel/cpkeyclt.

OR

# rdate -s rdate.cpanel.net
# /usr/local/cpanel/cpkeyclt

HowTo :: install a Perl Module

Perl modules
A Perl module is a self-contained piece of Perl code that can be used by a Perl program or by other Perl modules. It is conceptually similar to a C link library, or a C++ class.

To manually install a Perl module:

  1. Download the Perl module from CPAN or other site.
  2. Extract the tarball, and then run the following commands (in that order):
  • perl Makefile.PL
  • make
  • make test
  • make install

From the WHM
Login to the: WHM >> Main >> Software >> Install a Perl Module

Enter the name of the Perl Module you wish to install in the field and click the button Search. Perl Module will be presented to you in a list. Find and can click on the module you wish to install.

The command Line

  1. SSH to the server and login as root.
  2. Type the following command at the prompt:
    • /scripts/realperlinstaller –force HTML ::Template

In this case, the module we want to install is HTML::Template.

What is /dev/shm and its practical usage ?

What is /dev/shm and its practical usage ?

/dev/shm is nothing but implementation of traditional shared memory concept. It is an efficient means of passing data between programs. One program will create a memory portion, which other processes (if permitted) can access. This will result into speeding up things on Linux.

If you type mount command you will see /dev/shm as a tempfs file system. Therefore, it is a file system, which keeps all files in virtual memory. Everything in tmpfs is temporary in the sense that no files will be created on your hard drive. If you unmount a tmpfs instance, everything stored therein is lost. By default almost all distro configured to use /dev/shm.

Nevertheless, where can I use /dev/shm?
You can use /dev/shm to improve the performance of application software or overall Linux system performance. On heavily loaded system, it can make tons of difference. For example VMware workstation/server can be optimized to improve your Linux host’s performance (i.e. improve the performance of your virtual machines).

For example, if you have 8GB RAM then remount /dev/shm as follows:

# mount -o remount,size=8G /dev/shm

To be frank if you have more than 2GB RAM and if you running multiple Virtual machines this hack always improves performance.

SSH Authorized Keys Automatic Login

SSH can automatically authenticate connections when the client presents an authorized key. A client gives it’s public key to a server and then when it connects the server knows it’s allowed in and automatically allows the connection. The Keys are specific to users, so a key for user_a will not let user_b in.

Few Simple Steps

  1. Create Keys

    If the keys don’t exists already you must create them. Look in your ~/.ssh for files called id_rsa and id_rsa.pub. If those files don’t exist say ssh-keygen -b 2048 -t rsa to create them.

  2. Place Keys on Server

    Copy id_rsa.pub to the server then append that to ~/.ssh/authorized_keys

Optionally you can use a DSA key, simply replace `rsa` with `dsa` above

SSH automatic login assistance script

The script automatically pushes your SSH private key to the server specified so you can have automatic SSH,scp and sftp authentication. If you don’t have a key the script will generate one for you, also this script assumes that the user running the script has a home directory on the remote host. Should note that this script will only push the RSA encrypted key.

The Script

 

 

#!/bin/bash

# say: ./ssh_script.sh hostname

# Uploads your id_rsa.pub to the specified host, wrapped for readability

if [ ! -r ${HOME}/.ssh/id_rsa.pub ];then

ssh-keygen -b 2048 -t rsa

fi

# Append to the copy on the remote server

cat ~/.ssh/id_rsa.pub | ssh ${USER}@$1 “cat – >> .ssh/authorized_keys”

if [ $? -eq 0 ]; then

echo “Success”

fi

save the script say as  ssh_script.sh and execute it ./ssh_script.sh hostname

Virtuozzo glibc-dummy-centos-4 Error (1)

If you come across this error when trying to do a “yum update” on your Virtuozzo Virtual Dedicated Server

–> Processing Dependency: glibc-common = 2.3.4-2.25 for package: glibc-dummy-centos-4–> Finished Dependency ResolutionError: Missing Dependency: glibc-common = 2.3.4-2.25 is needed by package glibc-dummy-centos-4

You can make use of the following steps to fix the problem. First you need to remove the package that is causing the problem.

yum remove glibc-dummy-centos-4

After you have removed that package you need to reinstall gcc with all the extras. You can do that simply by running the following command.

yum install gcc & yum install gcc*

If everything installed correctly you should now be able to run a yum update and it should not error out at all.

Enable SLM on Virtuozzo

 What is SLM, “Virtuozzo Service Level Management (SLM) is a system that maintains and allows administrators to configure and control the levels of service (i.e., the set of ‘promises’) provided to VPS owners.I came across some different ways of enabling SLM on the Virtuozzo Node, by far the best was the information about how to enable it with out a Node reboot. run the following commands. Edit the following files and make said changes

/etc/sysconfig/vz and change the SLM entry to slm=yes/etc/sysconfig/vzagent/vzagent.conf Locate the SLM entry, change it to 1. 

 

After you modified configuration file you need to restart VZAgent, use the following command on a hardware node:

vzagent_ctl restart 

 

How to install Cpanel and Fantastico in a VPS

Problem:
cPanel installs a little bit differently in a VPS that it does on your traditional server.

Solution:
Install cPanel in CentOS / Fedora VPS:

You will need yum installed on the VPS

cat /etc/redhat-release

rpm -q yum centos-yumconf

 

CentOS 5 :

rpm –import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm
rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/m2crypto-0.16-6.el5.1.i386.rpm

rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/python-urlgrabber-3.1.0-2.noarch.rpm
rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/sqlite-3.3.6-2.i386.rpm
rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -ivh http://mirror.centos.org/centos/5.0/os/i386/CentOS/rpm-python-4.4.2-37.el5.i386.rpm
rpm -ivh http://mirror.centos.org/centos/5.0/os/i386/CentOS/libxml2-2.6.26-2.1.2.i386.rpm
rpm -ivh http://mirror.centos.org/centos/5.0/os/i386/CentOS/libxml2-python-2.6.26-2.1.2.i386.rpm
rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/yum-3.0.5-1.el5.centos.2.noarch.rpm

Fedora 6:

rpm -Uvh http://mirrors.kernel.org/fedora/core/6/i386/os/Fedora/RPMS/python-elementtree-1.2.6-5.i386.rpm
rpm -Uvh http://mirrors.kernel.org/fedora/core/6/i386/os/Fedora/RPMS/python-sqlite-1.1.7-1.2.1.i386.rpm
rpm -Uvh http://mirrors.kernel.org/fedora/core/6/i386/os/Fedora/RPMS/rpm-python-4.4.2-32.i386.rpm
rpm -Uvh http://mirrors.kernel.org/fedora/core/6/i386/os/Fedora/RPMS/python-urlgrabber-2.9.9-2.noarch.rpm
rpm -Uvh http://mirrors.kernel.org/fedora/core/6/i386/os/Fedora/RPMS/yum-metadata-parser-1.0-8.fc6.i386.rpm
rpm -Uvh http://mirrors.kernel.org/fedora/core/6/i386/os/Fedora/RPMS/yum-3.0-6.noarch.rpm

Install cPanel :

mkdir /home/cpins
cd /home/cpins
wget http://layer1.cpanel.net/latest
sh latest

cd /usr/local/cpanel/whostmgr/docroot
rm -Rf fantastico*
wget -N http://netenberg.com/files/free/fantasticoinstaller.tgz
tar xzpf fantasticoinstaller.tgz
rm -f fantasticoinstaller.tgz

In /etc/xinetd.d/pop3ds

Change ‘disable = no’ to ‘disable = yes’

restart xinetd
restart cpanel

Fatal error: Allowed memory size of 123456 bytes exhausted (tried to allocate 234567 bytes) in /path/file.php

Php is setup is to limit memory usage per process. If you require more, this limit can be increased.
Edit

/usr/local/lib/php.ini

If you are unsure about the php.ini path, You can find your server php.ini using command :

php -i | grep php.ini

Configuration File (php.ini) Path => /usr/local/lib

Loaded Configuration File => /usr/local/lib/php.ini

and set:

memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)

to a higher value, like 20M. Save, exit, then restart apache.