How to Change a Hostname
Configuring a Host-Based Firewall
Configure IP Addresses for Your New Red hat Server
How to Configure DNS
How to Handle Package Management
How to Handle Service Management
How and Why to Fool DNS!
What is Wildcard DNS?
Don’t Firewall Yourself Out
Changing Hostnames
Debian
To change the FQDN (fully qualified domain name) of a Debian linux server, perform the following:
# echo “SERVER_FQDN” > /etc/hostname
The server’s hostname will be updated after a restart.
Red hat
To change the FQDN (fully qualified domain name) of a Red hat linux server, add the line
HOSTNAME=SERVER_FQDN
To the file /etc/sysconfig/network, making sure to remove any other line that starts with HOSTNAME=. The server’s hostname will be updated after a restart.
Configuring IP Addresses
Configuring host-based firewall
DNS Configuration
Any machine ServePath deploys will be configured to use the ServePath nameservers. This configuration is stored in the file /etc/resolv.conf. This example resolv.conf is using 1.2.3.4 and 5.6.7.8 as the nameservers.
/etc/resolv.conf:
Nameserver 1.2.3.4
Nameserver 5.6.7.8
Package Management
Service management
Debian
To get a list of services that are configured to startup at run-level 2 (Debian’s default run-level), execute the following as root:
# ls –l /etc/rc2.d/S*
To add a service to the startup list, execute:
# update-rc.d service_name start 99 2 3 4 5 . stop 0 1 6 .
The above will start service_name as the last step of the startup service in run-levels 2, 3, 4, and 5, and stop the service in run-levels 0, 1, and 6.
To stop a service from starting on bootup, execute:
# rm –rf /etc/rc2.d/S*service_name
*** you can also execute ‘update-rc.d –f service_name remove’ ***
To manually start or stop a service, execute the following as root:
# /etc/init.d/service_name [start|stop]
For more information regarding Debian’s service management options, execute ‘man update-rc.d’ from a shell.
Red hat
To get a list of services that are configured to startup at run-level 3 (Red hat’s default run-level), execute the following as root:
# chkconfig –list |grep “3:on”To add a service to the startup list, execute:
# chkconfig –add service_name
To stop a service from starting on bootup, execute:
# chkconfig –del service_name
To manually start or stop a service, execute the following as root:
# service service_name [start|stop]
For more information regarding Red hat’s service management options, execute ‘man chkconfig’ from a shell.
Fool DNS!
If you are testing the setup on a server that is not yet live, and you haven't pointed your DNS to your new server yet, here is a trick. You can fool your client machine into resolving the new IP by editing your local hosts file.
Here's how it works:
Your operating system will attempt to resolve domain names to IP addresses by first accessing a local file called the "hosts" file, which is simply a database of IP-to-hostname mappings. DNS is queried only if the domain name that you are looking for is not listed in this file. So, to trick your OS into resolving a "fake" IP address for your domain (pointing to your new server), just add one line to your local hosts file!
For Example:
12.13.14.15 hostname.YOUR-DOMAIN-HERE.com
Host File Locations:
Windows Clients – C:\winnt\system32\drivers\etc\hosts
Linux/Unix clients - /etc/hosts
* Note that the filename has no extension, it is simply ‘hosts.’
Get the most out of DNS with Wildcard DNS!
Do you want your users to get to your web site even if they mistype the URL? Use wildcard DNS to allow Internet users to resolve your IP address no matter what hostname they type.
How to do it:
Just use a "*" in the place of the host name in your DNS configuration (works for BIND or Windows DNS)
*.YOUR-DOMAIN-HERE.com IN A 123.123.123.123
Don't Firewall Yourself Out!
ServePath deploys your server with a software firewall to prevent unauthorized access to your server. But when making changes to your host-based software firewall, make sure that you do not block the remote administration ports and lock yourself out of your own server! Be sure to keep AT LEAST the following port open:
Port 22/TCP for SSH
