Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: ubuntu server apache 2 wont load pictures from sub directory

  1. #1
    Join Date
    Mar 2006
    Location
    127.0.0.1
    Beans
    198

    ubuntu server apache 2 wont load pictures from sub directory

    Hey All.

    I have this strange problem with apache running on a VPS server I bought for the purpose of running a website.
    Well and perhaps other things as well, but when I try to load any pictures on the server in the root it just says that I am not allowed to go and load those pictures.
    You can see the errors as well as I can if you visit http://ziggy-dog.eu and view the source and click on one of the image links.

    // ThaDoctor99

  2. #2
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,384
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ubuntu server apache 2 wont load pictures from sub directory

    What are the permissions of the folder and files? They need to be readable by apache2 user (www-data).

    Code:
    ls -l /path/to/folder
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  3. #3
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    8,050
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: ubuntu server apache 2 wont load pictures from sub directory

    Code:
    sudo chown -R www-data:www-data /var/www/picturedirectorythatisgivingyoutrouble
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  4. #4
    Join Date
    Mar 2006
    Location
    127.0.0.1
    Beans
    198

    Re: ubuntu server apache 2 wont load pictures from sub directory

    I suppose it makes sense to make www-data the owner, wonder why I didn't think of that.
    But it seems it didn't quiet work.
    Perhaps I should do some more research into this command.
    Although I have done these things it still doesn't seem to work.
    I have never really used apache so much before, so I am not very fluent in the config files.
    Last edited by ThaDoctor99; January 14th, 2013 at 11:10 PM.

  5. #5
    Join Date
    Jun 2007
    Location
    Porirua, New Zealand
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: ubuntu server apache 2 wont load pictures from sub directory

    I took a look at the page, and ended up with a blank screen. I was able to see the the references to the images in the page source, but attempting to access the images gave me a message "You don't have permission to access /images/clothing.jpg on this server."

    Your apache log file and error log might be able to give you some clues as to what's happening.
    Forum DOs and DON'Ts
    Never assume that information you find using a search engine is up-to-date.

  6. #6
    Join Date
    Mar 2006
    Location
    127.0.0.1
    Beans
    198

    Re: ubuntu server apache 2 wont load pictures from sub directory

    Hmm That indicates that the system is actively denying the server access to that directory, although I just did try to change the owner and all that.

  7. #7
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,384
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ubuntu server apache 2 wont load pictures from sub directory

    Quote Originally Posted by ThaDoctor99 View Post
    Hmm That indicates that the system is actively denying the server access to that directory, although I just did try to change the owner and all that.

    Please post output of the following, change to match your directory.

    Code:
    ls -alt /path/to/folder
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  8. #8
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    8,050
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: ubuntu server apache 2 wont load pictures from sub directory

    You have to restart the apache server after making changes. (Always.)

    Code:
    sudo service apache2 restart
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  9. #9
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,384
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: ubuntu server apache 2 wont load pictures from sub directory

    Quote Originally Posted by tgalati4 View Post
    You have to restart the apache server after making changes. (Always.)

    Code:
    sudo service apache2 restart
    This is not required when changing file permissions. Apache2 does not cache all the permissions for all files on your system.

    It appears the directory is not readable. Even if it is owned by www-data, if the permissions don't have the read bit set... permission will still be denied.
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  10. #10
    Join Date
    Mar 2006
    Location
    127.0.0.1
    Beans
    198

    Re: ubuntu server apache 2 wont load pictures from sub directory

    Hmm Yeah I did just to test out stuff set the permission to 777 on the files.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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