How to Check the HTTPD service in Linux and Killing the Process - Tecnew

Home Ads

How to Check the HTTPD service in Linux and Killing the Process

How to Check the HTTPD service in Linux and Killing the Process

Share This

Check status of a service

1.     systemctl status servicename(httpd) It shows the status of the service it started or stoped

2.     when you start a service you must enable the service by systemctl enable httpd

3.     systemctl start httpd

4.     when you stop a service you must enable the service by systemctl disable httpd

5.     systemctl stop httpd

6.     systemctl is-enabled apache2 it shows the enable or disable status

7.     after that you restart the VM it will starts running

8.     systemctl command is read the file is located in this location cd  /etc/systemd/  in that directory find the file by typing command find . -name httpd* one file is there     ./system/multi user.target.wants/httpd.service  This file knows the how to start and stop the httpd service. It calls some binary files it creates the processes that running in background

9.      ps aux command is shows all the process running in your system sort with there usage all the process owned by the root user

10.  PID 1 is systemd this is the first process in linux (redhat system)  in ubuntu is init is the first process

11.  Systemd  manages the other process if it goes downb entire system goes down it manages the other process

12.  [kworker /u4] square boxe process are called kernel threads

13.  Other columns are %cpu cpu utlise %mem memory utlise

14.  State  S is for sleaping R is for running

15.  Sshd service is serve the ssh request

16.  top command is like taskmanager used to show the dynamic process sort by the utilization also shows the how long system is running

17.  load avg is slowly increase slowly decrease is shows the status at 3 different values Current load avg, last 5 mins, last 15 mins

18.  ps -ef It shows pid and ppid process and parent process id

19.  ps -ef | grep httpd it shows the httpd process if you want to stop the process pid 1 is started process of other processes to stop the process by kill process id (kill 3284) command

20.  kill -9 3384 is forcefully killing the process parent is died and child process is not killed is called arphon process is called dead process. by remove this child process all at once ps -ef | grep httpd | grep -v ‘auto’ and ps -ef | grep httpd | grep -v ‘grep’ it automatically kills the all the arphon process 

21.  ps -ef | grep httpd | grep -v ‘auto’ | awk ‘{print $2}’ it shows the (awk command) second field ps -ef | grep httpd | grep -v ‘auto’ | awk ‘{print $2}’ | xargs kill -9 It kill the all the processes one by one automatically

22.  Arphon processes are the process if parent is dead and chaild processes are still running

23.  Zombi process is that is a dead its not serving any purpose but it is still there in process table is coming from the kernel have a process table to clear this process you will reboot the system other commands also there

24.  Arkaying is nothing but compressing the data tar czvf filename.tar.gz  * (c- create, z-compress, v-verfol print o/p, f-file) * current working directory

25.  for unzip the tar arkying file tar xzvf filename.tar.gz it ectracts in current location. For untar to some other location give location path tar xzvf filename.tar.gz -C /var/www/html it un arkaye in to html location. Ex: tar xzvf wave-cafe-website.tar.gz -C /var/www/html   To know more options tar --help

26.  Zip  is also a command to compress the files or extract the files arkyee  compared to zip tar is the best one for zip the files typing command zip -r filename.zip *(or file name) to un zip

No comments:

Post a Comment