Find the answer to your Linux question:
Results 1 to 5 of 5
noob here, lurking only so far, but haven't been able to figure this one out.. runnign apache 2.0 on fc4, cgi-bin works fine, SSI works fine, however the cgi script ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2005
    Posts
    3

    apache question - cgi script writing into a file?


    noob here, lurking only so far, but haven't been able to figure this one out..

    runnign apache 2.0 on fc4, cgi-bin works fine, SSI works fine, however the cgi script i'm trying to make work will not..

    its a counter program, counter.cgi (from matt's script archive). i'm able to call it via SSI, however the error I get is..

    [TextCounter Fatal Error: Could Not Write to File _index_shtml]
    there's nothign in the log files. the paths are as following:

    the cgi path to the data dir where the counter file is stored: $data_dir = "/var/www/cgi-bin/textcounter/data/"; - i tried everything, from chmod 777 to different path names - www/cgi-bin/textcounter/data/, /www/cgi-bin/textcounter/data, cgi-bin/textcounter/data, /cgi-bin/textcounter/, etc. tried every combination, no go.

    the counter.cgi file is in /var/www/cgi-bin/textcounter/counter.cgi (also tried putting it in /var/www/cgi-bin/counter.cgi, also no luck)

    I've been reading the apache documentation but don't see anything regarding a cgi program writing to a file, so i'm mot sure if i'm missing something. Looked over httpd.conf several times, and don't see anything that's relevant..

    if more information (sections of the httpd.conf) are needed i would be glad to post those up.

    any help is appreciated. spent 3 days tinkering/reading on this (linux noob here) but no luck, so i resort to posting.. nothing relevant in search/google came up either..

    thank you!

  2. #2
    Just Joined!
    Join Date
    Apr 2005
    Posts
    14
    have you checked ownership?

    (Hint: ls -l )

  3. #3
    Just Joined!
    Join Date
    Oct 2005
    Posts
    3
    did some reading.. makes sense, but everything is set to root? the error log directory ownership is root as well but apache writes to it just fine..

    any tips on where to research next (don't necessarily need an answer)??

    Thanks

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Apr 2005
    Posts
    14
    owner and group should be apache

    chown -R apache. /var/www/textcounter

    that will change everything to apache owner and group

  6. #5
    Just Joined!
    Join Date
    Oct 2005
    Posts
    3
    forgot to update this thread.. played/read up on that, set owner and group to both apache, continued playing with the data_dir paths, tried chmod 777 again, still nothing.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •