Results 1 to 5 of 5

Thread: apache server display contents of hard drive

  1. #1
    Join Date
    Aug 2006
    Location
    North East England
    Beans
    576
    Distro
    Ubuntu

    apache server display contents of hard drive

    Ok, so I've got apache up and running on my server (checked by putting an index.html file into /var/www/ and accessing it via another machine on the network) and I want to access the machine's hard drive via http (through firefox basically) to download large files across the network to be worked on on different computers. How would I go about setting apache to display the contents of a specific directory, showing all subfolders and files etc present?

    Would this be easier if the machines connecting were set more as remote terminals to connect to the server?

    Thanks

    Ben

  2. #2
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: apache server display contents of hard drive

    you may just want to create a symlink in your /var/www directory to the directory that the files are located in, for example:

    Code:
    sudo ln -s /home/directory/big_files /var/www/big_files
    I would suggest only doing the above for use on your internal network. If your server is going to show it's face to the world, sftp/scp would be a much better choice.

    Jim

  3. #3
    Join Date
    Aug 2006
    Location
    North East England
    Beans
    576
    Distro
    Ubuntu

    Re: apache server display contents of hard drive

    Hi, thanks for the quick reply! Yeah, the server is on a wired-only, closed network, so security isn't really that big an issue!

    Thats exactly what I'm looking for, thanks! I take it I can just add multiple symbolic links to the location and they'll all show up like a directory listing?

    Thanks!

    Ben
    Last edited by benfindlay; January 21st, 2009 at 09:12 PM.

  4. #4
    Join Date
    Aug 2006
    Location
    North East England
    Beans
    576
    Distro
    Ubuntu

    Re: apache server display contents of hard drive

    Your symlink idea just made another thought occur to me. Is it possible to create a symlink (or any other type of link) to a folder on another machine on the network so that it shows up on my local machine in the directory structure?

  5. #5
    Join Date
    Nov 2007
    Beans
    395
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: apache server display contents of hard drive

    I believe it is better not to use a sym-link and use a <Directory> profile in your sites-available config (usually /etcapache2/sites-available/default << default is the name of the config file). Using a <Directory> statment gives you control over many attributes regarding how and what file to show, including whether you want to require an index page or just show a directory listing. You want to show a directory listing. I am sorry I am not a whiz at Apache setup and I didn't find any easy links with a quick search but there are lots out there. You can probably start with Apache's own documentation;
    http://httpd.apache.org/docs/2.0/

    Have fun!
    -- Coreigh

    "Only those who attempt the absurd will achieve the impossible"
    ... Einstein or Escher, you pick ...

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
  •