You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Johan Andersson <jo...@e-626.net> on 2007/12/06 22:02:39 UTC

[users@httpd] Apache server behind squid proxy

Hi!

I am trying to set up an Apache 2.2.6 server behind a squid reverse 
proxy/accelerator.

Squid listens on port 443. Apache listens on port 81 (port 80 already 
occupied by another server). So squid takes care of all SSL handling.

But I have problems to get Apache to understand that it should use 
https:// instead of http://, for example:
If I request https://server/dir Apache tries to redirect the browser to 
http://server/dir (as it doesn't know the browser acctually used 
https:// to begin with).

Any idea how I force Apache 2.2.6 to use https:// instead of http://?

/Johan Andersson

---------------------------------------------------------------------
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] Apache server behind squid proxy

Posted by Johan Andersson <jo...@e-626.net>.
Vincent Bray wrote:
> On 07/12/2007, Johan Andersson <jo...@e-626.net> wrote:
>> Sorry, didn't work. Apache won't start.
>> I get this in error_log:
>> [Fri Dec 07 19:42:56 2007] [info] Loading certificate & private key of
>> SSL-aware server
>> [Fri Dec 07 19:42:56 2007] [error] Server should be SSL-aware but has no
>> certificate configured [Hint: SSLCertificateFile]
>>
>> Seems like it tries to do SSL now.
> 
> Yeah, my bad. Protocol specifies the protocol to use in that context.
> 
> Going back to your original question, you should either get squid to
> fix the url in headers with whatever it's equivalent of
> ProxyPassReverse is, or specify
> 
> ServerName https://your.server.name/
> 
> .. in your vhost. I forgot that was possible.
> 
> See:
> 
> http://httpd.apache.org/docs/2.2/mod/core.html#servername
> .. and ..
> http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse
> .. for how apache would solve the problem, were it the proxy.
> 

Thanks, the ServerName https://your.server.name/ did it!

/Johan

---------------------------------------------------------------------
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] Apache server behind squid proxy

Posted by Vincent Bray <no...@gmail.com>.
On 07/12/2007, Johan Andersson <jo...@e-626.net> wrote:
> Sorry, didn't work. Apache won't start.
> I get this in error_log:
> [Fri Dec 07 19:42:56 2007] [info] Loading certificate & private key of
> SSL-aware server
> [Fri Dec 07 19:42:56 2007] [error] Server should be SSL-aware but has no
> certificate configured [Hint: SSLCertificateFile]
>
> Seems like it tries to do SSL now.

Yeah, my bad. Protocol specifies the protocol to use in that context.

Going back to your original question, you should either get squid to
fix the url in headers with whatever it's equivalent of
ProxyPassReverse is, or specify

ServerName https://your.server.name/

.. in your vhost. I forgot that was possible.

See:

http://httpd.apache.org/docs/2.2/mod/core.html#servername
.. and ..
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassreverse
.. for how apache would solve the problem, were it the proxy.

-- 
noodl

---------------------------------------------------------------------
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] Apache server behind squid proxy

Posted by Johan Andersson <jo...@e-626.net>.
Vincent Bray wrote:
> On 06/12/2007, Johan Andersson <jo...@e-626.net> wrote:
>> But I have problems to get Apache to understand that it should use
>> https:// instead of http://, for example:
>> If I request https://server/dir Apache tries to redirect the browser to
>> http://server/dir (as it doesn't know the browser acctually used
>> https:// to begin with).
>>
>> Any idea how I force Apache 2.2.6 to use https:// instead of http://?
> 
> I think you might want the Protocol directive, but it's not documented
> yet so I can't be sure. Just for giggles, try Protocol https and see
> if a) your server starts and b) it gets you anywhere closer to fixing
> the problem. If either, please reply and I'll try and documented it
> :-)
> 

Sorry, didn't work. Apache won't start.
I get this in error_log:
[Fri Dec 07 19:42:56 2007] [info] Loading certificate & private key of 
SSL-aware server
[Fri Dec 07 19:42:56 2007] [error] Server should be SSL-aware but has no 
certificate configured [Hint: SSLCertificateFile]

Seems like it tries to do SSL now.

/Johan

---------------------------------------------------------------------
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] Apache server behind squid proxy

Posted by Vincent Bray <no...@gmail.com>.
On 06/12/2007, Johan Andersson <jo...@e-626.net> wrote:
> But I have problems to get Apache to understand that it should use
> https:// instead of http://, for example:
> If I request https://server/dir Apache tries to redirect the browser to
> http://server/dir (as it doesn't know the browser acctually used
> https:// to begin with).
>
> Any idea how I force Apache 2.2.6 to use https:// instead of http://?

I think you might want the Protocol directive, but it's not documented
yet so I can't be sure. Just for giggles, try Protocol https and see
if a) your server starts and b) it gets you anywhere closer to fixing
the problem. If either, please reply and I'll try and documented it
:-)

-- 
noodl

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