Apache 0777 directories

Discussion in 'Apache' started by aliahsan81, Oct 21, 2008.

  1. #1
    I have a web server,I have many world writeable directories (0777),Created by programmers,for uploading pictures.
    Now i want to stop script execution (php,cgi,etc) in these directories 0777,I know one way is to use htaccess file,i dont wana used that,if some one know any other method using apache config file or any other methods it will be great.
     
    aliahsan81, Oct 21, 2008 IP
  2. Krnl

    Krnl Peon

    Messages:
    60
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #2
    You shouldn't need 777 permissions. You should have your directories properly owned and grouped in a way that will allow the webserver to write to the directories. World writeable is just bad.

    So, if the server is running as user 'apache', the files should belong to group 'apache' with r/w/x privileges. The world privilege should be set to r/x at most. Something like this, maybe...

    
    drwxrwxr-x   adminuser  apache  4096  Oct 21 20:52   images_upload
    
    Code (markup):
     
    Krnl, Oct 21, 2008 IP