Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I set up an apache and a varnish on a dedicated server, which runs on debian squeeze.

Sometimes the varnish redirects to the apache backend port 8000. In this case the browser show i.e. mydomain.com:8000/shop/ and has no connection to the server and no content will be displayed. I guess the problem is caused by my apache or varnish configs, which are both are very basic.

The varnish runs on port 80 The apache runs on port 8000

Here some examples:

mydomain.com/shop/ -> mydomain.com/shop/ (works! The shop is displayed correctly)

mydomain.com/shop -> mydomain.com:8000/shop/ (no connection to server;no content)

mydomain.com/phpinfo.php -> mydomain.com/phpinfo.php (works!)

The shop, which I am using, is shopware. I thought about editing the .htaccess in den shop directory, but that didn't work. So I am using the standard shopware .htaccess.

If it helps, I can post my config files (varnish/apache) or the correct url of my server.

I would be very thankful for any advice. I running out of ideas.

Thank in advanced! Michael

share|improve this question
add comment

1 Answer 1

This is a problem from Apache. Apache tries to canonicalize Urls.

The Url "http://example.com/foo" is different from "http://example.com/foo/" (with trailing slash). Still most of the time the same resource is desired.

Apache tries to rewrite the urls without trailing slash so they point to the urls with trailing slash.

Now there the probleme is that you have your server running on port 8000 so apache adds this too.

There are two options from my perspective:

  1. Run the Apache on port 80
  2. Set "UseCanonicalName Off" in your apache conf and build an own rewrite to point the Urls without trailing slash to the right point.
share|improve this answer
    
Yeah, thanks! You pointed in the right direction. I set the ServerName to my.domain.com:80 and now it works –  Michi Qne Jun 20 '12 at 13:17
    
Nice to hear that I could help :) –  Christopher Perrin Jun 20 '12 at 13:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.