Home » Unix command and scripts » how to start and stop httpd service

how to start and stop httpd service

Apache is the HTTP server which is freely available over internet. it is widely used on Linux distribution to host websites.  Apache configuration is managed by the configuration file httpd.conf. You can use locate command to find the configuration  file

$ locate httpd.conf
/etc/httpd/conf/httpd.conf

After making the change , you need to restart the Apache services to make it effective

Command for  Linux version 4.x/5.x/6.x or older commands :

Start  Command

service httpd start

Stop Command

service httpd stop

Restart command

service httpd restart

status command

service httpd status

How to automatically start the httpd service after the reboot

chkconfig httpd on

 

Command for Linux version Linux version 7.x or newer commands :

Start command

systemctl start httpd.service
Stop command
systemctl stop httpd.service

Restart command

systemctl restart httpd.service

How to enable httpd service to start after reboot

systemctl enable httpd
See also  how to find file based on size in linux

1 thought on “how to start and stop httpd service”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top