17.8 Chapter Summary

In this chapter we have covered the philosophy of DevOps, the selecting of a hosting company, virtualization, and the practical side of domain name registration and DNS. We explored some Apache and NginX capabilities and configuration options including encryption, caching, and redirection, and saw some modern virtualization technologies that simplify web development and deployment. You learned to start fine-tuning your server to handle higher traffic and learned about logging capabilities that result in good analytic information that help understand your website traffic.

17.8.1 Key Terms

17.8.2 Review Questions

  1. What is DevOps, and why is it important to the web developer?

  2. What are the disadvantages of shared hosting?

  3. What is the difference between collocated hosting and dedicated hosting?

  4. What port is used for HTTP traffic by default?

  5. How many sites can be hosted on the same server?

  6. Why is serving multiple requests from the same connection more efficient?

  7. What are the risks of serving multiple requests on the same connection?

  8. How does Continous Integration impact web development?

  9. Why is NginX so widely used for caching?

  10. How does the server distinguish between file types?

  11. What possible responses could a server have for a folder request?

  12. What is a hypervisor? What are the differences between Type 1 and Type 2 hypervisors?

  13. What advantages does cloud computing/hosting/virtualization have for organizations?

  14. How are tools such as Vagrant and Docker being used in the web development workflow?

  15. Describe the two distinct types of URL rewriting.

  16. What types of things can be stored in log files by Apache?

17.8.3 Hands-On Practice

Practical system administrative tasks are difficult to simulate in a classroom environment. Asking students to register a domain is a dangerous proposition, given the public WHOIS database they will be registered into, the financial burden imposed, and the legal implications if the student accidentally infringes on a registered trademark, to name but a few. Nonetheless, at some point, the tricky and complicated parts of web development must be attempted. The following exercises are optional or may be used as walkthrough in class under the guidance of your professor.

Project 1: Register a Domain and Setup Hosting

Difficulty Level: Easy
Overview

This project assumes that you have an idea for a website. Alternatively, consider a website about yourself like one of the authors at www.randyconnolly.com. With your idea in mind, we will now register the domain name and purchase hosting, then point the domain to the hosting you purchased. How you develop the site itself is up to you; perhaps you can use a CMS, or develop it from scratch.

Instructions
  1. Determine the name (second level) you wish to register.

  2. Determine the top-level domain(s) you wish to register.

  3. Find a registrar that is authorized to sell you a lease on the top-level domains and purchase the domain names if they are available. If not, consider other domain names.

  4. Now decide if you want private WHOIS registration or not. Proceed with registering your domain.

  5. Determine where you want to host your website and purchase hosting.

  6. Find your host’s domain name servers, and then go back to your registrar and point your name servers to the ones provided by the host.

  7. Set up a simple hello world page on your domain for the time being.

  8. Ensure your host’s DNS entries exist to point your domain name to the IP address of the host.

Guidance and Testing
  1. To test things out right away, set up your hosts.txt file to point your domain to the IP address of your host (refer back to Chapter 1 for an explanation). Type the domain into your browser and you should see the hello world page you created.

  2. Remove the hosts.txt entry and confirm that the domain is not yet up.

  3. Perform a dig command on your server name to determine if the top-level servers have been updated. You can alternatively find online services to test your DNS.

  4. Wait 48 hours and test the domain on any computer. Your site’s hello world page should pop up.

Project 2: Configure DNS for a Mail Server

Difficulty Level: Intermediate
Overview

Using the domain name purchased in the last project, this project sets up email correctly using DNS records. The configuration of a mail server is beyond the scope of pure web development.

Instructions
  1. Find out where you will host your email. If you choose the same host as your website, then the DNS MX records are already likely in place, but you should confirm.

  2. You might consider one of the many third-party email hosting solutions available outside your website hosting package. Google’s Gmail and Microsoft’s Exchange Online both offer well-accepted packages and redundant systems. If you do choose one of those hosts, you will need to update your MX records on your name servers at your hosting company.

  3. Add the SPF record as both a TXT record and a SPF DNS record.

  4. Try to get a reverse DNS entry added by your host so that email sent from the web server will be identified as trusted.

Guidance and Testing
  1. To test things out right away, use the dig command to check your name servers and confirm that the MX records are correct. You may need to wait 48 hours for the changes to propagate.

  2. Send an email from another account to the new address at your new domain. The email should arrive in your inbox.

  3. Try sending email from the new account. The email should arrive in your inbox.

17.8.4 References

  1. 1. Fowler, Martin 2006 https://martinfowler.com/articles/continuousIntegration.html

  2. 2. L. Crispin and J. Gregory. Agile Testing: A Practical Guide for Testers and Agile Teams, Addison-Wesley, Boston, 2008.

  3. 3. J. Humble and D. Farley. Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation, Addison-Wesley, Boston.

  4. 4. J. Whittaker, J. Arbon, and J. Carollo. How Google Tests Software, Addison-Wesley, Boston, 2012.

  5. 5. K. Beck. Test-Driven Development by Example, Addison-Wesley, Boston, 2002.

  6. 6. https://divante.com/blog/10-companies-that-implemented-the-microservice-architecture-and-paved-the-way-for-others/

  7. 7. openspf, “Sender Policy Framework.” [Online]. http://www.openspf.org/.

  8. 8. M. Sobel, A Practical Guide to Fedora and Red Hat Enterprise Linux, 6th ed., Prentice Hall Press, Upper Saddle River, NJ, 2013.

  9. 9. M. Sobel, A Practical Guide to Linux Commands, Editors, and Shell Programming, 3rd ed., Prentice Hall Press, Upper Saddle River, NJ, 2013.

  10. 10. (http://nginx.org/en/docs/dirindex.html)

  11. 11. HTTP Keepalive Connections and Web Performance (https://www.nginx.com/blog/http-keepalives-and-web-performance)

  12. 12. Apache, “Apache HTTP Server Version 2.2.” [Online]. http://httpd.apache.org/docs/2.2/vhosts/name-based.html.

  13. 13. Apache, “Apache Module mod_autoindex.” [Online]. http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html.

  14. 14. N. Freed, “RFC 2046 - Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types.” [Online]. http://tools.ietf.org/html/rfc2046.

  15. 15. Apache, “Apache HTTP Server Version 2.2.” [Online]. http://httpd.apache.org/docs/2.2/rewrite/flags.html.

  16. 16. Apache, “Apache Module mod_log_config.” [Online]. http://httpd.apache.org/docs/2.2/mod/mod_log_config.html.

  17. 17. Cronolog, “cronolog.org Flexible Web Log Rotation.” [Online]. http://cronolog.org/.

  18. 18. NginX, Alphabetical index of directives [Online] http://nginx.org/en/docs/dirindex.html.