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

By | December 8, 2011

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

Configure

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

[xml]
<IfModule mpm_itk_module>
AssignUserId your_username your_username
</IfModule>

</VirtualHost>
[/xml]

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).

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

One Comment

Run Apache as a specific user with mpm itk on Ubuntu Linux
  1. Denver Prophit Jr

    I get errors trying to apt-get install

    thirtybees@thirtybees:~$ sudo apt-get install apache2-mpm-itk
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package apache2-mpm-itk is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘apache2-mpm-itk’ has no installation candidate

Leave a Reply

Your email address will not be published. Required fields are marked *