Web Server and Email

This topic is part of our Linux Network Services and Security training

Apache HTTP Server

The Apache HTTP (Web) Server is the most popular web server in the world. In July 2012, 61.45% of web servers on the Internet were running the Apache software (14.62% run IIS and 11.09% run nginx)

Red Hat Enterprise Linux and CentOS Linux provide Apache and it is important that a system administrator knows how to:

  • Optimise performance (section 14.1.5.3. Common Multi-Processing Module Directives)
  • Set up virtual hosts (pay attention to conf.d/welcome.conf as well as the semantics of the NameVirtualHost directive)
  • Set up SSL (mod_ssl needs to be installed as well as crypto-utils to generate self-signed certificates for testing purposes). Even though virtual hosting can be used on an SSL-enabled web server, in practice, SSL is used when the server is being used for one website (or web application) only. This is because a non self-signed SSL certificate is tied to both an IP and a FQDN.

Of course, Apache, using the appropriate modules, can run server-side scripts written in programming languages such as PHP and Python.

Email

Email is an important network service and Postfix is the default email server in CentOS Linux (The venerable Sendmail is also available if needed). Postfix will handle sending emails through SMTP as well as delivering them locally. The default /etc/postfix/main.cf file does not allow Postfix to accept network connections from a host other than the local computer.

To configure Postfix to accept emails from external sources, the following needs to be done (section 15.3.1.2. Basic Postfix Configuration)

  • Edit the /etc/postfix/main.cf file with a text editor, such as vi.
  • Uncomment the mydomain line by removing the hash sign (#), and replace domain.tld with the domain the mail server is servicing, such as example.com.
  • Uncomment the myorigin = $mydomain line.
  • Uncomment the myhostname line, and replace host.domain.tld with the hostname for the machine.
  • Add mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
  • Uncomment the mynetworks line, and replace 168.100.189.0/28 with a valid network setting for hosts that can connect to the server.
  • Uncomment the inet_interfaces = all line.
  • Comment the inet_interfaces = localhost line.
  • Restart the postfix service.

Any email user agent (e.g. Evolution or Outlook) can be used to test the configuration.

POP3 Server

People who use clients like Outlook need a POP3 server and Dovecot can configured to become one:

  • In dovecot.conf, indicate that “protocols = pop3″ and “listen = *, ::”
  • In 10-auth.conf, indicate that “disable_plaintext_auth = no”
  • In 10-mail.conf, indicate that “mail_location = mbox:~/mail:INBOX=/var/mail/%u”
This topic is part of our Linux Network Services and Security training

Speak Your Mind

*