Page 1 of 1

Apache as root user

PostPosted: 27. March 2012 12:54
by Alee
Hi.. ! I need to log in in apache as root user to access some system files. I am logged in in my system as root. But when I start xampp server from terminal by using sudo /opt/lampp/lampp start and use this php script < ?php echo whoami; ?> it shows me: nobody. I need to logged in as root..

Re: Apache as root user

PostPosted: 27. April 2012 21:00
by JonB

As it happens that isn't a XAMPP issue, its an Apache design choice. I am unsure if it can be circumvented without doing more research.

ONLY 'root' can start Apache. Because under Unix/Linux a process has the rights of its owner, Apache deliberately de-escalates the ownership to prevent the webserver from becoming an attack vector. Presumably, to prevent users from doing exactly what you describe -- using system files.

Here's the relevant documentation, I'm unsure if you can delegate 'root' to be the de-escalated user. ... _tips.html

Good Luck