LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 05-29-2008, 11:28 PM   #16
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35

I am sorry to say (mydnight) that what you are attempting is not ever going to work using these tools.

The problem is that you have a single IP address visible to the rest of the world, and attempts to connect either to www.myserver.com or to mail.myserver.com will both turn into a TCP connection on xxx.yyy.zzz.foo:80. Then, your httpd accepts the connection, reads the Header info from it, and matches the server named in the header to one of your <VirtualHost> containers. So far, everything is fine.

However, when you attempt a permanent redirect to 192.168.0.2, the jig is up. A redirect header is sent back to the browser, who attempts to contact the given address. That address, however, is not permitted on the public Internet. Any public router worth its salt will unceremoniously drop any packet addressed to a Private Networking address, disrupting your attempted redirect.

The simplest way to make this work is to buy a second IP address, and arrange for mail.myserver.com to resolve to the second address. Then you can use iptables to translate the second external IP into the internal address of your Zimbra box. This might not, however, be the cheapest, since you will have to pay your ISP for a second address.
 
Old 05-31-2008, 12:47 AM   #17
martinyeh
LQ Newbie
 
Registered: Apr 2008
Location: USA
Distribution: Debian Etch & Gentoo
Posts: 14

Original Poster
Rep: Reputation: 0
Sorry about your problem, mydnight. I solved my problem by backup my data and reinstall. I didn't do anything different, at least to the best of my knowledge, and it didn't happen again. Now I have both regular http and https for SVN running on my box. I use DynDNS to point to my router and forward to my linux box. Everything is running fine for almost one month.

However, I still don't know what caused that problem.
Good luck.
 
Old 05-31-2008, 11:45 PM   #18
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
Unfortunately, the thing you are trying to do cannot be accomplished using the Redirect scheme. The problem with that is that the Apache server will send a Header: Redirect 192.168.0.2 to the requesting browser, which will then try to access a server at that address, fail, and return to the server it was originally trying to reach (your main server).

Have a look, though, at the Apache directive Reverse Proxy, whicb appears ideally suited to what you want done. It makes a proxy request on behalf of the original client, directed to a server that would otherwise be inaccessible to that client, and returns the result to that client when it arrives from the intended server.
 
Old 06-01-2008, 03:25 PM   #19
mydnight
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
Thanks -- I've got it fully functional now, using the reverse proxy directives
 
  


Reply



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
Apache2 VirtualHost Syntax OK but domain still doesn't work bg108 Linux - Server 11 04-18-2008 12:54 PM
Apache2 VirtualHost and SSL Alfar Linux - Server 2 10-20-2007 01:10 AM
Using VirtualHost with single IP in Apache2 gurl4sh25 Linux - Server 2 05-06-2007 09:32 AM
Apache2 virtualHost config problem jglazner Linux - Software 3 04-01-2004 02:22 AM
VirtualHost Question sigep739 Linux - Networking 1 12-22-2003 01:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:58 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration