Apache normally runs as an unprivileged user without shell access in most platforms. This is for security reason as a poorly written script or configuration if exploited will not escalate and cause much harm to the system.
If you're running a development environment and know exactly what you're doing, you can change the user and group that the
Apache process runs as with these simple steps;
Apache's configuration file.
Apacheprocess to run as. The following example is to run it as
User root Group root
This could be a big security risk, especially to run it as
Make sure the user and group has appropriate permission to
DocumentRoot and related files and folders.
$ ps aux | grep apache2 root 1188 0.0 0.1 162184 6664 ? Ss Mar29 0:02 /usr/sbin/apache2 -k start root 1197 0.0 0.1 162184 5668 ? S Mar29 0:00 /usr/sbin/apache2 -k start root 1198 0.0 0.1 162184 5916 ? S Mar29 0:00 /usr/sbin/apache2 -k start root 1200 0.0 0.1 162184 5684 ? S Mar29 0:00 /usr/sbin/apache2 -k start root 1201 0.0 0.1 162184 5684 ? S Mar29 0:00 /usr/sbin/apache2 -k start root 1202 0.0 0.1 162184 5684 ? S Mar29 0:00 /usr/sbin/apache2 -k start
In some distributions the
Apache binary could be named
httpd instead of
|Ubuntu 16.04 LTS (Xenial Xerus)|
|Ubuntu 16.10 (Yakkety Yak)|
|Ubuntu 17.04 (Zesty Zapus)|
|Ubuntu 17.10 (Artful Aardvark)|
|Ubuntu 18.04 LTS (Bionic Beaver)|
|Ubuntu 18.10 (Cosmic Cuttlefish)|
|Ubuntu 19.04 (Disco Dingo)|