From the Apache documentation can be read:
If the Listen specified in the configuration file is default of 80 (or any other port below 1024), then it is necessary to have root privileges in order to start apache, so that it can bind to this privileged port.
After reading this, I immediately made the assumption that if I was running apache on port 8080, I wouldn't need to use sudo
to restart the service. But as it turns out, I still need to use sudo
, no matter what port I use.
Did I misunderstood the documentation? Or did something get misconfigured in my installation?
Apache is generally configured to start as root and then to setuid to the apache user by default.
If root started the apache server, then you will need to be root to restart it regardless of the port you are using.
If you start it as user X, you need to be user X to restart it. It's also likely to require some special configuration as the setuid call will fail if it is not started as root.