#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    10
    Rep Power
    0

    wierd cgi problem


    Hello all.
    i have a strange problem with some python cgi scripts.
    the deal is.....
    i keep loosing permission to write to a file created by a cgi script.
    the file is created in a directory created by a python script. but after the file is created by the cgi script,
    another script in the same folder cannot open it to write to. think that its a permissions issue.
    the thing is, all of it works on my Arch linux computer,
    but it doesn't work on my Ubuntu computer.
    same folders, same everything (except http.conf) because debian sets up its modules differently.
    how come it will create the directory, create the files, but not let me go back into the file to edit?
    any suggestions? what could be different? from one computer to the next?
  2. #2
  3. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    What are the file permissions on the directory?
    (ls -la /path/to/directory)

    --Simon
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    10
    Rep Power
    0
    the main directory where the files are to be written to and from is owned by my username -drwxrwxrwx
    the directory in that directory that the script created is
    owned by www-data drwx----------
    the file created in that directory is also owned by www-data
    and is -rw-r-r-----

    hope this helps.
  6. #4
  7. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    Interesting. Is www-data the use apache runs as? If it is, then that should be fine. However, try making the file world read-writeable (chmod a+rw filename), and see if that helps.

    --Simon
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    10
    Rep Power
    0
    do you mean chmod a+x the file and directory that the script creates ? or if i do that to the directory that the file goes in, will that work for everything in it ?
  10. #6
  11. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    No - you don't want to make it executable (+x) you want +rw. Do it to the directory, and to the file.

    Edit: NOTE - the directory will have to be +x, otherwise nothing can access the files in it.

    --Simon

    Comments on this post

    • CyBerHigh agrees
    Last edited by SimonGreenhill; June 4th, 2005 at 08:54 AM.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    10
    Rep Power
    0
    Done ! and we are rolling now.
    thanks so much
    you saved me from pulling all of my hair out !

IMN logo majestic logo threadwatch logo seochat tools logo