In this hands-on lab, we will be managing two CentOS 7 web server instances using Cockpit.
Specifically, we will:
– Install and Configure Cockpit on CentOS 7
– Manage Storage Using Cockpit
– Manage Networking Using Cockpit
– Manage systemd Services Using Cockpit
– Patch the CentOS 7 Servers Using Cockpit
When the lab is complete, you will have a solid understanding of how to manage a Linux server using Cockpit.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Install and Configure Cockpit on CentOS 7
Install and Configure Cockpit on CentOS 7 (Duration: 20 minutes):
- Install and configure Cockpit on both instances of CentOS 7
- Configure the Cockpit installation on the first instance to manage the second instance
For more information on installing and configuring Cockpit, see: Running Cockpit — Cockpit Project
- Manage Storage Using Cockpit
We will take a look at storage management (Duration: 10 minutes):
- Create a new RAID-1 volume (
web_data
) for website data:- Partition, format, and configure a mount point at
/web_data
- Use two disks
- Partition, format, and configure a mount point at
- Create a new volume group (
web_vg
):- Add the remaining disk to it
- Create and format a new logical volume for the logs (
web_logs
):- Create the
web_logs
logical volume in theweb_vg
volume group - Format the logical volume
- Mount the new logical volume on the
/web_logs
directory
- Create the
Configure the storage on both instances as described above.
- Create a new RAID-1 volume (
- Manage Networking Using Cockpit
We will take a look at network management (Duration: 10 minutes):
- Modify our firewall configuration to enable HTTP traffic
- Monitor network traffic
- Review network interfaces
- Review networking logs
Configure the firewall on both instances as described above.
- Manage systemd Services Using Cockpit
We’re going to look at using Cockpit to manage systemd services (Duration: 10 minutes):
- Enable the
nginx
web server service - Start the
nginx
web server service - Confirm that the
nginx
service is enabled and running - Connect to the
nginx
web server via your web browser (on port 80) to confirm thenginx
service is working
Configure the
nginx
service on both instances as described above. Confirm thatnginx
is working on both instances.- Enable the
- Patch the CentOS 7 Servers Using Cockpit
Finally, we will use Cockpit to make sure the CentOS 7 installation on both instances is up-to-date, and if not, update them. We’ve allocated 10 minutes for this activity. Feel free to explore Cockpit once this is complete!