Disable Mod_Security In .htaccess

November 20th, 2009

This post adresses the issue of disabling mod_security on a per account basis. Just add this code to a .htaccess file:

SecFilterEngine Off
SecFilterScanPOST Off

Wrong Datatype Error In Fantastico

November 5th, 2009

If you receive a Wrong Datatype in /tmp/ message in your fantastico, here’s the fix:

Login to WHM and check in Tweak Settings if Ioncube PHP Loader is selected. It should be.

If that solved the issue, Goodbye. If it didn’t, Hello!

SSH to your server as root and run this command:

/scripts/makecpphp

That should fix your problem.

Running PHP Script With Cronjob

November 3rd, 2009

It’s easy to configure a cron job in cpanel, in order to run a php script automatically. You must know the physical path of the script. That will be:

/home/username/public_html/folder/filename

Replace username, folders and filename.

And the php path, which will be /usr/local/bin/php

The command will then be:

/usr/local/bin/php -f /home/username/public_html/folder/filename

Configure the time settings. And it’s done.

Correct Permission Problem In Suphp

November 3rd, 2009

With Suphp, you can’t have any files or folders with permissions greater than 755. Otherwise, you will get a Internal Server Error. There could be other reasons for that error. You must check the apache error_log. In Centos, you will find that file in /usr/local/apache/logs/error_log.

Confirmed the permission problem, a easy fix is to ssh to the server. Access the public_html folder of the account. And run these commands:

find . -type f -exec chmod 644 '{}' \;
find . -type d -exec chmod 755 '{}' \;

If you don’t have ssh access to your shared hosting account, upload a php file to the public_html directory and call the file in the browser. Include this code in the php file:

<?
shell_exec("find . -type d -exec chmod 755 {} \\;");
shell_exec("find . -type f -name '*.php' -exec chmod 644 {} \\;");
?>

Meta Refresh Redirect

November 3rd, 2009

If you need to redirect your visitors to a different webpage, one of the options available for that redirect is a meta refresh redirect. This code is normally used to refresh the webpage after a few seconds. But it’s also used for url redirects. You just lower the refresh interval to zero. In the example we have a interval of 5 seconds.

<html>
<head>
<meta http-equiv="refresh" content="2;url=http://www.domain.com/new-url.html" />
<title>This Webpage has moved</title>
</head>
<body>
The content of this webpage has moved. If you're not redirected to the new webpage in a few seconds, please click <a href="http://www.domain.com/new-url.html">here</a> to go to the new webpage.
</body>
</html>

Free Live Chat Software

November 2nd, 2009

Here’s a list of a few live chat scripts. They are all open source and free:

Olark allows you to monitor and chat with customers as they browser your website.

LiveZilla is a Live Help, Char and Support script, that also allows you to monitor your visitors in real time.

Server Administration Companies

November 2nd, 2009

Here’s a list of companies that provide server administration services.

Most of these companies provide server administration for linux servers. But a few also support Windows servers. Check their websites for more information.

Normally, these companies will do security configuration and audits, software updates, server optimization and monitoring. And their mothly service will also include a few hours of server administration to fix any problems with your server software.

You can find cheap services, starting at $30 per month and per server. But a more reasonable price will be in the $50 / $100 range, for a more reliable service.

I can recommend Touch Support and Rack911.

Expired License

November 1st, 2009

Have you ever logged into cpanel or whm and found a Expired License message?Why and how to deal with this message?

One of the reasons for the display of this message could be that your cpanel license has expired. Check if that is the case. Cpanel has a tool for you to verify if your cpanel license is valid.

Your server’s main IP address could be different than the licensed IP address or your server could be experiencing problems perfoming dns lookups. SSH to your server and run the following command:


curl http://www.cPanel.net/showip.cgi

If your main IP is not licensed, you must update your cpanel’s license information. If you get an error, after running this command, you must check your /etc/hosts and /etc/resolv.conf files.

Also check if your hostname is properly configured. It should have this format: subdomain.domain.com.

Finally, try this command:


/usr/local/cpanel/cpkeyclt

It will just try to validate the license with cpanel’s servers. Sometimes, the expired license message is due to temporary connection problems with cpanel’s servers and the license is not validated. This command will resolve that issue. If you receive an error, you must check why your server is unable to connect with cpanel’s servers.

Round Cube Perfomance

November 1st, 2009

Cpanel has announced a few changes that will increase the perfomance of Round Cube, dealing with a growing number of reports regarding excessive CPU usage.  The changes have been applied to the Beta Build. And Cpanel will publish these changes to the Edge Build soon.

Round Cube is a very attractive webmail software, due to it’s AJAX features. I hope they can optimize it’s resource usage. You can’t rely on a webmail software that undermines the server’s perfomance.

New User Email Setup

November 1st, 2009

WordPress supports different roles. A subscriber can login to your blog and then comment without having to provide their name, email and website. On some blogs, you have to be a subscriber to comment, because the blog doesn’t allow anonymous comments, from unregistered visitors. Other roles include additional privileges.  A contributor can write articles, that will have to be approved by an editor or administrator. An author can write and publish articles, without moderation from an editor or administrator. And an editor and a administratior have additional privileges. Some blogs have a team or community orientation, encouraging the registration of subscribers, authors and editors.

When a visitor registers, to become a subscriber, he receives an automatic email generated by WordPress. How do you edit the message that is sent on that email? You will need a plugin for that purpose.

New User Email Setup is a new plugin for WordPress that enables you to change the subject, text body, from address, admin subject and admin text body of that automatic email, from WordPress’s administration interface. You wil be able to personalize your Welcome email and give it a personal touch.