howto: webmail.domain.com

bvvelzen

Verified User
Joined
Oct 30, 2003
Messages
82
Location
Netherlands
What is the best way to make it standard
in DA for every domain to get when you typ
webmail.domain.com to go to the squirrelmail?

I can't see a easy way to enter it into the dns admin?
 
Hello,

I *think* (untested).. you could create one virtualhost in your main /etc/httpd/conf/httpd.conf (after the ips.conf and before the includes) that looks something like:
Code:
<VirtualHost *>
        ServerName webmail.*
        DocumentRoot /var/www/html/webmail
        <Directory /var/www/html/webmail>
                php_flag engine on
                php_admin_value safe_mode 0
        </Directory>
</VirtualHost>
In theory, that should work.. You'd just need to make sure the webmail A record is added to the dns entry upon domain creation.

John
 
I tried it, but it has no result,

No, it give's result: Apache is functioning normally
but that's not the result we wanted.


In theory, that should work.. You'd just need to make sure the webmail A record is added to the dns entry upon domain creation.

Is this possible, I hoped it could? Isn't there a template for?
 
WARNING:
This code is from a Plesk server using horde for webmail.

It WILL NOT WORK unchanged on a DA server.

I post it here only in case some guru wants to try to understand it and modify it to work with DA and either squirellmail or UebiMiau.
Code:
<VirtualHost 65.65.65.65:80>
        DocumentRoot /home/httpd/vhosts/webmail
        ServerName webmail
        ServerAlias webmail.*
        UseCanonicalName Off
        <Directory /home/httpd/vhosts/webmail/horde>
                <IfModule mod_php4.c>
                        php_admin_flag engine on
                        php_admin_flag magic_quotes_gpc off
                        php_admin_value safe_mode off
                        php_admin_value open_basedir "/home/httpd/vhosts/webmail:/etc/psa:/tmp"
                        php_admin_value include_path "/home/httpd/vhosts/webmail/horde/lib:/home/httpd/vhosts/webmail/horde/pear:."
                </IfModule>
        </Directory>
</VirtualHost>

Jeff
 
Well I'm glad my Plesk Gold Partner relationship helped at least one person :) .

Jeff
 
After putting this into my httpd.conf, setting up a subdomain webmail under a domain, gives me the login screen for squirrelmail when pointing my browser to webmail.domain.com.

However, the login doesn't work, because webmail.domain.com is still in my browser, so the links get messed up.

If anyone else has this problem, I think you'll be better off solving the problem by putting a /webmail/ directory into your /default/ directory, and include an index.php file with a php header that automatically forwards to the correct path (domain.com/squirrelmail).

...unless of course someone has managed to work around this with httpd.conf...
 
Hey,

Here something that seems to work that only requires a couple of minor mods to the default Virtualhost in the httpd.conf file.

In the main httpd.conf file where the default Virtualhost is defined, looks similar to this:

<VirtualHost your_server_IP_here:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ServerName localhost
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
</VirtualHost>

Change it to this:

<VirtualHost 216.146.28.236:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/squirrelmail
ServerName localhost
ServerAlias webmail.*
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
</VirtualHost>

Basically, you are changing the DocumentRoot to point to squirrelmail and then adding a ServerAlias.

I don't know if it breaks anything with DA but, it seems to work OK.

Also, don't forget to make a DNS entry for each domain you want to point to webmail.domain.com.

You should be able to change the /squirrelmail to /webmail and to use UebiMiau.

As always, backup your httpd.conf before changing anything.

David

BTW, not sure how this acts on domains not on the main server IP. Didn't try that...
 
Last edited:
Back
Top