[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] PHP On only select virtual sites ?



<snip>
> > > Does anyone know if it's possible to restrict php to only working
> > > on select virtual sites as opposed to all of them ?
> >
> >Just check the checkbox which enables PHP for each site that you want
> >enabled... same as for ASP, CGIs, SSI, etc.
</snip>

Hi Kameel,

On the RaQ this should do what you need. First open up /etc/httpd/conf/srm.conf
and look for the lines:
AddType application/x-httpd-php .php
and comment them all out so that no addtype entries are there for the application/x-httpd-php

Now open up /etc/httpd/conf/httpd.conf and go to the <Virtualhost> entries you want to add PHP functionality to, and add in the AddType lines you just commented out.
So a complete virtual host will be something like:

NameVirtualHost 111.111.111.111
<VirtualHost 111.111.111.111>
ServerName www.domainname.co.uk
ServerAdmin admin
DocumentRoot /home/sites/site1/web
RewriteEngine on
RewriteCond %{HTTP_HOST}                !^111.111.111.111(:80)?$
RewriteCond %{HTTP_HOST}                !^www.domainname.co.uk(:80)?$
RewriteRule ^/(.*)                      http://www.domainname.co.uk/$1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/site1/users/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /home/sites/site1/users/$1/web/$3
AddHandler cgi-wrapper .cgi
AddHandler cgi-wrapper .pl
AddHandler server-parsed .shtml
AddType    text/html     .shtml
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
AddType application/x-httpd-php .inc
</VirtualHost>

(note: I haven't tried this, so make backups then try it first!)

Regards,

Andy
andy@xxxxxxxxxx
http://www.raqpak.com  <-- Unofficial FAQs and PKGs