Find the answer to your Linux question:
Results 1 to 2 of 2
Hi All, I am news to this forum , I have one question I have one file located in /var/images/image.png I have to access this file from apache web server ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    1

    Red face How to Access a File


    Hi All,
    I am news to this forum , I have one question
    I have one file located in /var/images/image.png I have to access this file from apache web server . How do I access this file . I have apache installed in my linux box. Is there any tools available to access a file . I want to access the file like
    myservername/var/images/image.png or any similar ways .
    Please help me out .

  2. #2
    Just Joined!
    Join Date
    Aug 2009
    Posts
    76
    Theres a few ways to go about this. One is to move the images over to your /var/www folder which is your default web folder that is accessible from your network ip or http: //localhost

    You could also edit /etc/apache2/sites-enabled to point to your /var/images folder as your website's default (replacing /var/www as your website's default folder)

    You could also simply symlink your /var/images folder to your /var/www -- so that the symlinked folder is /var/www/varimages and can be accessed via http://localhost/varimages/image.png

    A symlinking operation can be performed by running a command such as
    Code:
    sudo ln -s /var/images /var/www/varimages
    Keep in mind that command is (lowercase) LN

Posting Permissions

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