Apache as root user

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Apache as root user

Postby Alee » 27. March 2012 12:54

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..
Posts: 2
Joined: 27. March 2012 12:37
Operating System: Ubuntu Server 11.10

Re: Apache as root user

Postby JonB » 27. April 2012 21:00


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.

http://httpd.apache.org/docs/current/mi ... _tips.html

Good Luck
User avatar
AF Moderator
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 18 guests