Web Server Design, Installation, Configuration, Analysis, and Monitoring

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License . Essentially, you can use, reuse, share, and rebuild but acknowledgement and credit are required. No commercial use permitted. Follow the link for legalities and details.

This version of the course has been updated and revised to accommodate Red Hat (and CentOS) version 7. These are the latest releases in that operating system line.

Revision History
Revision #1418226783 ---Prior to December 2014 bc
--> Written for Red Hat & CentOS 6
Revision #1470248162 ---Aug 03, 2016 at 13:16:02 bc
--> Written for Red Hat & CentOS 7

Table of Contents

Preface
Introduction to the webserver Class
Background Info
Audience
Course Format & Communication
Reasonable Expectations
Operating System & Platform
Suggestions for the Course
1. Rackspace
Rackspace Introduction
Rackspace Account
Rackspace Login
Rackspace Interface
Rackspace Account Check Point
2. Rackspace Virtual Machine
Design and Launch via Rackspace Interface
Machine Design Considerations
Launch the Machine
Machine Monitoring Considerations
'ping' the Virtual Machine
Initial Login to the Virtual Machine
Virtual Machine Reboot
Virtual Machine Check Point
3. Domain Name System
Introduction to DNS Configuration
Purchase Domain Name Through the Registrar
Configure Name Servers at the Registrar
Configure DNS for Rackspace Machine
Name Server Entries
Verify DNS with `ping` & `dig`
DNS Check Point
4. Machine Configuration
Introduction to Machine Configuration
Update the Machine
Hostname
Set the Correct Time Zone
Adding a Regular User
Firewall Introduction
SELinux
Machine Configuration Check Point
5. SSH
Introduction to the SSH Protocol
SSH Client
SSH Connection
SSH from Windows Machine
SSH Server
SSH Access Logs
Additional SSH Configuration
SSH Check Point
6. Apache Web Server on Linux
Introduction to the 'apache' Web Server
apache Installation
apache Configuration
apache Log File Introduction
Web Server Logs
apache Virtual Host Introduction
apache Virtual Host Configuration
apache Virtual Host Content
apache Virtual Host DNS Entry
apache Virtual Host Access
apache Password Protected Directory
Configure Password Protected Directory
Create User for apache Protected Directory
Create Content for apache Protected Directory
Access the apache Protected Directory
PHP on the apache Web Server
PHP Installation
Fine Tune PHP Configuration
Create PHP Test Content
PERL on the apache Web Server
PERL Configuration
PERL Script
Web Access PERL Script
What Makes this PERL Script Work?
apache Online Manual
Web Server Check Point
7. FTP
Introduction to vsftpd
FTP Installation
FTP Configuration
FTP Service Enable & Restart
FTP Firewall
FTP Kernel Module
FTP Access
FTP Logs
FTP Check Point
8. SMTP
Postfix Mail Service Introduction
Postfix Installation
SMTP Configuration
Postfix MX Record
SMTP Logs
SMTP Firewall
mailx Command Line Mailer
Testing & Troubleshooting Email
SMTP Check Point
9. Bonus Section
Additional Items
MySQL Installation & Hardening
Installing Additional Software
SSH Extras
Apache Extras
FTP Extras
nmap - Network MAPper Security Scanner
RackSpace Server Login Via Console
Additional Items Check Point
10. Linux Command Line Review
Crucial Linux Commands
11. FAQ

List of Figures

1.1. Rackspace Account
1.2. Rackspace Login
1.3. Rackspace Interface
2.1. Server Design Considerations
2.2. Create a Rackspace Server, Step #1
2.3. Create a Rackspace Server, Step #2
2.4. Create a Rackspace Server, Step #3
2.5. Create a Rackspace Server, Step #4
2.6. Create a Rackspace Server, Step #5
2.7. Create a Rackspace Server, Step #6
2.8. Create a Rackspace Server, Step #7
2.9. Create a Rackspace Server, Step #8
2.10. Create a Rackspace Server, Step #9
2.11. Create a Rackspace Server, Step #10
2.12. Create a Rackspace Server, Step #11
2.13. Create a Rackspace Server, Step #12
2.14. Create a Rackspace Server, Step #13
2.15. Rackspace Machine Monitoring
2.16. Rackspace Networking
2.17. Rackspace Machine Volumes
2.18. Rackspace Machine Image
2.19. Rackspace Machine Backup
2.20. Login to Rackspace Machine
2.21. Login Certificate Acceptance Prompt
2.22. New Machine Failed Logins
2.23. Reboot the Rackspace VM
3.1. Name server Configuration
3.2. Configure Rackspace DNS #1
3.3. Configure Rackspace DNS #2
3.4. Configure Rackspace DNS #3
3.5. Configure Rackspace DNS #4
3.6. List of DNS Entries
3.7. Configure Reverse DNS
3.8. 'dig' DNS Name
4.1. Machine Update Image #1
4.2. Machine Update Image #2
4.3. Machine Update Image #3
4.4. Machine Update Image #4
4.5. No Updates Available
4.6. Hostname Configuration
4.7. Adding a User Image #1
4.8. Firewall Configuration Image #1
4.9. Firewall Configuration Image #2
4.10. Firewall Configuration Image #3
4.11. SELinux Configuration Image #1
4.12. SELinux Configuration Image #2
4.13. SELinux Configuration Image #3
5.1. Login via SSH
5.2. PuTTY Home Page
5.3. PuTTY Download
5.4. PuTTY Download #2
5.5. Save the PuTTY Binary
5.6. PuTTY Launch
5.7. PuTTY Login Prompt
5.8. PuTTY Login Success
5.9. Backing Up SSH Config File
5.10. SSH Banner Config Statement
5.11. Edit sshd_config for Banner
5.12. SSH Banner Content
5.13. SSH Daemon Restart
5.14. Presentation of the SSH Banner
5.15. Contents of '/var/log'
5.16. The 'lastlog' Utility
5.17. Reading '/var/log/secure'
5.18. Typical Output of '/var/log/secure'
6.1. apache Installation Image #1
6.2. apache Installation Image #2
6.3. apache Installation Image #3
6.4. apache Installation Image #4
6.5. apache Configuration Image #1
6.6. apache Configuration Image #2
6.7. apache Configuration Image #3
6.8. apache Configuration Image #4
6.9. apache Configuration Image #5
6.10. apache Firewall Configuration
6.11. apache Welcome Page
6.12. Creating the apache Index File
6.13. Simple Web Page
6.14. The 'httpd' Command
6.15. Web Logs Image #1
6.16. Web Server Error Log Image #1
6.17. Web Server Error Log Image #2
6.18. Virtual Host Configuration Image #1
6.19. Virtual Host Configuration Image #2
6.20. apache Virtual Host Image #3
6.21. Virtual Host Configuration Image #4
6.22. Password Protected Directory Image #1
6.23. Password Protected Directory Image #2
6.24. Password Protected Directory Image #3
6.25. Password Protected Directory Image #4
6.26. httpd Reload
6.27. Password Protected Directory Image #6
6.28. Virtual Host Configuration Image #6
6.29. PHP Image #1
6.30. PHP Image #2
6.31. PHP Image #3
6.32. PHP Image #4
6.33. PHP Image #5
6.34. PHP Image #6
6.35. PHP Image #7
6.36. PHP Image #8
6.37. PHP Image #9
6.38. PHP Configuration Read-Out
6.39. PERL Configuration Image #1
6.40. PERL Configuration Image #2
6.41. PERL Configuration Image #3
6.42. PERL Configuration Image #4
6.43. The apache Manual
7.1. FTP Installation Image #1
7.2. FTP Installation Image #2
7.3. FTP Installation Image #3
7.4. FTP Configuration Image #1
7.5. FTP Configuration Image #2
7.6. FTP Configuration Image #3
7.7. FTP Service Enable & Restart
7.8. FTP Firewall
7.9. FTP Kernel Module
7.10. FTP Access
8.1. Postfix Configuration Image #1
8.2. Postfix Configuration Image #2
8.3. Postfix Configuration Image #3
8.4. Postfix Configuration Image #4
8.5. Postfix Configuration Image #5
8.6. Postfix Restart
8.7. Postfix Log Image #1
8.8. Postfix Log Image #2
8.9. Postfix Firewall Image #1
8.10. Postfix Firewall Image #2
8.11. mailx Image #1
8.12. mailx Image #2
8.13. mailx Image #3
8.14. Add IPv6 Reverse Resource Record
9.1. SSH Copy ID
9.2. SSH Key Login
9.3. SSH AllowUsers Config Directive
9.4. SSH No Root Login
9.5. Set sudo Privileges
9.6. Set sudo Commands for 'wheel' Group
9.7. wheel Group Modification
9.8. SSH Key Login with sudo Privileges
9.9. HTTPS Browser Certificate Warning
9.10. SSL Certificate Contents
9.11. HTTPS in the Browser