Linux Up Skill - Day 7
Back at it on this Monday working to catch back up on this course. Here is day seven of the Linux Up Skill Challenge. Today we are looking at the server and its services. It looks like this lesson is focused on a better understanding of application installation, configuration files, services, and logs. Tasks to work through today are:
- Refresh your list of available packages.
- Install Apache from the repository.
- Confirm it is running by browsing to confirmation page.
- Stopping the Apache service. Then restarting it.
- Explore the Apache configuration files.
- Note in apache2.conf the merging of smaller specific config files.
- Setup some virtual hosts or add in some mods.
- Note the location of the default webpage.
- View the code of the default webpage.
- View the Apache log files.
- Rerun apt update and apt upgrade.
Groovy. Running the sudo apt update
and sudo apt upgrade
commands to bring everything up to date. Then we’ll install Apache. Been here plenty of times. sudo apt install apache2
completes without error. Going to the page in Chrome I do end up at the default Apache page.
With the Apache service working correctly now it is time to stop and start it. sudo systemctl stop apache2
. I can confirm the webpage can no longer be reached. systemctl status apache2
shows inactive (dead)
. So if I restart it with sudo systemctl start apache2
it comes alive. The webpage is viewable and systemctl status apache2
shows active (running)
.
Moving on to the config file. vim /etc/apache2/apache2.conf
. I find the mentioned IncludeOptional conf-enabled/*.conf
entry. Let’s look at the default site config with vim /etc/apache2/sites-enabled/000-default.conf
. Now we take a look at the default webpage with vim /var/www/html/index.html
. Man has it been a long time since I looked at HTML. The lesson has me modifying the default webpage so I make a quick change and reload my browser.
The last task has me looking at the log files. cd /var/log/apache2
shows me three files, access.log
, error.log
and other_vhosts_access.log
. Access does show my browser accessing the website a handful of times as I refreshed and made changes. The error log shows the Apache2 service starting and stopping. And the other_vhosts_access.log
file is current empty, not a surprise. It is exciting that we are going to cover looking over logs in greater detail in a later lesson. That does it for this lesson.