Run Apache as a specific user with mpm itk on Ubuntu Linux

Install mpm itk

On ubuntu mpm itk can be installed from synaptic. Look for the package called apache2-mpm-itk

sudo apt-get install apache2-mpm-itk


Configuration for mpm itk can be done in the file sites-enabled/000-default

$ gksudo gedit /etc/apache2/sites-enabled/000-default

In the VirtualHost *:80 section add this just before the end of the VirtualHost tag

<IfModule mpm_itk_module>
AssignUserId your_username your_username


Restart apache. Now apache should be running as that username specified in "your_username".
Now this means that even PHP scripts will also run with the same username (unless something like suexec/suphp is changing their user).

Last Updated On : 8th December 2011

Subscribe to get updates delivered to your inbox

Leave a comment