| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-18-2011, 08:06 AM
|
#1
|
|
Member
Registered: Sep 2010
Posts: 38
Rep:
|
Apache - redirect to internal server
Hi
I have a web server running Apache. Here I have a website with some personal, useful stuff like ruTorrent, system information, webmin, Motion etc
Some time ago I installed Op5 on a different machine. Op5 has it's own web interface and database.
I want to be able to access this web interface through a <a href> link on my usual website. Maybe like a location in httpd.conf where mywebsite.com/op5 will put me through to the Op5 machine.
Both servers are behind a router and I still want to use standard ports.
Is there a way to solve this?
CentOS is running on both machines btw
edit:
Ofc, the best would be if it still looks like the user is on mywebsite.com/op5 in the adress field
Last edited by ScorchPipe; 12-18-2011 at 08:09 AM.
|
|
|
|
12-18-2011, 09:29 AM
|
#2
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,357
|
Hi,
You can use apache as a reverse proxy:
Code:
ProxyRequests Off
ProxyPass /op5 http://x.x.x.x
ProxyPassReverse /op5 http://x.x.x.x
where x.x.x.x is the internal IP of your box running that Op5
Regards
|
|
|
|
12-18-2011, 11:23 AM
|
#3
|
|
Member
Registered: Sep 2010
Posts: 38
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
Hi,
You can use apache as a reverse proxy:
Code:
ProxyRequests Off
ProxyPass /op5 http://x.x.x.x
ProxyPassReverse /op5 http://x.x.x.x
where x.x.x.x is the internal IP of your box running that Op5
Regards
|
Hi and thanks for your response.
I added this to httpd.conf and restarted httpd. Now it works when I'm on my LAN, but not from the outside.
Gets "connection has timed out" because it's trying to contact my internal IP
|
|
|
|
12-18-2011, 11:41 AM
|
#4
|
|
Member
Registered: Dec 2004
Distribution: Slackware, Arch, FreeBSD
Posts: 201
Rep:
|
What does the link inside <A HREF=""> look like? It should be referencing the public server, not the internal host behind the proxy.
|
|
|
|
12-18-2011, 12:59 PM
|
#5
|
|
Member
Registered: Sep 2010
Posts: 38
Original Poster
Rep:
|
Quote:
Originally Posted by bmarx
What does the link inside <A HREF=""> look like? It should be referencing the public server, not the internal host behind the proxy.
|
It doesn't exists yet. I just went to mywebsite.com/op5 to test bathory's method
|
|
|
|
12-18-2011, 03:23 PM
|
#6
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,357
|
Quote:
Now it works when I'm on my LAN, but not from the outside.
Gets "connection has timed out" because it's trying to contact my internal IP
|
Doesn't make sense. If the frontend apache can connect to the backend webserver with its internal IP, it should work the same either from LAN and from the internet.
|
|
|
|
12-18-2011, 03:36 PM
|
#7
|
|
Member
Registered: Sep 2010
Posts: 38
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
Doesn't make sense. If the frontend apache can connect to the backend webserver with its internal IP, it should work the same either from LAN and from the internet.
|
The connection between them is just fine. Also tried without any firewalls running.
Same problem:
"The connection has timed out
The server at 192.168.0.198 is taking too long to respond."
|
|
|
|
12-18-2011, 04:23 PM
|
#8
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,357
|
Quote:
"The connection has timed out
The server at 192.168.0.198 is taking too long to respond."
|
I don't know what to tell
If the frontend can connect to the backend (I guess it's 192.168.0.198), then there should be no problem. Maybe your router is doing something nasty.
Anyway you can add the following before the other proxy directives, to see if they help
Code:
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost On
ProxyTimeout 300
...
|
|
|
|
12-18-2011, 04:57 PM
|
#9
|
|
Member
Registered: Sep 2010
Posts: 38
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
I don't know what to tell
If the frontend can connect to the backend (I guess it's 192.168.0.198), then there should be no problem. Maybe your router is doing something nasty.
Anyway you can add the following before the other proxy directives, to see if they help
Code:
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPreserveHost On
ProxyTimeout 300
...
|
Tried it. Now it says
"The server at mywebsite.com is taking too long to respond"
from both inside and outside.
I will look into the router, but I don't think I will find anything there
Thanks for your help anyway
|
|
|
|
12-19-2011, 02:08 AM
|
#10
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,357
|
Quote:
Tried it. Now it says
"The server at mywebsite.com is taking too long to respond"
from both inside and outside.
|
I guess it's the timeout that is too big and your browser times out first.
I can't think of anything else about the initial problem. If the reverse proxy works through your LAN, it should work from the outside too.
It's maybe your router, or the backend application (op5) needs some special settings to work behind a reverse proxy
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:23 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|