Monthly Archives: December 2009

How to add/change Nameservers in WHM

This is how you add or change a nameserver using GoDaddy.com as your registrar and WHM/cPanel. At the time of writing, I am using WHM 11.24.2 on a machine running CentOS 5.3.
Create a new nameserver in GoDaddy.com
  1. Log into GoDaddy.com.
  2. Click on ‘Domain Manager’ and then the domain to which you will be adding a name server.
  3. At the bottom-left corner of that page, you will see a box like this one:
    add nameserver in godaddy
    Click the ‘add’ link.
  4. Define the nameserver like this:
    Define Name Server in GoDaddy
  5. Click OK.
  6. Repeat these steps for all the nameservers you will be defining.  Typically, you need to create at least two, and they can share the same IP address.
Prepare the server
  1. ssh into the server and su to root.
  2. add the nameserver ip addresses in /etc/nameserverips in the following format:
    71.199.9.176=ns1.devinbaldwin.com
    71.199.9.176=ns2.devinbaldwin.com

Configure WHM

  1. Log in to WHM as root.
  2. Click on ‘Server Configuration’ > ‘Basic cPanel/WHM Setup’.
  3. Modify the ‘Primary Nameserver’ and ‘Secondary Nameserver’ fields to match the new nameserver.
    primary and secondary nameservers in whm
  4. Click on ‘Add an A entry for this nameserver’ on each of the new nameservers, enter the correct IP address in the popup, and click ‘Add Entry’.
  5. Select a nameserver from ‘Service Configuration’ > ‘Nameserver Selection’.  Bind is pretty much standard, but as long as the nameserver is not Disabled, you should be fine.

Modify Resellers’ Nameservers

  1. Go to ‘Resellers’ > ‘Reseller Center’.
  2. Under the ‘Reseller Modifications’ section, select a reseller, then click ‘Edit Privileges/Nameservers’.
  3. At the bottom of the page, enter in the new name servers.
    Reseller Nameserver
  4. Click ‘Save All Settings’.

If you need me to expand one of these sections, please comment.

My bout with MultiView

Apache has an incredible option called “MultiView.”  If you have a file named ‘file.php’ and you have a rewrite rule to rewrite ‘/file/image.jpeg’, MultiView will look at the requested URI ‘/file/image.jpeg’, see that there is no directory ‘/file/’, then it will see if there is a file named ‘file.php’.  It will then send the request to that file instead of honoring your original request.

I ran into this problem because I’m using VirtualHostX to write my <VirtualHost> definitions, and it adds ‘MultiViews’ automatically.  This has the effect of appending a ‘.php’ to the end of a directory. You can read about it here (scroll down to the MultiView part).

The fix is actually simple.  Either remove ‘MultiView’ from the <VirtualHost> definition (inside a <Directory> rule), or you can add the following line to your .htaccess file: ‘Options Indexes FollowSymLinks’

I hope this helps someone, someday.