I have been looking up different documentation for how to start/stop Apache and from which directory, and have not found the right answer.
I am using Ubuntu.
I have been looking up different documentation for how to start/stop Apache and from which directory, and have not found the right answer.
I am using Ubuntu.
In typical operation (running as a service, not troubleshooting or debugging, etc), the "proper" way to do it is with the
service
command:The directory that this is run from is inconsequential. And for your information, the scripts that the service command uses are in
/etc/init.d
; Apache's resides at/etc/init.d/apache2
. So/etc/init.d/apache2 start
etc. will also get what you want; but Ubuntu 10.10 and newer will whine at you to use theservice
command instead.You could also use:
This should also allow you to run the Apache 2
init.d
script.