# Virtual Mailhosting HOWTO

## JoeG

Hi.  I've followed the Virtual Mailhosting HOWTO 

(found here http://www.gentoo.org/doc/en/virt-mail-howto.xml), and to my knowledge have set it up correctly.  However, I'm having some trouble understanding the MySQL tables and their use.  I'm not sure how to go about setting up:

1.  Apache documentroots for virtual domains

2.  User accounts for virtual domains

Anyone got this setup functioning  :Question: 

Any help greatly appreciated.  Not finding what I'm needing in the forums, and I'm on a deadline here.

Regards,

Joe

----------

## Chris W

 *JoeG wrote:*   

> I'm not sure how to go about setting up:
> 
> 1.  Apache documentroots for virtual domains

 

This has nothing to do with virtual mail handling.  Setting up Apache virtual hosting is covered in the 

Apache Virtual Host documentation (which should also be present on your system).  You probably want to look into /etc/apache2/conf/vhosts for the relevant config files.

 *Quote:*   

> 2.  User accounts for virtual domains  

 

Not exactly sure what you mean by this.  The Virtual mail hosting guide has all mail in virtual boxes owned by a single user, and it shows you how to create that user in local passwd files.  If you are using LDAP of somesuch for system tables then you might need to create the user/group in these services.  If you want to allocate each virtual user (postbox) a UID and GID then you need to set that in the "users" MySQL table entry for the postbox.

----------

## JoeG

But there must be a way to have Apache look at the database also.  I'll look into the config files as suggested.

----------

## Jaxom

What part isn't functioning for you?  I have the virtual mail guide setup and working perfectly (after a few arguements with the system anyway).

If it's not working exactly the way they show it, you're probably missing a step here or there.  I have both squirrelmail and horde installed although horde isn't working 100% correctly yet, but squirrel is working without a hitch.

if it's phpmyadmin that's not reading the database correctly, then you've got something setup incorrectly in your config.inc.php

----------

## JoeG

The database and phpmyadmin as well as postfix and squirrelmail are working fine.  I'm just not sure about how to get Apache to read the same database tables and use those as information concerning virtual domains.  I'm sure that I'm just not configuring Apache properly and not quite understanding the database.

  These are my shortcoming, not the Virtual Mailhosting Guide's authors.  It's a very well written document.  Their setup of Apache was in using SSL and allowing PHP code.  I don't think they meant it as a guide to setting up virtual webservers, but I just bet that with a little tweaking, that can be done as well.

Again, thx for the pointers.

Joe

----------

## Chris W

Depending on exactly what you want you could use dynamic virtual hosting in one of the forms from Dynamically configured mass virtual hosting

----------

## JoeG

Thanks, Chris.  This may be just the ticket!

----------

