Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to disable every form of scripting (PHP, ASP.NET, CGI) for a specific vhost in my Apache2 setup. Only plain old HTML pages.

Scripting must remain enabled for all other vhosts in the server.

It's not a security concern, it's a commercial concern (customer pays less for hosting)

Is it possible and how can I do that?

[Edit] From what I've found around the web, I'm going to try the following

RemoveHandler .php .phtml .php3
RemoveType .php .phtml .php3
RemoveHandler .aspx .ascx .ashx .asmx .asax .soap .rem axd .cs .vb .master .sitemap .resources. skin .browser .webinfo $
RemoveType .aspx .ascx .ashx .asmx .asax .soap .rem axd .cs .vb .master .sitemap .resources. skin .browser .webinfo .re$
php_flag engine off

This selectively disables PHP and .NET which are the only scripting runtimes installed

share|improve this question
@Fuzzyfelt I haven't tried anything yet because I was very confused about how to do it before reading answer and a few articles about PHP – usr-local-ΕΨΗΕΛΩΝ Oct 20 '12 at 11:18

Try SetHandler default-handler in the vhosts in question.

Compare: Apache Handler documentation.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.