richard
richard

Reputation: 1

locate apache2ctl

I can say apache2ctl graceful and my webserver restarts at an interactive shell. All is well. However, I need to say that in a shell script so I need the full path for apache2ctl. I have tried which and locate but nothing turns up which makes me very surprised. I looked in /usr/bin and there is no apache2ctl. How do I figure out where this lives?

I thought maybe it would be in /opt/local/apache2/bin but there is an apachectl in there...not a apache2ctl. I'm stumped. Any ideas?

@Jon Lin - Nice work...type apache2ctl told me apache2ctl is aliased tosudo /opt/local/apache2/bin/apachectl'` . Thank you very much.

Upvotes: 0

Views: 3596

Answers (3)

PeterJCLaw
PeterJCLaw

Reputation: 1892

Did you try which? (Not sure if that'd be present on a Mac, though it's pretty standard on most *nix systems; behaves rather like where on windows).

Upvotes: 0

Andreas Wong
Andreas Wong

Reputation: 60584

You probably need to run updatedb before locate just in case

$ updatedb
# takes a while

$ locate apache2ctl

Or you can run find / -name 'apache2ctl' 2> /dev/null to search for your entire partition

Upvotes: 0

Gabriel Ross
Gabriel Ross

Reputation: 5198

It should be in /usr/sbin or /usr/local/sbin

Upvotes: 2

Related Questions