PastorDwayne
asked on
Apache2 Name Virtual host
Good-day;
I have an Apache2 web server on Debian.
I have two sites pointing to the same ip: www.mycompany.com and email.mycompany.com...
The email.mycomany.com is the webmail and runs using SSL certs.
My question is, how do I configure these Virtual hosts so that when I type email.mycompany.com into my browser it opens the secure webmail, but if I type www.mycompany.org it direct me to the default web page.
Thanks for your time
I have an Apache2 web server on Debian.
I have two sites pointing to the same ip: www.mycompany.com and email.mycompany.com...
The email.mycomany.com is the webmail and runs using SSL certs.
My question is, how do I configure these Virtual hosts so that when I type email.mycompany.com into my browser it opens the secure webmail, but if I type www.mycompany.org it direct me to the default web page.
Thanks for your time
apache does support NameBasedVirtualHost that is you can have more that one websites for an IP I hope you already knew that. The default www.mycompany.com can be configured without any issues right. for the second mail.mycompany.com put a php file or some thing that will redirect the request to https://mail.mycompany.com. You can also use apache's mod_rewrite to achive this but using php will be easier.
--
Cheers,
Sivam
www.emmeskay.com
--
Cheers,
Sivam
www.emmeskay.com
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
In DNS, point www.mycompany.com to your web server's IP. On that site provide a http://www.mycompany.org/webmail page that redirects the user to https://your_webmail_virtual_host. If you're running your secure webmail site on a non-standard port, say port 8088, your redirect would be to http://your_webmail_virtual_host:8088.