Archive for the ‘WHM/cPanel’ Category

How to enable GeoIP Apache API (mod_geoip)

Wednesday, January 27th, 2010

cd /usr/src
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz
tar -xvzf GeoIP*
cd GeoIP*
./configure
make
make install

cd /usr/src
wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.5.tar.gz
tar -xvzf mod_geoip*
cd mod_geoip*
/usr/local/apache/bin/apxs -i -a -L/usr/src/GeoIP-1.4.6/libGeoIP -I/usr/src/GeoIP-1.4.6/lib/GeoIP -lGeoIP -c mod_geoip.c

Please note, you need to enable mod_geoip inside your httpd.conf with the following lines:

GeoIPEnable On
GeoIPDBFile /usr/local/share/GeoIP/GeoIP.dat

/usr/local/apache/bin/httpd: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

Saturday, December 19th, 2009

If you see following error during easyapache -

/usr/local/apache/bin/httpd: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

Solution :

ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2

If this didn’t work then add following line in /etc/ld.so.conf file

/usr/local/lib/

and execute command

ldconfig

Now run easyapache.

How do I safely remove the /home/virtfs directory?

Wednesday, November 18th, 2009

The virtfs directory contains hard links to all the system binaries to help with security via jailshelled accounts.

If you remove the virtfs system without unmounting the directories under it, you will completely break the system.

The procedure you need to do is the following:

cd /home/virtfs
find . -regex ‘^.*[How do I safely remove the virtfs directory?^.]‘ -type d > t1
for i in $(cat t1); do umount $i; done

After this is ran, you can safely recursively remove the /home/virtfs directory.

Cannot change ownership to uid 501, gid 501: Disk quota exceeded

Thursday, November 5th, 2009

If you see following error while updating Perl modules -

Cannot change ownership to uid 501, gid 501: Disk quota exceeded

Then go to WHM -> Basic cPanel/WHM Setup and change the Minimum UID to something like 30000

Warning: in_array() [function.in-array]: Wrong datatype for second argument – Fantastico

Friday, October 9th, 2009

In users cPanel after clicking the Fantastico icon. Left column is filled with:

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /tmp/cpanel_phpengine.1230646571.28207lX8XQnNUIp on line 1225

Solution :

1) Go into WHM as root, click on Tweak Settings, scroll down to the PHP section and make sure the IONCUBE PHP Loader is selected. Save changes if needed. Also make sure ioncube loader is installed on server.

2) Log into your server as root via SSH and execute the following command:
/scripts/makecpphp

No Input File Specified – With new Fantastico

Saturday, September 12th, 2009

After installing Fantastico if you see this error on every Fantastico page:

No Input File Specified

Create the following directories if they do not exist:

Code:

mkdir /usr/local/cpanel/base/tmp
mkdir /usr/local/cpanel/3rdparty/tmp

Then chmod each one of them to 777:

Code:

chmod -R 1777 /usr/local/cpanel/base/tmp
chmod -R 1777 /usr/local/cpanel/3rdparty/tmp

chmod -R 1777 /tmp

If it doeesn’t fix then run the following script

/scripts/makecpphp

Above script will make new cpanel php.ini file, please note that this is not related to apache,  php.

How to fix Apache error (28)No space left on device

Tuesday, August 18th, 2009

On some occasions apache will just abruptly fail, and become stopped, failing to restart with an error message like

————————————-
[Tue Aug 18 16:34:45 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Tue Aug 18 16:34:45 2009] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock
Configuration Failed
[Tue Aug 18 16:38:46 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Tue Aug 18 16:38:46 2009] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock
Configuration Failed
————————————-

Checking your disk shows that you have plenty of space. The problem is that apache didn’t shut down properly, and it’s left myriads of semaphore-arrays left, owned by my apache-user. Run:-

# ipcs -s | grep nobody

Removing these semaphores immediately should solve the problem and allow apache to start.

# ipcs -s | grep nobody | perl -e ‘while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}’


R=lookuphost defer (-1): host lookup did not complete

Wednesday, August 5th, 2009

If you see following error message in exim maillogs

==============
2009-08-05 15:30:06 1MYhUc-0007Bz-LU == USER@domain.com R=lookuphost defer (-1): host lookup did not complete
==============

Solution : This is likely because your resolving nameservers are no longer responding to DNS queries. To fix this issue, you can manually edit the /etc/resolv.conf file.

How to change default IP for Exim

Wednesday, July 29th, 2009

To configure exim to send mail using a different  IP other than the main shared IP.

vi /etc/exim.conf

Search for the following lines in /etc/exim.conf

remote_smtp:
driver = smtp

add the following line ,

interface = IPhere

and restart exim.

This would be helpful when your Main IP is blocked by RBL/CRL/AOL.

Unable to setup password protect directories if Frontpage Extenstion is enabled.

Tuesday, January 20th, 2009

Unable to setup password protect directories if Frontpage Extenstion is enabled.

As long as Front Page extensions are not installed on the domain,you can go to Apache in your service menu (in Cpanel) and click on the pencil (edit) icon for a rich set of administrative tools to manage password files and groups.If you are using Front Page to create your website, you will needto password protect directories using the available options in theFront Page software.