Connect with the world's leading business experts.

Get instant access to their expertise via world–class Q&A, Research, and Events.
×
0

Linux Server Setup: Part 2 - Domains, Networking, and Software

Introduction

In Part 1, we took a brief look at various Linux distributions that are commonly used on servers.  The intent was to help you choose the distribution that best fits your dedicated server.

Networking with a Linux server can be somewhat intimidating, especially for those accustomed to working in a GUI environment.  Fortunately, there are plenty of guides around the Web and also official documentation for setting up a Linux server to connect to the Internet.  Rather than repeating the documentation and making this article unduly long, we will focus on a few important aspects of Linux server networking that you should take into consideration.

Considerations

Server Host Name

While human beings are quite comfortable using words to identify objects, places, people, and animals, computers primarily rely on numbers.  Your computer's primary identification of itself is a series of numbers.  Likewise, a server informs other servers of its name using a series of numbers collectively called an IP address.

It is necessary to have at least one IP address assigned to a server in order for it to communicate with the rest of the Internet.  Dedicated IP addresses are assigned by Internet Service Providers, so you should already know what your IP address is.  The next step is to assign a hostname.

In Linux, the hostname is normally the computer name that was assigned during installation.  It was probably not a fully qualified domain name, but in order for anyone to reach the server with words, rather than numbers, a domain must be assigned. 

The hostname that you assign will be the primary domain of the server, so although you can assign additional domains, choose the primary one carefully.  To check the current hostname, simply type "hostname" from the command line.

To edit the current hostname, login as root and edit  /etc/hosts.  By default, the hosts file will have the localhost address listed:

127.0.0.1  localhost

You should add an additional line containing your IP address followed by the domain name: 

  1. 192.168.254.254       mydomain.tld

 Once you reboot the server, the hostname settings should take effect.

 

DNS and Nameservers

One of the issues you must consider with your new server is whether or not you want to handle your own DNS and Nameservers.  As a general Internet standard, your nameservers should be hosted on at least two different servers in different physical locations.  This prevents your server from going completely offline if one of the nameserver hosts experiences an outage.

There are services that can host nameservers for reasonable fees.  Furthermore, many dedicated server companies will offer nameservers as part of their setup.

The actual nameserver settings are found in /etc/resolv.conf and should look something like this:

search mydomain.tld

nameserver 192.168.1.100

nameserver 192.168.1.102

To test your current nameserver configuration, run nslookup:

nslookup mydomain.tld

Linux servers can also manage DNS using a program called Bind (also referred to as nameD).  Configuring Bind manually can be quite a task, but most hosting control panels allow you to configure DNS settings more easily.  The important issue to consider with DNS is whether your Linux distribution runs nameD as a generic DNS user or in a full chroot environment.  Running DNS in a chroot setting provides some added security, so you might want to consider it, even if it is not the default setting.  Depending on which one the distribution uses, the DNS settings will vary.  Consult your documentation for more information.

Any user with an account on your server will need to point their domain to your nameservers and configure their DNS to use your IP addresses.  As with your primary domain, any hosted domains should also have at least two nameservers.

 

Software

Without the right software, a server is still just an Internet-connected computer.  A server needs software to connect to the various components of the Internet (i.e. the Web, Email, and FTP).  Depending on your needs, you may or may not decide to enable access to certain aspects of the Internet.  For example, if the server will primarily function as a dedicated gaming server, running email services is undoubtedly superfluous.

The following are common software applications that most dedicated servers will run:

1. Web Server.  Nearly all dedicated servers connected to the Internet are also connected to the Web.  Common Linux web server software includes Apache HTTP Server, NginX, and Lighttpd.

2. Mail Server. Although many email users are migrating to cloud computing services, plenty still rely on their hosts' mail servers.  Common mail services are Sendmail and Postfix.

3. FTP Server.  Files transferred to and from a server are primarily sent via FTP (File Transfer Protocol).  Common FTP applications include ProFTPD and vsftpd.

4. SSH Server.  Secure Shell (SSH) uses an encryption method to make communication between the server and a client computer more secure.  SSH can also be used to secure other services, such as FTP, by way of SFTP.  The most common SSH server is OpenSSH.

5. Database Server.  In the world of dynamic web sites, most data is now stored in some type of database, rather than within HTML files.  Popular database servers are MySQL and PostgreSQL.  Some high-end servers also use database software that do not require services, such as SQLite.

Conclusion

Installing software is quite easy with Linux. As stated in Part 1, most distributions have some sort of package management system.  For example, installing Apache HTTP Server on a Debian server is as easy as typing: apt-get install apache2

Once you have DNS configured and the software you want installed, you are almost ready to take your server for a test drive, but it is at this point that you need to strongly consider security.  In Part 3, we will cover some of the Linux server security essentials.

Disclosures and References

Chris Hartwell is the owner and admin of Dedicated Server School

0
Mark Moore
Network Administrator
  • Recommended by:

I have a bit of grief on the Server Host Name declaration. The /etc/hosts file should not be tampered with. your DNS (Bind9 or MS Server) should push the "domain" and "search" declarations in the /etc/resolv.conf. Otherwise, it is not doing its job. Proper DNS configuration should take care of reverse mappings, making any changes to the hosts file unnecessary. Editing the hosts file works, but it is not likely best practice or practical for large scale environments.

Additionally, if you want to map your server to a specific IP number, you could go with a domain alias on your NIC. Again, the ideal situation is to use DNS so that you minimize these manual changes.

What are your thoughts?

Answer This Question