There are several reasons why you might want to run different Apache Virtual Hosts as separate users from the Apache user account. My most frequent usage is on my development machine to allow running from my home directory.

The most commonly recommended option for this purpose is MPM-ITK (a quick hack would be to add yourself to the www-data group using “sudo usermod -a -G www-data USERNAME”)

sudo apt-get install apache2-mpm-itk
sudo a2enmod mpm_itk

Modify the virtual host config file in /etc/apache2/sites-available

<Virtualhost *:80>
<ifmodule mpm_itk_module>
DocumentRoot /home/USERNAME/www/docs
ErrorLog /home/USERNAME/www/logs/error.log
CustomLog /home/USERNAME/www/logs/access.log combined


If you doing this on a machine that already had a default install where MPM-PREFORK is enabled you have to disable

sudo a2dismod mpm_prefork
sudo a2enmod mpm_itk

Leo Gaggl

ict business owner specialising in mobile learning systems. interests: sustainability, internet of things, ict for development, open innovation, agriculture

This Post Has 3 Comments

  1. Launch

    u cannott dismal mpm_prefork since mpm_itk needs mpm_prefork, says apache.
    ERROR: The following modules depend on mpm_prefork and need to be disabled first: mpm_itk

  2. Hritik Vijay

    In xenial you need to install libapache2-mpm-itk
    sudo apt install libapache2-mpm-itk

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.