LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache Reverse Proxy - problem with configuration (http://www.linuxquestions.org/questions/linux-server-73/apache-reverse-proxy-problem-with-configuration-836036/)

dlugasx 10-04-2010 03:01 AM

Apache Reverse Proxy - problem with configuration
 
Hi Gurus,

I have a question to masters of Apache.

In my operating system (CentOS 5) I have installed two Apaches.
One is Apache (port 80) from repository where I planning to configure proxy and second one is Apache integrated(port 8090) with KnowledgeTree software.

The problem is that when I^m trying to configure proxy reverse it simply doesnt work.

This is link to KnowledgeTree software:
- http://127.0.0.1:8090/knowledgeTree

This link I would like to rewrite with proxy like this:

https://myserver.com/knowledgeTree
(HTTPS dont forget)


In my ssl.conf in VirtualHost part I have created something like this:
Code:

<IfModule mod_proxy.c>

<Proxy *>
Order allow,deny
Allow from all
</Proxy>

    ProxyRequests off
    ProxyPass /knowledgeTree http://127.0.0.1:8090/knowledgeTree
    ProxyPassReverse /knowledgeTree http://127.0.0.1:8090/knowledgeTree


<Location /knowledgeTree/>
    ProxyPassReverse /
</Location>

</IfModule>


Why it doesnt work ? Does anybody knows ?

When I`m trying to connect I see only

Unable to connect
Firefox can't establish a connection to the server at ifdocu.contaxt.biz:8090.

bathory 10-04-2010 06:19 AM

Are you sure that the server listening on port 8090 is actually running?

Also remove the <Location ..> ... </Location> part and restart apache

dlugasx 10-04-2010 07:01 AM

Quote:

Originally Posted by bathory (Post 4117045)
Are you sure that the server listening on port 8090 is actually running?

Also remove the <Location ..> ... </Location> part and restart apache

Hi Batory,

yes its working. No I have this in https Virtual Host congiration:

Code:

<IfModule mod_proxy.c>

<Proxy *>
Order allow,deny
Allow from all
</Proxy>

ProxyPreserveHost On
ProxyRequests off
    LogLevel debug
    ErrorLog /var/log/httpd/proxyssl_error_log
    CustomLog /var/log/httpd/proxyssl_access_log combined
ProxyPass /knowledgeTree http://localhost:8090/knowledgeTree
ProxyPassReverse /knowledgeTree http://localhost:8090/knowledgeTree


#<Location /knowledgeTree/>
#ProxyPass http://127.0.0.1:8090/knowledgeTree
#SetEnv force-proxy-request-1.0 1
#SetEnv proxy-nokeepalive 1
#    order allow,deny
#    allow from all
#</Location>

</IfModule>

It seems its working first page

https://myserver.com/knowledgeTree

I see login panel.

When I`m trying to log in unfortunately server redirecting me to

http://myserver.com/knowledgeTree/login.php

After change to https://myserver.com/knowledgeTree/login.php

I can see application.

Why server doesnt want to rewrite URL`s http://127.0.0.1:8090/knowledgeTree to https://myserver.com/knowledgeTree/login.php

With applications url everything is fine. Its working without port but only http to https is not rewrited. How to change this Batory ? Do You know ?

dlugasx 10-04-2010 07:43 AM

I have manage the problem.

Proxy configuration HTTPS to HTTP will not work if You will not put this line in httpd.conf:

Code:

Redirect permanent / https://myserver.com/

bathory 10-04-2010 07:44 AM

Quote:

After change to https://myserver.com/knowledgeTree/login.php

I can see application.

Why server doesnt want to rewrite URL`s http://127.0.0.1:8090/knowledgeTree to https://myserver.com/knowledgeTree/login.php

With applications url everything is fine. Its working without port but only http to https is not rewrited
I don't fully understand what you're trying to do, but if you want to use ssl for the vhost, you can use mod_rewrite to turn http to https:
Code:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}



All times are GMT -5. The time now is 01:48 AM.