ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Photo gallery - does image directory need to be under the doc root? (or how to specify "Full URL to Image Directory"?)

September 06, 2007 6:28pm

Subscribe [3]
  • #1 / Sep 06, 2007 6:28pm

    c.emerson

    36 posts

    In setting up my 1st photo gallery and additional space for my server was implemented as a new volume.
    Assuming my site (running Apache) has C:\MySite as my document root for the web server, can I have my image directory be D:\MyPhotos (provided of course all the appropriate access rights are granted to that folder)? And if so, how do I specify the “Full URL to the Image Directory” in the Photo Gallery CP? 
    I know how to structure the URL when its under the doc root but not sure how to so this when its outside the docroot (if its possible).
    Probably something simple I just haven’t learned yet… 😝
    Thanks!
    -C

  • #2 / Sep 07, 2007 12:21am

    mojacreative

    50 posts

    No you can’t have the images outside the doc root, as only files within your doc root can be downloaded by the client’s browser. This is and Apache configuration issue rather than an Expression Engine one.

    Your best solution here to serve up files from your other drive would be to setup a Virtual host in Apache.

    In your apache conf file, you would need something along the lines of:

    Alias /images D:\MySite

    Using this setup, a request to http://www.yoursiteaddress.com/images/image1.jpg would pull the file from D:\Mysite\image1.jpg

    Where you put this configuration would depend a little on your individual apache configuration, but it’s a start.

    This configuration would bring that directory under your doc root again, so just structure the URL as you would normally do.

  • #3 / Sep 07, 2007 12:25am

    Sue Crocker

    26054 posts

    Thanks for the assist, neekster.

    I also found this:

    Setting Up a Virtual Host in Apache

  • #4 / Sep 07, 2007 10:13am

    c.emerson

    36 posts

    Thank you both! That’s the nudge I was looking for.

  • #5 / Sep 07, 2007 12:24pm

    c.emerson

    36 posts

    Actually, **all** I needed was the alias statement in my conf file - there wasn’t a need to establish a virtual host since using the same domain for gallery. Found a good write up on the Apache site (once I knew what to look for).
    Thanks again, neekster and Sue!!

  • #6 / Sep 07, 2007 12:49pm

    mojacreative

    50 posts

    Frame that one, it’s not often Apache issues are fixed in one line :D

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases