Red Hat Enterprise Linux Diagnostics and Troubleshooting
Fix a software package issue that is causing a recently installed network service to fail.
Outcomes
You should be able to diagnose and repair package issues that cause a service to fail.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
[student@workstation ~]$ lab start rpm-review
This command installs and modifies packages.
Instructions
The recently installed web server on the servera server displays an error message when it is accessed.
[student@workstation ~]$ curl -4 servera.lab.example.com
curl: (7) Failed to connect to servera port 80: No route to hostResolve the issue and verify that the servera web server provides web content.
Connect to
serveraand assess the problem.Log in to
serveraand switch to therootuser.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#View the status of the
httpdservice.The service is down, and error messages suggest that it could not be started.
[root@servera ~]#
systemctl status httpd● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2021-11-05 17:21:09 EDT; 6min ago Docs: man:httpd.service(8) Process: 29854 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=203/EXEC) Main PID: 29854 (code=exited, status=203/EXEC) Nov 05 17:21:09 servera.lab.example.com systemd[1]: Starting The Apache HTTP Server... Nov 05 17:21:09 servera.lab.example.com systemd[1]: httpd.service: Main process exited, code=exited, status=203/EXEC Nov 05 17:21:09 servera.lab.example.com systemd[1]: httpd.service: Failed with result 'exit-code'. Nov 05 17:21:09 servera.lab.example.com systemd[1]: Failed to start The Apache HTTP Server.Because the service was recently installed, use the
yum historycommand to identify recently installed packages. Your output might be different in your classroom environment, so assume that the following packages were recently installed on your system.[root@servera ~]#
yum historyID | Command line | Date and time | Action(s) | Altered --------------------------------------------------------------------------------8| -y install httpd | 2021-11-05 17:21 | Install | 97| -y upgrade | 2021-06-14 03:38 | I, O, U | 33 ...output omitted... [root@servera ~]#yum history info 8Transaction ID :8Begin time : Fri 05 Nov 2021 05:21:03 PM EDT Begin rpmdb :638:44ed0f50693e8e6bcb82e911467e7370b017ae90End time : Fri 05 Nov 2021 05:21:05 PM EDT (2 seconds) End rpmdb :647:95b0a71b559ee29fad596689ead593d6de49c93bUser : root <root> Return-Code : Success Releasever : 8 Command Line : -y install httpd Comment : Packages Altered: Install redhat-logos-httpd-84.4-1.el8.noarch @rhel-8.4-for-x86_64-baseos-rpms Install apr-1.6.3-11.el8.x86_64 @rhel-8.4-for-x86_64-appstream-rpms Install apr-util-1.6.1-6.el8.x86_64 @rhel-8.4-for-x86_64-appstream-rpms Install apr-util-bdb-1.6.1-6.el8.x86_64 @rhel-8.4-for-x86_64-appstream-rpms Install apr-util-openssl-1.6.1-6.el8.x86_64 @rhel-8.4-for-x86_64-appstream-rpms Install httpd-2.4.37-39.module+el8.4.0+9658+b87b2deb.x86_64 @rhel-8.4-for-x86_64-appstream-rpms Install httpd-filesystem-2.4.37-39.module+el8.4.0+9658+b87b2deb.noarch @rhel-8.4-for-x86_64-appstream-rpms Install httpd-tools-2.4.37-39.module+el8.4.0+9658+b87b2deb.x86_64 @rhel-8.4-for-x86_64-appstream-rpms Install mod_http2-1.15.7-3.module+el8.4.0+8625+d397f3da.x86_64 @rhel-8.4-for-x86_64-appstream-rpmsVerify whether the recently installed packages are complete and unchanged.
The
rpm -Vcommand indicates that the contents and timestamp of/usr/sbin/httpdchanged since it was installed.[root@servera ~]#
rpm -V apr apr-util apr-util-bdb apr-util-openssl httpd httpd-filesystem httpd-tools mod_http2..5....T. /usr/sbin/httpdLocate the package that provides the changed file.
[root@servera ~]#
rpm -qf /usr/sbin/httpdhttpd-2.4.37-39.module+el8.4.0+9658+b87b2deb.x86_64
Permanently fix the issue.
Reinstall the located package.
[root@servera ~]#
yum reinstall httpdRestart the
httpdservice.[root@servera ~]#
systemctl restart httpdVerify that the service successfully started.
[root@servera ~]#
systemctl status httpd● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2021-11-05 17:39:23 EDT; 2s ago Docs: man:httpd.service(8) Main PID: 30140 (httpd) Status: "Started, listening on: port 80" Tasks: 213 (limit: 11049) Memory: 28.7M CGroup: /system.slice/httpd.service ├─30140 /usr/sbin/httpd -DFOREGROUND ├─30141 /usr/sbin/httpd -DFOREGROUND ├─30142 /usr/sbin/httpd -DFOREGROUND ├─30143 /usr/sbin/httpd -DFOREGROUND └─30144 /usr/sbin/httpd -DFOREGROUND Nov 05 17:39:22 servera.lab.example.com systemd[1]: Starting The Apache HTTP Server... Nov 05 17:39:23 servera.lab.example.com systemd[1]: Started The Apache HTTP Server. Nov 05 17:39:23 servera.lab.example.com httpd[30140]: Server configured, listening on: port 80Verify that access is allowed to the service port.
[root@servera ~]#
firewall-cmd --list-servicescockpit dhcpv6-client ssh [root@servera ~]#firewall-cmd --add-service=http --permanentsuccess [root@servera ~]#firewall-cmd --reloadsuccess [root@servera ~]#firewall-cmd --list-servicescockpit dhcpv6-client http sshReturn to
workstationas thestudentuser.[root@servera ~]#
exit[student@servera ~]$exit[student@workstation ~]$Verify that the
serveraweb server is providing web content.[student@workstation ~]$
curl -4 servera.lab.example.comLab is fixed.