Solved

Linux RH 9 with QMail, Imap, Imaps and Squirrelmail and multiple Virtual domains.

Posted on 2004-04-03
4
656 Views
Last Modified: 2013-12-16
Hello I have a linuxbox set up with RH 9 and the Qmail install from qmailrocks.org. Qmail is running great with 3 virtual domains running on it I need to host multiple virtual webmail domains also. I have a virtual host set up in the apache conf file called domain1.com pointing to /var/www/html/webmail. Webmail is the squirrelmail directory renamed. when I go to https://mail.domain1.com/webmail, bam it opens squirrelmail and life is good, but when I add another virtual host to my apache conf file and restart apache I get:

 Stopping httpd:                                            [  OK  ]
Starting httpd: [Sat Apr 03 19:48:13 2004] [warn] VirtualHost 1.2.3.4:80 overlaps with VirtualHost 1.2.3.4:80, the first has precedence, perhaps you need a NameVirtualHost directive

What can I do about this?

I can't get to my second virtual domain eg https://mail.domain2.com/webmail. It cant find server

Here is what my apache conf file looks like


<VirtualHost 1.2.3.4:80>
ServerName domain1.com.
ServerAlias mail.*
ServerAdmin jeff@domain1.com
DocumentRoot /var/www/html/webmail
</VirtualHost>

<VirtualHost 1.2.3.4:80>
Servername domain2.com
ServerAlias mail.*
ServerAdmin admin@domain2.com
DocumentRoot /var/www/html/webmail
</VirtualHost>
0
Comment
Question by:bstearns
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Alf666
ID: 10752324
You need to do something like :

NameVirtualHost *

<VirtualHost *>
ServerName domain1.com.
ServerAlias mail.domaine1.com.
ServerAdmin jeff@domain1.com
DocumentRoot /var/www/html/webmail
</VirtualHost>

<VirtualHost *>
Servername domain2.com
ServerAlias mail.domain2.com
ServerAdmin admin@domain2.com
DocumentRoot /var/www/html/webmail
</VirtualHost>


But, be careful. This works only for http. HTTPS can not do this.

You can not have 2 https servers on only one IP addr. The reason for this is that name based virtual hosting is inherent to the HTTP protocol. In fact, the header passed is moething like :

GET / HTTP1.0
host: www.domain.com

This is what instructs the server to give back the pages for one host or the other.

But in HTTPS, before the HTTP protocol kicks in, the server's certificate is sent. And it contains the name of the host. So browsers won't accept connections for host names not corresponding to the certicate's.

If you want to have multiple servers, you'll have to do something like :

http://myserver.domain.com/server1

And alias that properly.

0
 

Author Comment

by:bstearns
ID: 10754465
Thank you for the knowledge.
So what your saying is either set up ip based virtual hosting or set it up like your example: http://myserver.domain.com/server1. Can you give me some pointers for setting it up like your example please. What would be the first step?
0
 
LVL 9

Accepted Solution

by:
Alf666 earned 500 total points
ID: 10755544
Not exactly. If you want to do HTTP, then, name based virtual hosting is perfect.
If you want HTTPS on more than one server, then, you'll need IP based virtual hosting or, you can only serve one server name (and have whatever you want under it).

So, if you do not *absolutely* need https, then, I suggest you stick to the config I gave you.
If you want more, just be precise about what, and I'll try and explain.



0
 

Author Comment

by:bstearns
ID: 10757572
I think I have it figured out. I can go to my main domain name eg: https://mail.domain1.com/webmail and put my mail.domain2.com user name and password in and get the mail from that account. Not sure why, I'm going to figure it out though. Thank you for your persistant help.
Jeff
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now