Cross-platform restart of Apache

Posted by l0b0 on Server Fault See other posts from Server Fault or by l0b0
Published on 2010-06-02T09:57:25Z Indexed on 2010/06/02 10:04 UTC
Read the original article Hit count: 296

Filed under:
|
|

I'd like to have a single command that'll restart Apache on any *nix OS. Currently I'm working with Ubuntu, which has

  • /usr/sbin/apache2ctl
  • /usr/sbin/service
  • no apachectl
  • no httpd

and Scientific Linux CERN 5, which has

  • /usr/sbin/apachectl
  • /etc/init.d/httpd
  • no apache2ctl
  • no service

I'd like to avoid using a hack like which service 2>/dev/null || which /etc/init.d/httpd

© Server Fault or respective owner

Related posts about apache

Related posts about apache2