FAQ
This is very simple question: what should I do in httpd.conf to map some URL
to the file system directory? I need something like this:

<Location /MyURL/SomeURL/>
ProxyPass D:\myDir\mySubDir
</Location>

Apache 2.2 on Win 2003 Server. I've been reading <Location>, <Directory> and
<Files> documentation and I haven't found any example.
--
View this message in context: http://old.nabble.com/Map-URL-to-directory-tp32694522p32694522.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Search Discussions

  • Pete Houston at Oct 21, 2011 at 8:30 am
    Most likely what you are after is the "Alias" directive.

    Pete
    On Fri, Oct 21, 2011 at 12:32:05AM -0700, milan tomic wrote:

    This is very simple question: what should I do in httpd.conf to map some URL
    to the file system directory? I need something like this:

    <Location /MyURL/SomeURL/>
    ProxyPass D:\myDir\mySubDir
    </Location>

    Apache 2.2 on Win 2003 Server. I've been reading <Location>, <Directory> and
    <Files> documentation and I haven't found any example.
    --
    Openstrike - improving business through open source
    http://www.openstrike.co.uk/ or call 01722 770036 / 07092 020107
  • Milan tomic at Oct 21, 2011 at 5:54 pm

    Pete Houston wrote:

    Most likely what you are after is the "Alias" directive.
    Yes, Alias is what I need. But it doesn't work for me. I have this case:

    <VirtualHost *:80>
    DocumentRoot "D:/Dir1/Dir2"

    <Location /MainPath/App1>
    ProxyPass http://tomcat1/MainPath/App1
    </Location>

    Alias /MainPath/AL "D:\Dir3\Dir4"
    <Directory "D:\Dir3\Dir4">
    Order allow,deny
    Allow from all
    </Directory>

    <Location /MainPath/>
    ProxyPass ajp://tomcat2/MainPath/
    </Location>

    ProxyPass /MainPath ajp://tomcat2/MainPath

    </VirtualHost>

    and when I visit http://apachehttpd1/MainPath/AL tomcat returns 404 not
    found :(
    --
    View this message in context: http://old.nabble.com/Map-URL-to-directory-tp32694522p32698123.html
    Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    The official User-To-User support forum of the Apache HTTP Server Project.
    See <URL:http://httpd.apache.org/userslist.html> for more info.
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    " from the digest: users-digest-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org
  • Milan tomic at Oct 21, 2011 at 6:06 pm
    Documentation says:

    "Note however <Location> sections are run through once before aliases are
    performed, so they will apply."

    but it doesn say how to fix it :( What should I use instead?
    --
    View this message in context: http://old.nabble.com/Map-URL-to-directory-tp32694522p32698179.html
    Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    The official User-To-User support forum of the Apache HTTP Server Project.
    See <URL:http://httpd.apache.org/userslist.html> for more info.
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    " from the digest: users-digest-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org
  • Matus UHLAR - fantomas at Oct 24, 2011 at 11:43 am

    Pete Houston wrote:
    Most likely what you are after is the "Alias" directive.
    On 21.10.11 10:53, milan tomic wrote:
    Yes, Alias is what I need. But it doesn't work for me. I have this case:

    <VirtualHost *:80>
    DocumentRoot "D:/Dir1/Dir2"

    <Location /MainPath/App1>
    ProxyPass http://tomcat1/MainPath/App1
    </Location>

    Alias /MainPath/AL "D:\Dir3\Dir4"
    <Directory "D:\Dir3\Dir4">
    Order allow,deny
    Allow from all
    </Directory>

    <Location /MainPath/>
    ProxyPass ajp://tomcat2/MainPath/
    </Location>

    ProxyPass /MainPath ajp://tomcat2/MainPath

    </VirtualHost>

    and when I visit http://apachehttpd1/MainPath/AL tomcat returns 404 not
    found :(
    I am afrtaid you are instructing apache to pass /MainPath/ to tomcat,
    which includes /MainPath/AL ... maybe you could Alias /MainPath/AL
    within other Location directive.
    --
    Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
    Warning: I wish NOT to receive e-mail advertising to this address.
    Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
    - Holmes, what kind of school did you study to be a detective?
    - Elementary, Watson. -- Daffy Duck & Porky Pig

    ---------------------------------------------------------------------
    The official User-To-User support forum of the Apache HTTP Server Project.
    See <URL:http://httpd.apache.org/userslist.html> for more info.
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    " from the digest: users-digest-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org
  • Tom Evans at Oct 24, 2011 at 11:50 am

    On Fri, Oct 21, 2011 at 6:53 PM, milan tomic wrote:

    Pete Houston wrote:
    Most likely what you are after is the "Alias" directive.
    Yes, Alias is what I need. But it doesn't work for me. I have this case:

    <VirtualHost *:80>
    DocumentRoot "D:/Dir1/Dir2"

    <Location /MainPath/App1>
    ProxyPass  http://tomcat1/MainPath/App1
    </Location>

    Alias /MainPath/AL "D:\Dir3\Dir4"
    <Directory "D:\Dir3\Dir4">
    Order allow,deny
    Allow from all
    </Directory>

    <Location /MainPath/>
    ProxyPass  ajp://tomcat2/MainPath/
    </Location>

    ProxyPass /MainPath ajp://tomcat2/MainPath

    </VirtualHost>

    and when I visit http://apachehttpd1/MainPath/AL tomcat returns 404 not
    found :(
    Tell Apache not to proxy that specific URL (no location block with this style):

    ProxyPass /MainPath/AL !
    ProxyPass /MainPath/App1 http://tomcat1/MainPath/App1
    ProxyPass /MainPath/ ajp://tomcat2/MainPath/

    Alias /MainPath/AL "D:\Dir3\Dir4"
    <Directory "D:\Dir3\Dir4">
    Order allow,deny
    Allow from all
    </Directory>

    Cheers

    Tom

    ---------------------------------------------------------------------
    The official User-To-User support forum of the Apache HTTP Server Project.
    See <URL:http://httpd.apache.org/userslist.html> for more info.
    To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
    " from the digest: users-digest-unsubscribe@httpd.apache.org
    For additional commands, e-mail: users-help@httpd.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriesapache
postedOct 21, '11 at 7:32a
activeOct 24, '11 at 11:50a
posts6
users4
websitehttpd.apache.org
irc#httpd

People

Translate

site design / logo © 2022 Grokbase