Markus Blog What’s going on Internet?

1Aug/070

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

/etc/named.conf

file to look like this:

acl "trusted" {
      11.22.33.44;
      44.33.22.11;
      66.55.44.33;
      127.0.0.1;
};
 
options {
      directory "/var/named";
      version "not currently available";
      allow-recursion { trusted; };
      allow-notify { trusted; };
      allow-transfer { trusted; };
};

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

5Jul/070

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.

Filed under: RevTI Continue reading
5Jul/073

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:

Syntax error on line 216 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/mod_bwlimited.so into server: /usr/local/apache/libexec/mod_bwlimited.so: cannot open shared object file: No such file or directory
/etc/init.d/httpd start: httpd could not be started

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

cd /usr/local/cpanel/apache
/usr/local/apache/bin/apxs -iac mod_bwlimited.c

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

service httpd start
30Jun/070

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:

rdate -s <timeserver></timeserver>

The list of time server can be found on this website: http://www.eecis.udel.edu/~mills/ntp/clock1a.html use the one that near with your server location.

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

rdate -s nets.org.sg

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

/sbin/hwclock --systohc
25Jun/072

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:

export PS1="[u@h w]$ "

now your bash prompt will look like this:

[user@localhost /home/user]$
25Jun/070

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:

dd if=/dev/zero of=10mb-file.bin bs=1024k count=10

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.

25Jun/079

Transferring Files from Remote Server to Remote Server Using SCP

If you have more than one server and want to transfer files between the two, you can use SCP (Secure Copy). Here is how to do it:

$ scp /folder/file-to-tranfer username@remote.host.net:/folder/file-destination-name

SCP then will ask the password for username on the remote host that already specified, insert the username and press enter. Wait until the transfer finished and your file will be copied to the destination server.

23Jun/070

Disable Shell Access

If you want to create a user on your server but doesn't want to give him SSH access then you can run this command to disable his shell:

usermod -s /bin/false username

After running that command, the user specified will not have SSH access but still can do other things like FTP.

Page 1 of 3123