Find the answer to your Linux question:
Results 1 to 6 of 6
I recently installed and started using Apache for my home computer. I have a Perl script which reads all the image files in a directory, then displays them as thumbnails. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907

    Apache file permissions, I think


    I recently installed and started using Apache for my home computer. I have a Perl script which reads all the image files in a directory, then displays them as thumbnails. I know the script works, b/c I've been using it on my (paid) web-site for months. The problem is there's no images showing up. The tag will be correct [img] /html/photoalbum/album18/2004_0902_082514AA.jpg[/img], but the image says it can't be found. How can it not be found if the Perl script can find it??!! I'm thinking it must be a permission thing then, but I chmod'd everything to 777 including the directory itself and I still get the same error.

    http://65.29.162.19/cgi-bin/thumbnails.cgi?album18

    Right click > view image gives me:

    The requested URL /html/photoalbum/album18/2004_0902_082514AA.jpg was not found on this server.
    What's up with that?
    Thanks for you help,
    Jeremy
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

  2. #2
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    What does the appropriate error log say? It should say something about the file not being found, and a full path to the file. If you look at that path, and run an ls on it, you should be able to tell if the file exists. This leads to two solutions, either the file exists, and the permissions are wrong, or the file doesn't exist, and the path is wrong.

    Best,

    Samuel
    I respectfully decline the invitation to join your delusion.

  3. #3
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907
    Can you tell me the error log I'm looking for?
    Thanks,
    Jeremy
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    Quote Originally Posted by jeremy1701
    Can you tell me the error log I'm looking for?
    Thanks,
    Jeremy
    if you edit your httpd.conf file, it should tell you where the error log file is. generally in the apache root dir and then in the log folder, unless you have changed it. check that and report back

  6. #5
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    Code:
    locate httpd.conf | xargs grep ErrorLog
    I respectfully decline the invitation to join your delusion.

  7. #6
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907
    Thank you both. It turned out to be a little bit weird, but it's fixed. It must have something to do with the intricacies of where the script is executed from. The Perl portion of the script that reads the directory contents works, but the exact same path in the html portion of the script didn't. opendir('../../photoalbum') opened the directory and read the contents, but the [img]../../photoalbum[/img] didn't. I had to change it to ../photoalbum.

    The problem is solved, but I don't understand why. It would seem that the script is run from the location it's called, but generates the page from the top level directory (www) regardless of the script. Is that correct?
    Jeremy
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

Posting Permissions

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