Debian Admin

Debian/Ubuntu Linux System Administration Tutorials,Howtos,Tips

  • RSS Feed

    subscribe to the Debian Admin RSS feed
  • Sponsors



    • Cheap Web hosting services
  • Categories

  • Meta

  • Support Debian Admin

    Amount $:
    Website(Optional):

  • Sponsors

  • Archives



Running Vhosts With Apache2 mpm-itk On Debian

Posted by Admin on August 27th, 2008

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

apache2-mpm-itk (just mpm-itk for short) is an MPM (Multi-Processing Module) for the Apache 2 web server. mpm-itk allows you to run each of your vhost under a separate uid and gid — in short, the scripts and configuration files for one vhost no longer have to be readable for all the other vhosts.

Requirements

Apache2 installation with PHP support

Install apache2 with PHP4 or PHP5 support in debian etch

#aptitude install apache2

This will complete the installation

Now you need to install php4 or php5 for apache2 server

For php4 users the following command

#aptitude install php4

For php5 users the following command

#aptitude install php5

Enable mod_php for apache2 server in etch

Use the following commands

For php4 users the following command

#aptitude install libapache2-mod-php4

For php5 users the following command

#aptitude install libapache2-mod-php5

If you install the PHP4 or PHP5 modules for Apache2 then they will automatically enable themselves.If you have any problem you can use the following commands to enable php modules manually.

For php4 users the following command

# a2enmod php4

For php5 users the following command

# a2enmod php5

Install apache2-mpm-itk on Debian

aptitude install apache2-mpm-itk

This will complete the installation.

Configure apache2-mpm-itk in Debain

apache2-mpm-itk is configured on a per-vhost basis, i.e., we don’t have to set any global options, and there’s only one directive we need to set in a vhost, AssignUserId, which takes two parameters, the user name and the group that the vhost will run as.

In this example we will use the default Debian Apache vhost (you can find its configuration in /etc/apache2/sites-available/default) with the document root /var/www (if you have different vhosts, please adjust this to your situation), and we want this vhost to run as the user web_test and group web.

If the user and group don’t already exist, we can create them as follows:

#groupadd web

#useradd -s /bin/false -d /home/web_test -m -g web web_test

Then we open our vhost configuration and add the following lines to it:

<IfModule mpm_itk_module>
AssignUserId web_test web
</IfModule>

For Example

#vi /etc/apache2/sites-available/default

NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2’s default start page
# in /apache2-default/, but still have / go to the right place
RedirectMatch ^/$ /apache2-default/
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /doc/ “/usr/share/doc/”
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

<IfModule mpm_itk_module>
AssignUserId web_test web
</IfModule>
</VirtualHost>

Restart Apache server using the following commands

#/etc/init.d/apache2 restart

Share/Save/Bookmark

4 Responses to “Running Vhosts With Apache2 mpm-itk On Debian”

  1. ryan Says:

    Very interesting. Is this the method of setting up vhosts that shared hosting providers use?

    Any why do the right click disable on your site? It’s super irritating (and easily evaded by anyone of the level reading your site) since I can’t use my spell check that uses a right click.

  2. Fredrik Says:

    Thanks.

    So this is very similar to SuPHP which is available for this purpose? Have always looked for something like this. Works like a charm.

  3. Cracknel Says:

    SuPHP runs only PHP as a different user, this mod runs apache too.

  4. rasheed Says:

    can u explain how to use this i mean where to create directories for each user , how to acces them, can you please explain oe to deploy an simple PHP project

    sorry if it is an silly question!! :(
    Thanx in advance

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
Rodney's Kontera DynamiContext Plugin plugged in.
webcams college girls - webcams free nude - webcams girls nude - webcams live free xxx - webcams live sex - webcams teen nude - women nude web cams - xxx adult cam - xxx adult web cam - xxx chat sites - xxx chat webcam - xxx free live porn - xxx webcam chat - yahoo adult web cams - yahoo adult web cams - young girls cam - young girls cam - young girls on webcam - young girls on webcams - young girls on webcams - young girls with webcams - young sex cams - young teen cams - adult chat network - cam girl free chat - adult chat room - cam girls chat - cam girls hot sexy - cam girls live - cam girls planet - cam lesbian chat - cam live free girls - cam live sex web - cams free live - cams live free video - cams sex live free - adult chat rooms - casual sex chat rooms - chat girl webcam - chat gratis xxx - chat live gay sex - chat online sex free - chat room adult - chat rooms adult - chat rooms sex - chat sex live free - chat sex video - chat sexy women - chat sexy women - chat webcam sex - adult chat websites - chat with sexy girl - chat xxx free live - college sex cams - college sex cams - college sex web cam - completely free sex chat - couple sex webcams - couples sex webcams - couples sex webcams - cute webcam girls - cyber sex amateur - cyber sex blogs - cyber sex blogs - adult cyber sex - cyber sex chat online - cyber sex download - cyber sex lesbian - cyber sex life - cyber sex talk - cyber sex web cams - cyber sex websites - cyber sex women - dirty video chat - ebony porn web cam - erotic adult webcams - erotic chat sites - erotic free chat - fee webcam sex - fre live sex chat - free adult cams - free adult chat avenue - free adult chat lines - free adult chat now - free adult chat now - free adult chat rooms - free adult chat sex - free adult chat sites - free adult porn cams - free adult porn webcam - free adult porn webcams - free adult web cams - adult porn live - free adult webcam porn - free adult webcams - free adult webcams - free amateur porn cams - free amateur sex webcams - free animal sex chat rooms - free asian sex cams