Category Archives: RevTI

My blog in managing RevTI

Correcting Wrong CPanel’s Nameservers IPs

On CPanel 11.30+ when you go to “Main >> DNS Functions >> Nameserver IPs” and found that the nameservers listed is wrong (this might happen if you just finished doing server migration), you can fix it by following these steps:

1. Make sure that you already update the child nameservers to the new IPs and its fully propagated.
2. Go to “Main >> Server Configuration >> Basic cPanel & WHM Setup” and click on “Assign IP address” button on each of your nameservers. Make sure that the IP being shown on the pop-up window are the correct IP for your nameserver.
3. Login to your server as root and run the script: /usr/local/cpanel/scripts/updatenameserverips to update CPanel nameservers list.
4. Check “Main >> DNS Functions >> Nameserver IPs” again and it should show the correct settings.

Can’t Create or Write on /tmp With Error: No space left on device

I just got a problem with writing error on /tmp on one of my client server. The strange problem is that df -h command shows that /tmp only 35% used so there should be plenty of space to write on.

After some investigation it seems that the /tmp partition hit the number of files limit due to caching files from nginx filling up /tmp, hence it’s not possible to create new files. This problem cause PHP scripts on Cpanel server to show error regarding session as by default Cpanel installation, PHP session are written in /tmp.

Clearing nginx cache files seems to fix the problem. To prevent this from happening again I setup a cron job to clear nginx cache regularly.

Closing Open DNS Problem on BIND

Today I’m installing new CPanel server which come with BIND on it. After finished installing, I look at DNSReport website and found out that the DNS server have “open DNS” problem.

Here is easy fix for open DNS problem, all you need to do is modify your

file to look like this:

Where all IP addresses are your nameserver IPs, including cluster server IP if you set it.

Bandwidth Conversion Calculator

Most ISP (Internet Service Provider) and Datacenters giving you 2 types of bandwidth calculations: metered or unmetered. An ISP in Indonesia for example has internet packages which have data transfer quota (also means metered) and unlimited data transfer (also means unmetered). Same does with datacenters, usually they offer a server with specified monthly data transfer quota or capped unmetered bandwidth.

As user we must be a little bit smart on deciding whether we will subscribe for metered or unmetered bandwidth. In the case of renting server on a datacenter, usually they put your server on 100Mbps port if you subscribe for metered bandwidth. In other side, most datacenter cap your bandwidth in the range of 1Mbps to 10Mbps (depends on datacenter) so your server can only use up to that range even the network card on your server is 100Mbps NIC.
Continue reading Bandwidth Conversion Calculator

Apache Can’t Load Modules Problem

Today I’m having problem with CPanel’s Apache when I upgrade it. The Apache server won’t start, it gives this error messages:

Obviously that the module cannot be found by Apache, here is how to fix it:

After compile finish the .so file will be copied to the right directory and you can start Apache by executing command:

Synchronizing Server Date and Time Using rdate

You can sync or update the date and time of your linux server by using rdate command. rdate command will the check the time server and compare the date time on your server to the time server.

If there is time difference, rdate will update your server date time. To update your server date time run this command:

The list of time server can be found on this website: use the one that near with your server location.

Since my server is in Singapore then I use this command:

To set the hardware clock to match with your system clock, you can use this command:

Customizing Bash Prompt

I install several servers 2 days ago, what I found after I login to SSH is that the bash prompt is different with my older server, it only show “bash-3.1#” instead of “[username@servername – directory] $”

I found “bash-3.1#” is difficult as I don’t know my current directory location. With a little bit Google search I get an answer.

You can customize your bash prompt by creating a file named .bash_profile (there is a “dot” in front of the filename)

Insert this code in .bash_profile file:

now your bash prompt will look like this:

Creating Empty File with Specified Size

If you want to do some download speed test, you can create a dummy file which have specific file size. To create an empty file with size you want type this command:

The command above will create a 10 MB sized file. If you want to create another file with different size, change the number after “count=”. Any number given after “count=” will be multiplied by 1024k or 1MB.