Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

On a ubuntu-10.04 and Apache2 I am trying to disable PHP execution on /var/www/upload directory. So I've added the following to /etc/apache2/sites-enabled/000-default:

< Directory /var/www/upload/> AddType text/plain .php < /Directory>

Then of course I've restarted the Apache2 service.

However, according to my tests, PHP is still being executed on the upload directory.

Anyone knows what I'm missing here?

share|improve this question

migrated from Jul 18 '11 at 22:42

This question came from our site for computer enthusiasts and power users.

What happens if you chmod -R a-x /var/www/upload/* ? (Remove execute permission on all files in /var/www/upload ? – Darth Android Jul 18 '11 at 16:49
Yes that's a solution :) , but I'd like to do that from Apache configuration. I've been fighting with this for a couple of hours and still nothing :/ – lisa1987 Jul 18 '11 at 17:13
Are you a sysadmin or is this site a home computer? – random Jul 18 '11 at 20:49
It's a Virtual Machine I'm testing on – lisa1987 Jul 18 '11 at 21:49

Try using the apache directive 'RemoveHandler' in directory context,

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.