/usr Partition Full

Is your /usr partition full? Or almost full? That could be a problem. Here’s a way to fix it.

Run:

cd /usr/local/apache/logs/

List the contents of that directory with ll. Are there any big files? Empty those files. Here’s an example. If you want to empty error_log for example, just run:

echo > error_log

You can repeat this procedure in /usr/local/cpanel/logs/. Just empty any large files.

Then go to /usr/local/apache/domlogs/. And list the biggest 10 or 20 files. For the top 10, run:

ls -al -SR | head -10 —>

Are there any big files? Running awstats for that domain should clear the file. Just run:

/scripts/runweblogs user

Login to WHM. Check if log rotation is active for apache and cpanel logs. For apache, click Service Configuration -> Apache Configuration -> Log Rotation. For cpanel, click Service Configuration -> cPanel Log Rotation Configuration.

Posted in Cpanel Administration, Disk Space Administration | Leave a comment

Domain Iframe Redirect

Do you want to point your domain to a different domain, but in such a way that your domain appears always in the address bar of the visitor’s browser?

This is very useful when someone wants to point a domain to a free hosted application. Example: you build a website in a free hosting service or a free website builder service. And the website is hosted in a subdomain of that free service. And you don’t want your visitors to access that subdomain. You want them to access your domain instead.

It only applies if you have a hosting service. If you don’t, ask your domain registrar to point the domain to whatever url you want the domain to point to. Ask them to add a mask to the domain forward, so that the your domain remains always in the visitor’s address bar. In case you do have a hosting account, here’s how you can do that redirection. It’s called a Domain Iframe Redirect.

Upload an index.html with this code:

<html>

<head>
<title>Replace with title visitors will see if browser doesn't support javascript</title>
<script type="text/javascript">
function changeTitle()
   {
   if (top.frames['main'].document.title)
      {
      top.document.title=top.frames['main'].document.title;
      }
   }
</script>
</head>

<frameset>
<frame name="main" src="http://replace-this-url.destination-domain.com"scrolling="auto" target="main" ONLOAD="changeTitle();">

<noframes>

<body>
Please enable iframe support in your browser to access this website.
</body>

</noframes>

</frameset>

</html>

Read the comments in the code. Replace what needs to be replaced. And you’re ready to go!

Posted in Domain Management, Domains | Tagged | 73 Comments

Empty MySQL Backup – 20 bytes

If you login to cpanel, download a mysql backup and the backup is empty, try this:

Go to your home directory. You can use cpanel’s File Manager. Or you can access your home directory through ftp. Find a file called my.cnf. Rename it to my.cnf.backup.

What will happen? You probably changed your cpanel password. The new password was not updated in my.cnf. By deleting this file, the next time you login to cpanel, it will have to recreate it with your new password. And that will solve your mysql backup problem.

The mysql backup process uses that file to access the mysql databases. If the password is incorrect, the cpanel process will be denied access to those databases. You will not see any error, because it’s not logged in your cpanel interface. But you will get an empty database backup instead.

Posted in Cpanel Administration, MySQL Administration | Tagged | 3 Comments