Posts Tagged ‘cPanel’

WordPress: Restricting website access to your IP address

For various reasons, you might need to restrict your website to your IP address.
This is particularly useful for development purposes, as it blocks access to the website (or to redirect the visitor somewhere else), while allowing the developer to navigate through it normally.

In order to only allow your IP address to access your website (or blog) and block everyone else from accessing it, just add these 3 lines to your .htaccess file:

order deny,allow
allow from
deny from all

Simply replace “” with your own IP address, save your .htaccess file and test it out!
If you can’t find your IP address, simply use or any similar site to obtain it (there are plenty of them).

A very efficient way to test if someone is able to access your website through a different IP address is by using a web proxy to access it (such as MegaProxy for example).
To revert the changes and therefore allow everyone to access the website again, simply delete those lines from .htaccess and save the file again.

cPanel: RoundCube not working (Error 500)

Symptom: When you log into WebMail and select RoundCube, you will get an Error 500.

The first thing to try is to force an update for RoundCube by issuing the following command via SSH:

/usr/local/cpanel/bin/update-roundcube –force

If the reason for RoundCube not to work is its configuration files, this command will do the trick.
Now, if you get a MySQL Database error while updating it, it’s possible that your “roundcube” database is either corrupt, or you might have the InnoDB scheme disabled (RoundCube requires InnoDB).
In order to check if InnoDB is enabled on your server, simply issue the following command through SSH:

mysqladmin var |grep have_innodb

The command output should be similar to this:

| have_innodb                             | YES                                               |

If by any reason you get a “NO”, it means InnoDB is disabled, and you have to enable it to make RoundCube (and it’s update script) work.
The first thing to look out for is your MySQL master configuration file at /etc/my.cnf. Make sure you’re not using the “skip-innodb” command in it.

To make it easy, just run the following command:

grep skip-innodb /etc/my.cnf

If the skip-innodb command is found on the file, make sure you remove it.

NOTE: From this line on, I’m assuming you are NOT using the InnoDB schema for any of your databases. Please note that the procedure below may (most likely will) render any databases using the InnoDB schema corrupt. Do not proceed unless you’re 100% certain of what you’re doing.

If it’s not found, and you’re still having problems getting InnoDB to work, try the following batch of commands (just paste the full line in your command prompt and press Enter):

service mysql stop; cd /var/lib/mysql/; mv ibdata1 ibdata1.bak; mv ib_logfile0 ib_logfile0.bak; mv ib_logfile1 ib_logfile1.bak; service mysql start

The line above will stop the MySQL Server, change the working directory to “/var/lib/mysql/” where it then renames a few files and start the MySQL Server again. It’s important to shut it down before renaming any files.
Once the MySQL Daemon is started, the files will be generated again. Once the process is complete, check for InnoDB again using:

mysqladmin var |grep have_innodb

If it is showing as enabled, try to update RoundCube again:

/usr/local/cpanel/bin/update-roundcube –force

If you’re still getting a MySQL Database error after this, it’s most likely due to your RoundCube database being corrupted.
The solution on that case is to delete the database via phpMyAdmin (remove the database with the name “roundcube”), or you can also do it via SSH by logging into the MySQL Server (just type “mysql” in SSH) and issuing the following command:

drop database roundcube;

Now try to run the update script again (it should work this time):

/usr/local/cpanel/bin/update-roundcube –force


cPanel: Error when creating a new package

Symptom: When creating a new package in cPanel you get the following error:

[an error occurred while processing this directive] 

This is usually due to cPanel’s memory limits. (It’s basically trying to create the package for you but there’s not enough memory left for the process to complete).

To fix this, log into WebHost Manager as root, navigate to Server Configuration » Tweak Settings and increase the value for “Max cPanel process memory” to 512M or higher if needed. (The default setting is 256M)

Save your changes and try to add the package again.