You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chris Dagnon <ch...@isthmusgroup.com> on 2006/08/14 18:17:51 UTC

[users@httpd] How to get Alias and ProxyPass working in vhost file with Location and Directory?

Hello all, this is an expert-level question from a newbie:

I've got a vhost file setup to ProxyPass off to Rails on port 3000, but
now we're told we have to server images and CSSs from a shared directory
elsewhere.  The thought is to have a /www/static/images/ where all images
live and are served from.  This is what my working vhost file looks like:

<VirtualHost *>
  ServerName myserver.host.com
  ProxyPassReverse / http://localhost:3000/
  ProxyPass / http://localhost:3000/
# Other entries like LogLevel, ErrorLog, etc.
</VirtualHost>

# a couple <Location ...>..</Location> entries for permissions

Now if I add the following entry after </VirtualHost> I'm able to view the
images at http://localhost/images/whatever.jpg:

Alias /images/ /www/static/images/
<Directory /www/static/images>
  Order allow,deny
  Allow from all
</Directory>

However I cannot access the images from
http://myserver.host.com/images/whatever.jpg - that only returns 404
errors.  I've attempted to put the Alias line (and sometimes the Directory
entry) inside the VirtualHost, even before the ProxyPass/Reverse lines
with no change in behaviour.  Other alternatives were to try a SymLink
with Option FollowSymLink or ProxyMatch - except that doesn't seem to have
a Directory directive - or another ProxyPass - but would that be something
like ProxyPass /images/ http://localhost:80/images/?

The documentation I've found so far has no examples, and my Google-fu
seems to be lacking here.

Suggestions?

Thanks,

-Chris

---------------------------------------------------------------------
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


Re: [users@httpd] view a directory content from browser

Posted by Rob Sterenborg <ro...@sterenborg.info>.
On Wed, August 16, 2006 11:31, Manuela.Vorazzo@ssb.it wrote:
> Is there a directive for apache that can make all the users not viewing
> the list of the file in a directory when they access Apache webserver from
> browser? I'm thinking about something like DirAccess off/on.

http://httpd.apache.org/docs/2.2/mod/core.html#options
-> Indexes


Gr,
Rob



---------------------------------------------------------------------
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


Re: [users@httpd] Keywords and apache

Posted by Joshua Slive <jo...@slive.ca>.
On 9/26/06, Qingshan Xie <xi...@yahoo.com> wrote:
> Joshua,
>
> Sorry for late question.
> I thought mod_dir will append this trailing-slash but
> seems Apache core can also do it.  what is the
> relation of mod_dir and Apache core for this
> trailing-slash redirect handling?

As far as I know, apache does not do trailing-slash redirects unless
mod_dir is present.

Joshua.

---------------------------------------------------------------------
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


Re: [users@httpd] Keywords and apache

Posted by Joshua Slive <jo...@slive.ca>.
On 9/19/06, sniedermeyer@cob.org <sn...@cob.org> wrote:

> So when I type in www.mydomain.com/keyword   the browser delivers
> www.mydomain.com/keyword/index.htm, however, the address bar in the browser
> only shows www.mydomain.com/keyword

I doubt that.  It probably shows http://www.mydomain.com/keyword/
(note the trailing slash).  This is usually what is desired.  The
index.htm is considered an implimentation detail that is better hidden
from the client.  If you really want this, then redirect directly to
it:
Redirect permanent /keyword http://www.mydomain.com/keyword/index.htm

Joshua.

---------------------------------------------------------------------
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


Re: [users@httpd] Keywords and apache

Posted by Qingshan Xie <xi...@yahoo.com>.
Joshua,  

Sorry for late question. 
I thought mod_dir will append this trailing-slash but
seems Apache core can also do it.  what is the
relation of mod_dir and Apache core for this
trailing-slash redirect handling? 

Thx, Q.Xie

--- Joshua Slive <jo...@slive.ca> wrote:
......
> This is called a trailing-slash redirect, and should
> happen automatically if you have "UseCanonicalName
off". 
> Then the index.html should be delivered
automatically if DirectoryIndex
> is set correctly.
> If that isn't working, tell us exactly what is
> happening including the
> contents of the error and access logs for the
> request.
> 
> For the second example, you need something like
> Redirect permanent /keyword
> http://www.mydomain.com/department/services/keyword/
> 
> Joshua.
> 
>
---------------------------------------------------------------------
> 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
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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


Re: [users@httpd] Keywords and apache

Posted by sn...@cob.org.
It appears to be serving up the correct page, but the full URL isn't
showing.  I tried adding the "UseCanonicalName off" and it didn't appear to
affect anything.

So when I type in www.mydomain.com/keyword   the browser delivers
www.mydomain.com/keyword/index.htm, however, the address bar in the browser
only shows www.mydomain.com/keyword

When I type in www.mydomain.com the browser delivers
www.mydomain.com/index.htm and the address bar in the browser shows
www.mydomain.com/index.htm (this is what I'm trying to accomplish with the
keywords).

I made sure the dir module is loaded as well.

Here's what the access log shows when I try to pull up
www.mydomain.com/keyword

XXX.XXX.XXX.XXX - - [19/Sep/2006:16:43:20 -0700] "GET /keyword HTTP/1.1"
200 6942 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4)
Gecko/20060508 Firefox/1.5.0.4"

Based on your comment about the trailing slash.  I found documentation
pointing to the need to have the following directive:

DirectorySlash On

I added this and it didn't appear to fix this issue either, although it
sounded like it was supposed to address it.

My DirectoryIndex is set as follows:

<IfModule dir_module>
    DirectoryIndex index.html index.htm default.htm default.html
</IfModule>


____________________________
Steven Niedermeyer
Bellingham, WA





                                                                           
             "Joshua Slive"                                                
             <jo...@slive.ca>                                             
             Sent by:                                                   To 
             jslive@gmail.com          users@httpd.apache.org              
                                                                        cc 
                                                                           
             09/19/2006 04:19                                      Subject 
             PM                        Re: [users@httpd] Keywords and      
                                       apache                              
                                                                           
             Please respond to                                             
             users@httpd.apach                                             
                   e.org                                                   
                                                                           
                                                                           




On 9/19/06, sniedermeyer@cob.org <sn...@cob.org> wrote:
> Can anyone point me to the best directive to use for keyword redirection.
> What we're looking to do is allow visitors to our site to type in say
> http://www.mydomain.com/keyword and have them be redirected to
> http://www.mydomain.com/keyword/ and then let Apache pick up the default
> file index.htm so that it results in the visitor be sent to
> http://www.mydomain.com/keyword/index.htm.  Another example would be
> redirecting http://www.mdomain.com/keyword to
> http://www.mydomain.com/department/services/keyword/index.htm
>
> I tried the redirect directive but can't seem to get it to work.  Here's
> what I tried:
>
> Redirect permanent /pw http://www.cob.org/pw/

This is called a trailing-slash redirect, and should happen
automatically if you have "UseCanonicalName off".  Then the index.html
should be delivered automatically if DirectoryIndex is set correctly.
If that isn't working, tell us exactly what is happening including the
contents of the error and access logs for the request.

For the second example, you need something like
Redirect permanent /keyword
http://www.mydomain.com/department/services/keyword/

Joshua.

---------------------------------------------------------------------
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




---------------------------------------------------------------------
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


Re: [users@httpd] Keywords and apache

Posted by Joshua Slive <jo...@slive.ca>.
On 9/19/06, sniedermeyer@cob.org <sn...@cob.org> wrote:
> Can anyone point me to the best directive to use for keyword redirection.
> What we're looking to do is allow visitors to our site to type in say
> http://www.mydomain.com/keyword and have them be redirected to
> http://www.mydomain.com/keyword/ and then let Apache pick up the default
> file index.htm so that it results in the visitor be sent to
> http://www.mydomain.com/keyword/index.htm.  Another example would be
> redirecting http://www.mdomain.com/keyword to
> http://www.mydomain.com/department/services/keyword/index.htm
>
> I tried the redirect directive but can't seem to get it to work.  Here's
> what I tried:
>
> Redirect permanent /pw http://www.cob.org/pw/

This is called a trailing-slash redirect, and should happen
automatically if you have "UseCanonicalName off".  Then the index.html
should be delivered automatically if DirectoryIndex is set correctly.
If that isn't working, tell us exactly what is happening including the
contents of the error and access logs for the request.

For the second example, you need something like
Redirect permanent /keyword http://www.mydomain.com/department/services/keyword/

Joshua.

---------------------------------------------------------------------
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


[users@httpd] Keywords and apache

Posted by sn...@cob.org.
Can anyone point me to the best directive to use for keyword redirection.
What we're looking to do is allow visitors to our site to type in say
http://www.mydomain.com/keyword and have them be redirected to
http://www.mydomain.com/keyword/ and then let Apache pick up the default
file index.htm so that it results in the visitor be sent to
http://www.mydomain.com/keyword/index.htm.  Another example would be
redirecting http://www.mdomain.com/keyword to
http://www.mydomain.com/department/services/keyword/index.htm

I tried the redirect directive but can't seem to get it to work.  Here's
what I tried:

Redirect permanent /pw http://www.cob.org/pw/

Any help appreciated...I'll be sure to pay it forward.

Thanks.
____________________________
Steven Niedermeyer
Bellingham, WA


---------------------------------------------------------------------
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


Re: [users@httpd] view a directory content from browser

Posted by Sascha Kersken <sk...@lingoworld.de>.
Hi,

It's this one:

Options -Indexes

See http://httpd.apache.org/docs/2.2/mod/core.html#options


Regards
Sascha

  ----- Original Message ----- 
  From: Manuela.Vorazzo@ssb.it 
  To: users@httpd.apache.org 
  Sent: Wednesday, August 16, 2006 11:31 AM
  Subject: [users@httpd] view a directory content from browser



  Is there a directive for apache that can make all the users not viewing the list of the file in a directory when they access Apache webserver from browser? 
  I'm thinking about something like DirAccess off/on. 


  Thnaks a lot

[users@httpd] view a directory content from browser

Posted by Ma...@ssb.it.
Is there a directive for apache that can make all the users not viewing 
the list of the file in a directory when they access Apache webserver from 
browser?
I'm thinking about something like DirAccess off/on.


Thnaks a lot

[users@httpd] Proxy config not acting as expected

Posted by sn...@cob.org.
I have an Apache 2.2.2 server set up to reverse proxy and am having some
problems.

Here's the config:

ProxyPass / http://192.168.1.1
ProxyPassReverse / http://192.168.1.1

The intent is to redirect everything hitting / to a back end server.   The
backend server is a Domino server.  The static files hosted on the Domnio
server are being reverse proxied correctly as well as most of the dynamic
pages.  However, when I try to access one of our Domino web applications,
it has the following results:


Without the reverse proxy server in the way the resulting address looks
like this:

http://www.cob.org/cob%5Cbid.nsf/(bidswww)/77B-2006?OpenDocument&vc=301822&

With the reverse proxy server in the way I get a 404 error and the
resulting address looks like this:

http://192.168.1.2
/cob/bid.nsf/frmWebSignUp?OpenForm&Seq=1&bid_number=77B-2006

Here is what the access log on the reverse proxy server shows:

"Post /cob/bid.nsf/frmWebSignUp?OpenForm&Seq=1&bid_number=77B-2006
HTTP/1.1" 302 - "http://192.168.1.1
/cob/bid.nsf/frmWebSignUp?OpenForm&bid_number=77B-2006&
"Get /cob%5Cbid.nsf/(bidswww)/77B-2006?OpenDocument&vc=301822& HTTP/1.1"
404 228  "http://172.17.10.25
/cob/bid.nsf/frmWebSignUp?OpenForm&bid_number=77B-2006&"



I thought by having the proxypass and proxypassreverse in place at the site
root level, it would handle any subdirectories for the entire site.  Any
idea why this isn't working?

____________________________
Steven Niedermeyer
Information Technology Services
City of Bellingham
625 Halleck St
Bellingham, WA 98225
Phone: (360) 676-6671 x156
Fax: (360) 676-7693



---------------------------------------------------------------------
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


Re: [users@httpd] How to get Alias and ProxyPass working in vhost file with Location and Directory?

Posted by Joshua Slive <jo...@slive.ca>.
On 8/14/06, Chris Dagnon <ch...@isthmusgroup.com> wrote:

> I've got a vhost file setup to ProxyPass off to Rails on port 3000, but
> now we're told we have to server images and CSSs from a shared directory
> elsewhere.  The thought is to have a /www/static/images/ where all images
> live and are served from.  This is what my working vhost file looks like:

To rephrase, you have a global ProxyPass for a site and you want to
exclude certain directories.  Start by reading:
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass
Then, BEFORE the existing ProxyPass directive, put
ProxyPass /images !
Alias /images /www/static/images

Joshua.

---------------------------------------------------------------------
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