LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-14-2005, 09:27 AM   #1
msound
Member
 
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465

Rep: Reputation: 30
apache virtual hosting


Here's the seutp. I have two machines:
192.168.X.100 web server
192.168.X.101 email server

The machines are behind a proxy that forwards port 80 traffic to 192.168.X.100 and 110, 143 traffic to 192.168X.101. Makes sense right?

But now I want to setup a webmailer. The problem is webmail.mydomain.com would come in over port 80 and automatically get forwarded to 192.168.X.100.

How do I set it up so webmail.mydomain.com goes to my e-mail server at 192.168.X.101, while the rest of the port 80 traffic goes to my web server?

Thanks.
 
Old 09-14-2005, 10:23 AM   #2
R4z0r
Member
 
Registered: Jan 2002
Distribution: CentOS 3.1
Posts: 119

Rep: Reputation: 15
How many real-IP's have you got on your proxy server? If you want two distinct servers listening on the same port, you need two IP's.

Alternatively, you could put the webmail software on the webserver and set it up as a VirtualHost and then just configure the webmail software to connect to the mail servers local IP.
 
Old 09-14-2005, 04:45 PM   #3
msound
Member
 
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465

Original Poster
Rep: Reputation: 30
Thanks for the reply.
In case anyone else ever wants a setup like this, here's what I did to get it working:

The email server's apache now listens on port 8080.

webmail.mydomain.com on my web server now redirects traffic to webmail.mydomain.com:8080. I just used javascript in the webmail.mydomain.com's index page to redirect traffic, but it could've been done in the httpd.conf file.

The proxy server has been configured to direct port 8080 traffic to 192.168.X.101 instead of .100.

I don't know why I didn't just think of that before.
 
Old 09-14-2005, 06:09 PM   #4
Imanerd
Member
 
Registered: Dec 2004
Location: Bay Area, California
Distribution: Fedora Core 3
Posts: 65

Rep: Reputation: 15
Quote:
Originally posted by R4z0r
Alternatively, you could put the webmail software on the webserver and set it up as a VirtualHost and then just configure the webmail software to connect to the mail servers local IP.
I have basically the same setup as msound and that's what I did. Squirrelmail runs on my webserver and retrieves the mail from my mailserver via local (NATed) IP address. It works seamlessly and flawlessly.

If you had a separate public IP for your two servers, you could also set up DNS so that webmail.yourdomain.com resolves to your mailserver's IP address, but it sounds like you only have one IP address, correct?
 
  


Reply


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 Virtual Hosting abhijeetudas Linux - Networking 2 05-29-2005 04:26 AM
Apache 2.x Virtual Hosting vbfischer Linux - Software 3 04-21-2005 05:17 PM
Virtual Hosting with apache, i think... dengi Linux - Software 1 10-26-2003 09:43 PM
Help with Apache virtual hosting fin Linux - Newbie 1 04-30-2002 10:50 AM
Apache Virtual Hosting kmac Linux - General 2 04-12-2001 10:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:19 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