Tuesday, 1 September 2009

What is the difference between mii-tool and ifconfig ?

mii-tool => only gives information whether the link is up or not, thus
used to see whether our drivers are properly installed and is our network
card detected properly.

ifconfig -> gives information about the ip set to the system, mak address,
gateway etc. also it can used to set the ip address temporarily to the
system like, *ifconfig eth0 *

What is the difference between mii-tool and ifconfig ?

mii-tool => only gives information whether the link is up or not, thus
used to see whether our drivers are properly installed and is our network
card detected properly.


ifconfig -> gives information about the ip set to the system, mak address,
gateway etc. also it can used to set the ip address temporarily to the
system like, *ifconfig eth0 *

Error: "Too many MySQL connections".

Error "Too many MySQL connections". Needs to restart the MySQL service each time to fix it.

It seems that the  receiving  error is  due to number of MySQL connections are exceeded. You can set the maximum allowed connection in '/etc/my.cnf' (Only for Linux). Additionally you will also need to check which user is using more connections on the server. Generally this happens due to bad coding and if you are not closing MySQL connections in the scripts.

How to hide your shell commands

Have you thought of hiding what you are doing on your linux bash shell prompt? and not allowing your colleague to see what command you are entering or do you want to confuse your colleague by showing something invisible but work as visible? then read out this…

Today I came across a neat, but pointless shell command. By running the following in shell, it will hide any commands you run.
root@server2 [/]# stty -echo

In order to disable this mode, simply remove the “-” before echo.
root@server2 [/]# stty echo

I guess there really is no point to the command, though you could always mess with your coworkers if they leave their shell prompt open

Failure Reason: Unable to connect to port 80

httpd failed @ Thu Aug  11 01:39:08 2009. A restart was attempted automagically.
Service Check Method:  [tcp connect]
 
Failure Reason: Unable to connect to port 80


It seems that your server is exceeding number of allowed connection. Check Apache error log:

# grep MaxClients /usr/local/apache/logs/error_log


Edit the http.conf file.

 

How to install latest RoundCube on cPanel

Update/install latest RoundCube on cPanel

First you will have to uninstall/remove exiting RoundCube files/folder/database on your server,

  • Uninstall/remove exiting RoundCube


cd /usr/local/cpanel/base
rm -rf roundcube*
mysql -e 'drop database roundcube';
/scripts/upcp

Now follow the following steps to  update/install latest roundcube  version ,we need to get Roundcube before we can use it. The easiest way to get it is to visit http://www.roundcube.net and click on “Downloads” or just go to http://roundcube.net/downloads. Wait for it to download and then unzip (using WinZip or ZipGenius or tar -xzf roundcubemail-0.1.tar.gz) in the current directory.

  • update/install latest roundcube


cd /usr/local/cpanel/base
wget -O roundcube.tar.gz http://nchc.dl.sourceforge.net/sourceforge/
roundcubemail/roundcubemail-0.2.1.tar.gz
rm -rf roundcube.tar.gz
mv -f roundcubemail-0.2.1/ roundcube
cd roundcube
chmod -R 777 temp
chmod -R 777 logs


  • Database Configuration


Create the database, database user and install the intial sql file. The following commands will do this for you.
mysql -e "CREATE DATABASE roundcube;"
mysql -e "GRANT ALL PRIVILEGES ON roundcube.* TO roundcube@localhost IDENTIFIED BY 'DATABASEPASSWORD';"
mysql -e "FLUSH PRIVILEGES;"
mysql -e "use roundcube; source SQL/mysql.initial.sql;"

You will have to replace the roundcube password with ‘DATABASEPASSWORD’ field.

  • Configuring RoundCube


cd config
mv db.inc.php.dist db.inc.php
mv main.inc.php.dist main.inc.php

then open database configruation file  db.inc.php in your favroite editor like vi or pico or nano
vi db.inc.php
Find following line
$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';

Replace it with
$rcmail_config['db_dsnw'] = 'mysql://roundcube:DATABASEPASSWORD@localhost/roundcube';

Now Open main.inc.php

vi main.inc.php

Find
$rcmail_config['default_host'] = '';

Replace with
$rcmail_config['default_host'] = 'localhost';

Last steps , restart the mysql, cpanel services on your server. That’s it ,Have fun with your new Roundcube installation!!

Error: Fantastico is not installed at the default location

The error was

Fantastico is not installed at the default location

/usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory

from it's current location to /usr/local/cpanel/3rdparty/fantastico OR

enable ioncube loaders in WHM -> Tweak settings.

Make sure ioncube installed on server as well as make sure it is enable in WHM -> Tweak settings.

Check the Ioncube radio button and click on Save

If Ioncube is not installed on the server please fire the command below

root@server [~]# /scripts/phpextensionmgr install IonCubeLoader

Enabling ioncube did not fix it for me. Maybe it will for you. After looking I found cpanel now uses

/var/cpanel/3rdparty/bin/php NOT /usr/local/cpanel/3rdparty/bin/php

After doing a php info I saw it did not have a php.ini file in the new location. The fix was:

cp /usr/local/cpanel/3rdparty/etc/php.ini /var/cpanel/3rdparty/etc

Other Possible Fixes

Try to update fantastico with

# cd /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/scripts/ ; /usr/local/cpanel/3rdparty/bin/php cron.php

Rebuild cpanel’s php with

root@server [~]# /scripts/makecpphp

Try a cpanel update with

root@server [~]# /scripts/upcp --force