LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
Search this Thread
Old 08-05-2011, 06:10 AM   #16
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330

I hope you don't actually using this URL http://192.1.0.1/school/? and say that is not working. I've used the question mark "?" because I was asking you...
You should try http://192.1.0.1/school/ and/or http://192.1.0.1/school/f?p=2 and see if it brings up the correct content from the backend.

Quote:
What log I have to see. From my computer, when I go to http://11.11.1.1/red/f?p=2
How should I know what logs does the application on 11.11.11.1 create?
And please stop mixing URLs. Why it's now http://11.11.1.1/red/f?p=2 and not http://11.11.1.1/school/f?p=2 as in your 1st post
 
Old 08-05-2011, 06:21 AM   #17
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
You should try http://192.1.0.1/school/ and/or http://192.1.0.1/school/f?p=2 and see if it brings up the correct content from the backend.

http://192.1.0.1/school/ it work

http://192.1.0.1/school/f?p=2 it not work

Quote:
And please stop mixing URLs. Why it's now http://11.11.1.1/red/f?p=2 and not http://11.11.1.1/school/f?p=2 as in your 1st post
There are the same, it's only importait, the f?p=2 , because of ?


I don't thing the log of my aplication on http://11.11.1.1/school/f?p=2 is importation. Because I don't get to It. The url is not valid, because of ?


Thanks for your time
 
Old 08-05-2011, 07:23 AM   #18
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Doh. If,
Quote:
http://192.1.0.1/school/ it work
works, then the same goes for any URL under /school/
I've used apache as reverse proxy for a variety of applications, with URLs containing any of ?,+,# and so on, without any problem.
I'll give you the general config to reverse proxy a resource
Code:
RewriteEngine On
RewriteRule ^/school$ /school/

ProxyPreserveHost On  #This maybe is not needed if you use IPs
ProxyRequests Off
ProxyPass /school/ http://11.11.1.1/school/
ProxyPassReverse /school/ http://11.11.1.1/school/
If it still doesn't work, I'm afraid I cannot do anything else.
Perhaps you should contact the developer or the admin of the app in the backend server and ask for assistance

Regards

Last edited by bathory; 08-05-2011 at 07:25 AM.
 
Old 08-08-2011, 02:39 AM   #19
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Hello

Quote:
RewriteEngine On
RewriteRule ^/school$ /school/

ProxyPreserveHost On #This maybe is not needed if you use IPs
ProxyRequests Off
ProxyPass /school/ http://11.11.1.1/school/
ProxyPassReverse /school/ http://11.11.1.1/school/
That's works.

But I don't won't to use this url because this url (http://11.11.1.1/school/) bring me to admin login and all administration, I wont that users only see and work
with http://11.11.1.1/school/f?p=2. But here is the problem with ?

I search forum and I haven't found solution.

Thanks for your time and I hope that you have some new ideas

Last edited by sameone; 08-08-2011 at 02:44 AM.
 
Old 08-08-2011, 04:34 AM   #20
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Quote:
That's works.
If rev. proxy works, then http://192.1.0.1/school/f?p=2 should also work (you'll be redirected to the correct http://11.11.1.1/school/f?p=2)
If you don't want users to visit the /school/ URI then try the following rewrite instead the old one
Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/school/$
RewriteRule (.*) /school/f?p=2 [R]

Last edited by bathory; 08-08-2011 at 04:35 AM.
 
Old 08-08-2011, 07:21 AM   #21
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Is this OK ?

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/school/$
RewriteRule (.*) /school/f?p=2 [R]
ProxyPass /school/ http://11.11.1.1/school/
ProxyPassReverse /school/ http://11.11.1.1/school/
 
Old 08-08-2011, 08:16 AM   #22
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Quote:
Is this OK ?
Did you try it? You should try it and see if it works the way you want...
 
Old 08-09-2011, 12:40 AM   #23
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/school/$
RewriteRule (.*) /school/f?p=2 [R]
ProxyPass /school/ http://11.11.1.1/school/
ProxyPassReverse /school/ http://11.11.1.1/school/
Yes this works. But this URL (http://11.11.1.1/school/) bring me to admin login and all administration. I most come to http://11.11.1.1/school/f?p=2


when I change this
ProxyPass /school/ http://11.11.1.1/school/
ProxyPassReverse /school/ http://11.11.1.1/school/

to this
ProxyPass /school/ http://11.11.1.1/school/f?p=2
ProxyPassReverse /school/ http://11.11.1.1/school/f?p=2

I become the same error "Request URL is not allowed"
 
Old 08-09-2011, 03:09 AM   #24
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Quote:
Yes this works. But this URL (http://11.11.1.1/school/) bring me to admin login and all administration. I most come to http://11.11.1.1/school/f?p=2
This is what the rewrite in apache is supposed to do: rewrites /school/ to /school/f?p=2 so the request to the reverse proxy is correct.
Anyway as a last attempt, try the following:
Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/school(.*)$
RewriteCond %{REQUEST_URI} !^/school/f$
RewriteRule (.*) /school/f?p=2 [R]

ProxyRequests Off
ProxyPass /school/ http://11.11.1.1/school/
ProxyPassReverse /school/ http://11.11.1.1/school/
If it doesn't do what you want, I'm afraid I cannot be of more help

Regards
 
Old 08-09-2011, 04:29 AM   #25
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Yes this works. But this bring me to admin login and all administration. (like previously)

It posible that my rewrite isn't working. How can I test that ?

Thanks
 
Old 08-09-2011, 04:54 AM   #26
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
To see if rewrite works comment out the previous rewrite and proxy stuff and use just:
Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/school/$
RewriteRule (.*) /index.html [R]
This way http://192.1.0.1/school will be rewritten to http://192.1.0.1/index.html
You can also enable rewrite logging adding:
Code:
RewriteLogLevel 9
RewriteLog rewrite_log
 
Old 08-09-2011, 04:56 AM   #27
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Now I think I know where is the problem.

On my proxy server I have enabled https.


Now I enable http and tray again. End it's work, almost.
Now when I write url on my private computer http://11.11.1.1/school/ I go to desired page. But it looks like something is wrong. Why ? Because I can not login to interface, It looks like its not responding (example: when I click button Login nothing happend).


Problem 1: http works, https don't works
Problem 2: Problem with login interface (http) - not responding
 
Old 08-09-2011, 05:32 AM   #28
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
That are the logs:

LogLevel debug
ErrorLog /var/log/proxy/proxyssl_error_log
CustomLog /var/log/proxy/proxyssl_access_log combined

RewriteLogLevel 9
RewriteLog /var/log/proxy/rewrite_log



proxyssl_error_log
.........
...........
[Tue Aug 09 12:16:59 2011] [debug] proxy_util.c(2201): proxy: connected /apex/f?p=220:1 to 192.1.1.1:88
[Tue Aug 09 12:16:59 2011] [debug] proxy_util.c(2356): proxy: HTTP: fam 2 socket created to connect to 192.1.1.1
[Tue Aug 09 12:16:59 2011] [debug] proxy_util.c(2468): proxy: HTTP: connection complete to 192.1.1.1:88 (192.1.1.1)
[Tue Aug 09 12:16:59 2011] [error] [client 192.1.1.1] File does not exist: /srv/www/htdocs/i, referer: http://11.11.1.1/school/f?p=220:1
[Tue Aug 09 12:16:59 2011] [error] [client 192.1.1.1] File does not exist: /srv/www/htdocs/i, referer: http://11.11.1.1/school/f?p=220:1


proxyssl_access_log combined
.......
.......
192.1.1.1 - - [09/Aug/2011:12:16:59 +0200] "GET /i/themes/theme_2/bottom_bar-0-1.png HTTP/1.1" 404 1170 "http://11.11.1.1/school/f?p=220:1" "Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0"
192.1.1.1 - - [09/Aug/2011:12:16:59 +0200] "GET /i/themes/theme_2/bottom_bar-0-3.png HTTP/1.1" 404 1170 "http://11.11.1.1/school/f?p=220:1" "Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0"
192.1.1.1 - - [09/Aug/2011:12:16:59 +0200] "GET /apex/f?p=220:1 HTTP/1.1" 200 7002 "http://11.11.1.1/school/f?p=220:1" "Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0"


rewrite_log

192.1.1.1- firewall 11.11.1.1. - dmz
........
........
192.1.1.1 - - [09/Aug/2011:12:16:59 +0200] [11.11.1.1/sid#7fcbe33a3850][rid#7fcbe36d3958/subreq] (2) init rewrite engine with requested uri /error/include/bottom.html
192.1.1.1 - - [09/Aug/2011:12:16:59 +0200] [11.11.1.1/sid#7fcbe33a3850][rid#7fcbe36d3958/subreq] (1) pass through /error/include/bottom.html
192.1.1.1 - - [09/Aug/2011:12:16:59 +0200] [11.11.1.1/sid#7fcbe33a3850][rid#7fcbe36d1948/subreq] (2) init rewrite engine with requested uri /error/contact.html.var
192.1.1.1 - - [09/Aug/2011:12:16:59 +0200] [11.11.1.1/sid#7fcbe33a3850][rid#7fcbe36d1948/subreq] (1) pass through /error/contact.html.var
 
Old 08-09-2011, 05:32 AM   #29
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,937

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Quote:
Problem 1: http works, https don't works
If you want https to work change http to https in the proxy directives above, or use another rewrite to turn http to https
Quote:
Problem 2: Problem with login interface (http) - not responding
You should ask the developer of that application.

Regards
 
Old 09-01-2011, 02:24 AM   #30
sameone
LQ Newbie
 
Registered: Jul 2011
Posts: 23

Original Poster
Rep: Reputation: Disabled
Hello

I am back again.

My proxy: 192.0.0.0 (DMZ)

My httpd.conf

AddDefaultCharset utf-8

RewriteEngine On

Options +FollowSymlinks


RewriteCond %{HTTP} ^on$

RewriteCond %{REQUEST_URI} ^/123/(.*)$

RewriteCond %{REQUEST_URI} !^/123/f$

RewriteRule (.*) /123/f?p=100:1 [R]



ProxyRequests Off

ProxyPass /123/ http://192.0.1.1:88/ap/

ProxyPassReverse /123/ http://192.0.1.1:88/ap/

RewriteRule ^/123/(.*) http://192.0.1.1:88/ap/ [L,R]


And now where is my problem

When I write URL - proxy - http://192.0.0.0/123/ I become http://192.0.1.1:88/ap/ (my administrator console)

But I wont this URL -> http://192.0.1.1:88/ap/f?p=100:1

It looks that my rewrite rule does not work ??


Thanks in advance
 
  


Reply

Tags
apache, proxy


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 proxy with rewrite problem xiutuo Linux - Server 3 12-01-2010 05:56 AM
[SOLVED] Apache Reverse Proxy - problem with configuration dlugasx Linux - Server 4 10-04-2010 06:44 AM
Should I be using apache proxy services to solve a real problem Loboexe Linux - Newbie 2 01-28-2009 09:25 AM
Can't figure out Apache VirtualHosts + Tomcat + ReverseProxy + RewriteRules rave8151 Linux - Server 3 07-16-2008 11:15 AM
Help! Apache Reverseproxy & cache server maheshk78 Linux - General 0 11-16-2006 01:26 AM


All times are GMT -5. The time now is 10:31 AM.

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