LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-04-2010, 02:01 AM   #1
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 242

Rep: Reputation: 18
Question 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.
 
Old 10-04-2010, 05:19 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,883

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
Are you sure that the server listening on port 8090 is actually running?

Also remove the <Location ..> ... </Location> part and restart apache
 
Old 10-04-2010, 06:01 AM   #3
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 242

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by bathory View Post
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 ?
 
Old 10-04-2010, 06:43 AM   #4
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 242

Original Poster
Rep: Reputation: 18
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/
 
Old 10-04-2010, 06:44 AM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,883

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
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}
 
  


Reply

Tags
apache, configuration, problem, proxy, reverse


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache as Reverse Proxy LR_Brian Linux - Server 4 02-17-2009 11:33 AM
squid reverse proxy configuration with ssl gogga Linux - Server 0 09-12-2008 08:29 AM
reverse proxy with apache 2 bootiack Linux - Software 1 08-09-2005 06:47 PM
apache reverse proxy wildbob Linux - Networking 8 10-15-2003 12:16 PM
apache Reverse Proxy !!!!! ashish_v Linux - Software 0 09-05-2003 04:42 PM


All times are GMT -5. The time now is 08:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration