1. Prerequisites
-
$ in front of an instruction mean that you have to invoke this at the prompt
2. Topic: Install Apache
2.1. Introduction
(1 pmd: subtotaal 2)
In the previous days we learned the basics regarding Linux and the commandline. Now you are working on Acme Corporations and we are getting to the point where the rubber hits the road and we are going to install an Apache HTTP Server on Linux
2.2. Learning objectives
-
describe the interactions and responsibilities when we are installing a YUM package, e.g. the httpd
-
Identify the necessary configurations to support Apache
-
Create Apache resources by modifying the httpd.conf file
-
Test the Apache resources by issuing curl commands and validating the response
2.3. Why and When: Install Apache
We are going to install the Apache Server since a new customer of our Acme firm needs some functionality which Apache delivers e.g. response to an HTTP request
2.4. Instructor Demo: Install Apache
-
Installing of YUM packages (yum install)
-
Installing Apache Http Server
-
Setting up Apache Http Server
-
Configure Http Server
-
Test Http Server
-
$ yum search
-
$ yum install
-
$ …
2.4.1. Demo summary
Apache is an Http Server which is able to respond to an HTTP request and serve static pages
-
Install
-
yum search
-
yum install
-
-
Configure
-
Start / Restart
-
$ sudo systemctl start <application>
-
$ sudo systemctl restart httpd
-
$ systemctl status / reload / restart / stop / start <application>
2.5. Intermediate takeaway
Q & A before entering the exercise ???
2.6. Exercise: Install Apache
(2 pmd: subtotaal 4)
-
Check the permissions on the files e.g. /etc/httpd/httpd.conf and /var/www/html (chmod and touch, mkdir commands are helpful)
-
Just to be sure check the available space on the server (df / du commands are needed)
-
To install packages you need root access
-
Learning your way in Linux using Apache Httpd config file httpd.conf
-
Learning your way in Linux using the DocumentRoot directory of Apache
-
Modify the httpd.conf file
-
Creating a personalized index.html file
-
Modify a file in the /var/www/html directory and validate the changes are shown after a reload of the webpage
2.6.1. Takeaway
-
Why did we need YUM
-
Why is YUM used for packaging Linux applications
-
How to add Apache to your Linux machine
-
Did you find some new commands during the case?
-
What did you do to find the working of the unknown command(s)?
-
2.7. Bonus Exercise 1
(1 pmd: subtotaal 5)
-
Create a script which installs, starts and tests (using curl) the Apache Http Server
-
Add a VirtualHost to your Apache Configuration
-
Optional: Add the epel repository on the server (look this up on the internet)
-
Optional: As sysadmins are lazy, try to create some aliases (use the command)
2.8. Bonus exercise 2
In case :-), your are done with the previous case, you can start the second case which will be introduced by the trainer.
2.9. Bonus exercise 3
-
Use the tail command to show the logging: $ tail -f /var/log/httpd/error.log and -access.log
3. Showtime
(1 pmd: subtotaal 6)
Show the team the result you have created!!!
4. Interesting reads
Apache Http Server |
|
YUM command cheat sheet |
|
TecMint Linux Tutorials |