Question
Setting up a mail server on Ubuntu 18.04?
Hi person! :-)
I’ve been going through a lot of DO’s forums, OS forums, and server forums, so I’m listing everything here which may address many of the recommendations I’ve come across.
What I’m attempting: personalized family accounts - personal Wordpress websites available through /var/www/html, personal Rainloop e-mail through /var/www/rainloop, personal Filerun storage through /var/www/filerun. Oh, and some server games so we can play each other online through the server, but that’s not important here.
If you see server setup problems or file problems you would change - even if you’re unsure what’s going on with the domain - I’m happy to accept critiques on that, as well.
The current setup:
Ubuntu PhpMyAdmin on 18.04 droplet
- phpMyAdmin installed and properly accessible via https://mydomain.tld/phpmyadmin
- MySQL installed
- Apache2 installed
- Wordpress installed at /var/www/html and working properly at https://mydomain.tld
- Rainloop installed at /var/www/rainloop but not working
- LetsEncrypt SSL certificate
What I’m currently working on is the e-mail.
My goal is to reach the webmail at https://email.mydomain.tld
- http://email.mydomain.tld just redirects to https://mydomain.tld
- With SSL it says, “This site can’t be reached”
- http://webmail.mydomain.tld breaks as if the domain doesn’t exist.
- With SSL it says, “The site can’t be reached”
(Rainloop’s website uses “webmail.mydomain.tld” for installation. Even if I can just get it installed, I’m still fine with using https://webmail.mydomain.tld, instead of “email”.)
Current DNS record setup:
Type | Hostname | Value | Priority | TTL (seconds)
MX records, added several priorities because I can’t figure it out
MX | webmail.mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 0 | 14400
MX | webmail.mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 1 | 14400
MX | webmail.mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 5 | 14400
MX | webmail.mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 10 | 14400
MX | mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 0 | 14400
MX | mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 1 | 14400
MX | mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 5 | 14400
MX | mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 10 | 14400
MX | email.mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 0 | 14400
MX | email.mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 1 | 14400
MX | email.mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 5 | 14400
MX | email.mydomain.tld | mail handled by DO.HOST.IP.ADDRESS | 10 | 14400
(Once I can get it properly set up, I intend to start removing these one by one, to figure out which ones I need to keep.)
Wordpress installation, working properly
CNAME | wordpress.mydomain.tld | is an alias of mydomain.tld. | 43200
For future storage installation (not there yet)
CNAME | mydrive.domain.tld | is an alias of mydomain.tld. | 43200
Linking domain to host IP
A | mydomain.tld | directs to DO.HOST.IP.ADDRESS | 3600
To fix “www”
CNAME | www.mydomain.tld | is an alias of mydomain.tld. | 43200
Nameservers
NS | mydomain.tld | directs to ns1.digitalocean.com. | 1800
NS | mydomain.tld | directs to ns2.digitalocean.com. | 1800
NS | mydomain.tld | directs to ns3.digitalocean.com. | 1800
Current .htaccess and .conf Setups:
/var/www/.htaccess
Options -Indexes
/var/www/html/.htaccess
<Directory /var/www/>
AllowOverride All
</Directory>
RewriteCond %{HTTP_HOST} ^([^.]+).mail.mydomain.tld$
RewriteRule ^/(.*)$ http://mail.mydomain.tld/%1/$1 [L,R]
Options -Indexes
DirectoryIndex index.php index.html /example.php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUESTFILENAME} !-f
RewriteCond %{REQUESTFILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
/var/www/rainloop/.htaccess
None yet, intend to edit once I’ve gotten it set up.
/etc/apache2/apache2.conf
ServerName mydomain.tld
rainloop.conf (VirtualHost *:80) and rainloop-le-ssl.conf (VirtualHost *:443)
Both list the correct domain (ServerName email.mydomain.tld) and point to the correct folder (DocumentRoot /var/www/rainloop).
rainloop.conf
<VirtualHost *:80>
ServerName email.mydomain.tld
DocumentRoot “/var/www/rainloop/”
ServerAdmin my@email.address
ErrorLog “/var/log/apache2/rainlooperrorlog” (word just got italicized in this post because of underscores)
TransferLog “/var/log/apache2/rainloopaccesslog”
<Directory />
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Order deny,allow
Allow from all
Require all granted
</Directory>
rainloop-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName email.mydomain.tld
DocumentRoot “/var/www/rainloop/”
ServerAdmin my@email.address
ErrorLog “/var/log/apache2/rainlooperrorlog”
TransferLog “/var/log/apache2/rainloopaccesslog”
<Directory />
Options +Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Order deny,allow
Allow from all
Require all granted
</Directory>
SSLCertificateFile /etc/letsencrypt/live/email.mydomain.tld/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/email.mydomain.tld/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
</VirtualHost>
/etc/apache2/wordpress.conf
<Directory /var/www/>
Options FollowSymLinks
</Directory>
If you see server setup problems or file problems you would change - even if you’re unsure what’s going on with the domain - I’m happy to accept critiques on that, as well.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×