Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 superuser.com Jul 18 '11 at 22:42

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

1  
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

1 Answer 1

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

http://httpd.apache.org/docs/current/mod/mod_mime.html#removehandler

share|improve this answer

Your Answer

 
discard

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.