# How to setup Apache2 mpm-itk under Virtualmin?

**URL:** <https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962>\
**Category:** Virtualmin\
**Created:** [November 7, 2008, 8:10am UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962 "2008-11-07T08:10:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl1](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/k/bbce88/32.png) [@Karl1](https://forum.virtualmin.com/u/Karl1)\
**Post date:** [November 7, 2008, 8:10am UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/1 "2008-11-07T08:10:31Z")

</div>

How can I run/setup Apache2 mpm-itk instead of suEXEC or suPHP on Debian under Virtualmin?

[http://mitka.us/articles/mpm-itk/](http://mitka.us/articles/mpm-itk/)  
[http://www.debianadmin.com/running-vhosts-with-apache2-mpm-itk-on-debian.html](http://www.debianadmin.com/running-vhosts-with-apache2-mpm-itk-on-debian.html)

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [November 7, 2008, 1:15pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/2 "2008-11-07T13:15:56Z")

</div>

Oh, yeah, if you’re using Virtualmin Professional, the Install Scripts won’t be aware of this new-fangled method of running as a user, and so there _may_ be some permissions issues if setup this way. We’d probably need to add a bit of knowledge to Virtualmin and the Install Scripts code to understand that, even without suexec, the scripts need to be owned by and configured for use by the owner of the virtual server.

Since I’ve never heard of this module before today, I’m gonna assume it is not all that well-known or popular…so it’s probably not a priority to get those changes in place (and I’m not sure it’ll be a problem, anyway). I don’t find the arguments against suexec compelling in this context…having content read as the user is, perhaps, cool, but having all of Apache run as root makes me less enthusiastic about it. It’s also far less tested than suexec…suexec has been heavily vetted for quality and security. I’d be leery of trusting security to something dramatically less vetted.

Just some thoughts.

Let us know how the module works for you.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [November 8, 2008, 2:51pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/3 "2008-11-08T14:51:42Z")

</div>

How do I make sure mod\_php is the execution type for PHP scripts, and suexec is disabled?

In Virtualmin GPL, mod\_php is pretty much all there is, unless you follow some HOWTOs I’ve posted here in the forums. So, you’re already using mod\_php.

Suexec can be enabled in GPL, but it will only apply to non-PHP applications, so may not be relevant to you. You can find that option in the "Server Templates:Apache website" section. Note that it only applies to new virtual servers, if you edit Server Templates. Existing ones can be modified in the Server Configuration:Website Options. "Run as domain owner?" is the suexec option.

---

<div class="post-metadata">

**Author:** ![Karl1](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/k/bbce88/32.png) [@Karl1](https://forum.virtualmin.com/u/Karl1)\
**Post date:** [November 8, 2008, 8:48pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/4 "2008-11-08T20:48:29Z")

</div>

**Joe wrote:**

Let us know how the module works for you.

I’m sorry but I can’t install the apache2 mpm-itk under Virtualmin. The installation doesn’t work because of your special package 2.2.3-50vm. I always get the error:  
“Die folgenden Pakete haben nichterfuellte Abhaengigkeiten:  
apache2-mpm-itk: Haengt ab: apache2.2-common (= 2.2.3-4+etch6) aber 2.2.3-50vm soll installiert werden  
E: Kaputte Pakete”. (Sorry about the language)

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [November 8, 2008, 8:50pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/5 "2008-11-08T20:50:16Z")

</div>

Since you’re not using suexec, you don’t need our package. Setup apt-get to not pull apache2 from our repository, and downgrade to the one from Debian.

---

<div class="post-metadata">

**Author:** ![Karl1](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/k/bbce88/32.png) [@Karl1](https://forum.virtualmin.com/u/Karl1)\
**Post date:** [November 8, 2008, 9:37pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/6 "2008-11-08T21:37:07Z")

</div>

Thanks.

How do I downgrade? I already removed "deb [http://software.virtualmin.com/gpl/debian/](http://software.virtualmin.com/gpl/debian/) virtualmin-etch main" from sources.list.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [November 8, 2008, 9:40pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/7 "2008-11-08T21:40:38Z")

</div>

I already removed "deb http://software.virtualmin.com/gpl/debian/ virtualmin-etch main" from sources.list.

That’s not what I had in mind…I meant to exclude the apache2 packages from that repo. You probably want to be able to get all of your other Virtualmin-related updates.

As for downgrading. I dunno. I’m not an expert on apt-get or dpkg. 😉

On a CentOS system, the easiest option would be to download the packages manually, and install them using the --old-package option. I don’t know what the equivalent in dpkg or apt-get is. But there are some Debian experts around these parts…hopefully they’ll chime in.

---

<div class="post-metadata">

**Author:** ![Eric](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@Eric](https://forum.virtualmin.com/u/Eric)\
**Post date:** [November 10, 2008, 2:36pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/8 "2008-11-10T14:36:51Z")

</div>

Regarding Debian packages, you can specify that a specific version be installed using this apt-get syntax:

apt-get install package=version

so in your case:

apt-get install apache-common=2.2.3-4+etch6

You may have to do something similar for the other Apache related packages.

Also, you’ll want to make sure it continues to pull Apache from Debian’s repository, and not Virtualmin’s. If you find that it does try to pull from Virtualmin’s repository after you install the Debian Apache, you may need to “pin” the software to use a specific repository.

You can see some information on how to do that here under the section "3.10 How to keep specific versions of packages installed":

[http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html](http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html)

---

<div class="post-metadata">

**Author:** ![Karl1](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/k/bbce88/32.png) [@Karl1](https://forum.virtualmin.com/u/Karl1)\
**Post date:** [January 13, 2009, 12:11pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/9 "2009-01-13T12:11:01Z")

</div>

@ robpomeroy:

Thanks for your hint. I already gave up installing mpm-itk.

What do you think about this?

**Joe wrote:**

So, I'm going to tell you something astonishing: Sometimes things you find on the Internet are wrong. ;-)

Suexec + mod\_fcgid is roughly equivalent to mod\_php in performance. Memory usage is somewhat higher, but not dramatically so. Many people simply don’t realize that suexec and FastCGI work together just fine, and that fact removes almost every argument against using suexec.

And, whether mdm-itk is good or not is not related to whether it is new-fangled. It’s much newer than suexec, and has far fewer users and time in the field (and thus far less reliable security history to judge it by). So, it’s still new-fangled, even if it’s awesome.

---

<div class="post-metadata">

**Author:** ![robpomeroy](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/r/f4b2a3/32.png) [@robpomeroy](https://forum.virtualmin.com/u/robpomeroy)\
**Post date:** [January 13, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/10 "2009-01-13T12:31:47Z")

</div>

All I can say Karl is that **everywhere** I read, the performance metrics for PHP through some kind of CGI were worse by _at least_ a factor of ten. I don’t, alas have time to verify this for myself, but this combined with some security analysis I undertook for my company convinced me that mpm-itk or mpm-peruser were better solutions to the virtual hosting security issues I was facing. I chose mpm-itk because it appears to be the more mature solution at the moment.

My first build has gone very well indeed, so if you ever want to give it another shot, here are some pointers:

Start with CentOS 5+  
Follow [http://hostby.net/home/2008/07/12/centos-5-and-mpm-itk](http://hostby.net/home/2008/07/12/centos-5-and-mpm-itk) for the mpm-itk install  
Use the notes in this thread to configure VirtualMin to be mpm-itk-aware  
Optionally install and configure VSFTPd and the Virtualmin VSFTPd module (my preference for more secure FTP service)  
If so, configure VSFTPd to bind only to local IP address (needed by Virtualmin)

Incidentally, mpm-itk is not new-fangled at all - it was part of the Apache development tree for a long time but was never production ready. Steinar Gunderson picked it up and forked at and the rest is history - yes, history. 😉

I’d be interested to know if there are any _known_ vulnerabilities, running an up to date security-patched Apache daemon as root, of course…

Cheers,

Rob

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [June 7, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/11 "2009-06-07T12:31:31Z")

</div>

Sounds to me like you’d just want to disable Suexec in Virtualmin, and add “AssignUserID” to the Apache website Server Template section. You can get to the UID for the user with the ${UID} variable.

So, it’d look something like this:

[code:1]  
ServerName ${DOM}  
ServerAlias www.${DOM}  
AssignUserID ${UID}  
DocumentRoot ${HOME}/public\_html  
ErrorLog ${HOME}/logs/error\_log  
CustomLog ${HOME}/logs/access\_log combined  
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/  
\<Directory ${HOME}/public\_html\>  
Options Indexes IncludesNOEXEC FollowSymLinks  
allow from all  
AllowOverride All  
\</Directory\>  
\<Directory ${HOME}/cgi-bin\>  
allow from all  
\</Directory\>  
[/code:1]

And you’d want to make sure mod\_php is the execution type for PHP scripts, and suexec is disabled.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [June 7, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/12 "2009-06-07T12:31:31Z")

</div>

Sounds to me like you’d just want to disable Suexec in Virtualmin, and add “AssignUserID” to the Apache website Server Template section. You can get to the UID for the user with the ${UID} variable.

So, it’d look something like this:

[code:1]  
ServerName ${DOM}  
ServerAlias www.${DOM}  
AssignUserID ${UID}  
DocumentRoot ${HOME}/public\_html  
ErrorLog ${HOME}/logs/error\_log  
CustomLog ${HOME}/logs/access\_log combined  
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/  
\<Directory ${HOME}/public\_html\>  
Options Indexes IncludesNOEXEC FollowSymLinks  
allow from all  
AllowOverride All  
\</Directory\>  
\<Directory ${HOME}/cgi-bin\>  
allow from all  
\</Directory\>  
[/code:1]

And you’d want to make sure mod\_php is the execution type for PHP scripts, and suexec is disabled.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [June 7, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/13 "2009-06-07T12:31:37Z")

</div>

Sounds to me like you’d just want to disable Suexec in Virtualmin, and add “AssignUserID” to the Apache website Server Template section. You can get to the UID for the user with the ${UID} variable.

So, it’d look something like this:

[code:1]  
ServerName ${DOM}  
ServerAlias www.${DOM}  
AssignUserID ${UID}  
DocumentRoot ${HOME}/public\_html  
ErrorLog ${HOME}/logs/error\_log  
CustomLog ${HOME}/logs/access\_log combined  
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/  
\<Directory ${HOME}/public\_html\>  
Options Indexes IncludesNOEXEC FollowSymLinks  
allow from all  
AllowOverride All  
\</Directory\>  
\<Directory ${HOME}/cgi-bin\>  
allow from all  
\</Directory\>  
[/code:1]

And you’d want to make sure mod\_php is the execution type for PHP scripts, and suexec is disabled.

---

<div class="post-metadata">

**Author:** ![Karl1](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/k/bbce88/32.png) [@Karl1](https://forum.virtualmin.com/u/Karl1)\
**Post date:** [June 7, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/14 "2009-06-07T12:31:37Z")

</div>

Hi Joe,

thanks for your comments. I’m not shure if mpm-itk is a “newfangled” method. I’m not an Apache nor PHP specialist so I found something interesting about suEXEC versus mpm-itk by Google:

[http://blog.stuartherbert.com/php/series-the-web-platform/](http://blog.stuartherbert.com/php/series-the-web-platform/)

"Apacheâ

---

<div class="post-metadata">

**Author:** ![Karl1](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/k/bbce88/32.png) [@Karl1](https://forum.virtualmin.com/u/Karl1)\
**Post date:** [June 7, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/15 "2009-06-07T12:31:38Z")

</div>

Hi Joe,

thanks for your comments. I’m not shure if mpm-itk is a “newfangled” method. I’m not an Apache nor PHP specialist so I found something interesting about suEXEC versus mpm-itk by Google:

[http://blog.stuartherbert.com/php/series-the-web-platform/](http://blog.stuartherbert.com/php/series-the-web-platform/)

"Apacheâ

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [June 7, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/16 "2009-06-07T12:31:38Z")

</div>

"Apacheâ

---

<div class="post-metadata">

**Author:** ![Karl1](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/k/bbce88/32.png) [@Karl1](https://forum.virtualmin.com/u/Karl1)\
**Post date:** [June 7, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/17 "2009-06-07T12:31:38Z")

</div>

Hi Joe,

thanks for your comments. I’m not shure if mpm-itk is a “newfangled” method. I’m not an Apache nor PHP specialist so I found something interesting about suEXEC versus mpm-itk by Google:

[http://blog.stuartherbert.com/php/series-the-web-platform/](http://blog.stuartherbert.com/php/series-the-web-platform/)

"Apacheâ

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [June 7, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/18 "2009-06-07T12:31:38Z")

</div>

Sounds to me like you’d just want to disable Suexec in Virtualmin, and add “AssignUserID” to the Apache website Server Template section. You can get to the UID for the user with the ${UID} variable.

So, it’d look something like this:

[code:1]  
ServerName ${DOM}  
ServerAlias www.${DOM}  
AssignUserID ${UID}  
DocumentRoot ${HOME}/public\_html  
ErrorLog ${HOME}/logs/error\_log  
CustomLog ${HOME}/logs/access\_log combined  
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/  
\<Directory ${HOME}/public\_html\>  
Options Indexes IncludesNOEXEC FollowSymLinks  
allow from all  
AllowOverride All  
\</Directory\>  
\<Directory ${HOME}/cgi-bin\>  
allow from all  
\</Directory\>  
[/code:1]

And you’d want to make sure mod\_php is the execution type for PHP scripts, and suexec is disabled.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [June 7, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/19 "2009-06-07T12:31:38Z")

</div>

Sounds to me like you’d just want to disable Suexec in Virtualmin, and add “AssignUserID” to the Apache website Server Template section. You can get to the UID for the user with the ${UID} variable.

So, it’d look something like this:

[code:1]  
ServerName ${DOM}  
ServerAlias www.${DOM}  
AssignUserID ${UID}  
DocumentRoot ${HOME}/public\_html  
ErrorLog ${HOME}/logs/error\_log  
CustomLog ${HOME}/logs/access\_log combined  
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/  
\<Directory ${HOME}/public\_html\>  
Options Indexes IncludesNOEXEC FollowSymLinks  
allow from all  
AllowOverride All  
\</Directory\>  
\<Directory ${HOME}/cgi-bin\>  
allow from all  
\</Directory\>  
[/code:1]

And you’d want to make sure mod\_php is the execution type for PHP scripts, and suexec is disabled.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [June 7, 2009, 12:31pm UTC](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962/20 "2009-06-07T12:31:39Z")

</div>

Sounds to me like you’d just want to disable Suexec in Virtualmin, and add “AssignUserID” to the Apache website Server Template section. You can get to the UID for the user with the ${UID} variable.

So, it’d look something like this:

[code:1]  
ServerName ${DOM}  
ServerAlias www.${DOM}  
AssignUserID ${UID}  
DocumentRoot ${HOME}/public\_html  
ErrorLog ${HOME}/logs/error\_log  
CustomLog ${HOME}/logs/access\_log combined  
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/  
\<Directory ${HOME}/public\_html\>  
Options Indexes IncludesNOEXEC FollowSymLinks  
allow from all  
AllowOverride All  
\</Directory\>  
\<Directory ${HOME}/cgi-bin\>  
allow from all  
\</Directory\>  
[/code:1]

And you’d want to make sure mod\_php is the execution type for PHP scripts, and suexec is disabled.

[Next page](https://forum.virtualmin.com/t/how-to-setup-apache2-mpm-itk-under-virtualmin/30962.md?page=2)
