By Coolmike
I have successfully installed and setup postfix. I would like to add webmail to the server. If the site domain is example.com, and the main site directory (served by Apache2) is /var/www/html, I wish to add webmail to the site, but it cannot be in the /var/www/html directory. For example, I would like the webmail folder to be located in /var/www/webmail.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi, The idea is to set up an extra virtual host for webmail site in your Apache configuration. You might create a subdomain, e.g. webmail.example.com, pointing at droplet’s IP, and configure Apache virtual host for that subdomain, entering document root directory (site directory) different to the directory of your main domain (example.com). So, main part of webmail virtual host configuration would look like:
<VirtualHost *:80>
ServerName webmail.example.com
DocumentRoot /var/www/webmail
...
</VirtualHost>
Here is the tutorial on that subject (especially step 5): https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-18-04#step-5-—-setting-up-virtual-hosts-(recommended)
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.