Page 93 - RHEL8 BOOK
P. 93
Manage Services
Service Management Action Purpose
start Start a service
stop Stop a service
restart Restart a service
enable Enable service to start at boot time
disable Disable service to start at boot time, can be started manually once
the system is online
status Check the current status of service
mask Prevent a service from starting dynamically or even manually until
the specific service is unmasked.
Mask will link service to /dev/null, making it impossible to start
them. It’s a stronger version of disable, since it prohibits all kinds of
activation.
unmask Revoke masked service (undo already masked service)
is-enabled Check whether a service is already enabled state or not
is-active Check whether a service is active (running)
is-failed Check whether a service has failed (not running)
1. Check the Installed http Packages.
[root@sun ~]# yum list installed | grep httpd
2. Install the http packages
[root@sun ~]# yum install httpd * -y
3. Start the http service
[root@sun ~]# systemctl start httpd.service
4. Enable the http service
[root@sun ~]# systemctl enable httpd.service
5. Check the status of http service
[root@sun ~]# systemctl status httpd.service
6. Check the process id and owner of http service
[root@sun ~]# ps –up 4714
7. Check the port no of http service
[root@sun ~]# netstat –tulpn | grep httpd
8. Connect localhost to http
[root@sun ~]# nc –v localhost 80
9. Restart http service
[root@sun ~]# systemctl restart httpd.service
S. Pradhan
(MCA, MBA-IT, BCA, CCNA, MCSA 2012, RHCE, ETHICAL HACKING)
Email Id:-spradhan.iiht@gmail.com
93