title: Apache config mess up, shows main app on a subdomain
body: <p>Sorry, this may be really simple, I'm somewhat of a newbie.
  I had a main websites along with a blog subdomain up both with ssl certificates and http redirected to https. I added a mail server on a mail subdomain and tried running certbot to set up a certificate and set up a http to https redirect. But now both my mail subdomain along with my main domain shows my main app. Any help would be appreciated.</p>
  <p>my http apache config:</p>
  <pre><code>    &lt;VirtualHost *:80&gt;
      # The ServerName directive sets the request scheme, hostname and port that
      # the server uses to identify itself. This is used when creating
      # redirection URLs. In the context of virtual hosts, the ServerName
      # specifies what hostname must appear in the request's Host: header to
      # match this virtual host. For the default virtual host (this file) this
      # value is not decisive as it is used as a last resort host regardless.
      # However, you must set it for any further virtual host explicitly.
      ServerName armanpopat.co.uk
  
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html
  
      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
      # error, crit, alert, emerg.
      # It is also possible to configure the loglevel for particular
      # modules, e.g.
      #LogLevel info ssl:warn
  
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  
      # For most configuration files from conf-available/, which are
      # enabled or disabled at a global level, it is possible to
      # include a line for only one particular virtual host. For example the
      # following line enables the CGI configuration for this host only
      # after it has been globally disabled with &quot;a2disconf&quot;.
      #Include conf-available/serve-cgi-bin.conf
  
  RewriteEngine on
  RewriteCond %{SERVER_NAME} =armanpopat.co.uk
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  &lt;/VirtualHost&gt;
  
  
  
  &lt;VirtualHost *:80&gt;
      # The ServerName directive sets the request scheme, hostname and port that
      # the server uses to identify itself. This is used when creating
      # redirection URLs. In the context of virtual hosts, the ServerName
      # specifies what hostname must appear in the request's Host: header to
      # match this virtual host. For the default virtual host (this file) this
      # value is not decisive as it is used as a last resort host regardless.
      # However, you must set it for any further virtual host explicitly.
      ServerName  blog.armanpopat.co.uk
  
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html
  
      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
      # error, crit, alert, emerg.
      # It is also possible to configure the loglevel for particular
      # modules, e.g.
      #LogLevel info ssl:warn
  
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  
      # For most configuration files from conf-available/, which are
      # enabled or disabled at a global level, it is possible to
      # include a line for only one particular virtual host. For example the
      # following line enables the CGI configuration for this host only
      # after it has been globally disabled with &quot;a2disconf&quot;.
      #Include conf-available/serve-cgi-bin.conf
  
  RewriteEngine on
  RewriteCond %{SERVER_NAME} =blog.armanpopat.co.uk
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  &lt;/VirtualHost&gt;
  
  # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
  &lt;VirtualHost *:80&gt;
    ServerName mail.armanpopat.co.uk
    DocumentRoot /var/www/html/roundcubemail/roundcubemail-1.4.9/
  
    ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log
    CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined
  
    &lt;Directory /&gt;
      Options FollowSymLinks
      AllowOverride All
    &lt;/Directory&gt;
  
    &lt;Directory /var/www/html/roundcubemail/roundcubemail-1.4.9/&gt;
      Options FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      allow from all
    &lt;/Directory&gt;
  
  RewriteEngine on
  RewriteCond %{SERVER_NAME} =armanpopat.co.uk [OR]
  RewriteCond %{SERVER_NAME} =mail.armanpopat.co.uk
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
  &lt;/VirtualHost&gt;
  </code></pre>
  <p>https config:</p>
  <pre><code>&lt;IfModule mod_ssl.c&gt;
  &lt;VirtualHost *:443&gt;
      # The ServerName directive sets the request scheme, hostname and port that
      # the server uses to identify itself. This is used when creating
      # redirection URLs. In the context of virtual hosts, the ServerName
      # specifies what hostname must appear in the request's Host: header to
      # match this virtual host. For the default virtual host (this file) this
      # value is not decisive as it is used as a last resort host regardless.
      # However, you must set it for any further virtual host explicitly.
      ServerName armanpopat.co.uk
  
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html
  
      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
      # error, crit, alert, emerg.
      # It is also possible to configure the loglevel for particular
      # modules, e.g.
      #LogLevel info ssl:warn
  
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  
      # For most configuration files from conf-available/, which are
      # enabled or disabled at a global level, it is possible to
      # include a line for only one particular virtual host. For example the
      # following line enables the CGI configuration for this host only
      # after it has been globally disabled with &quot;a2disconf&quot;.
      #Include conf-available/serve-cgi-bin.conf
  
      Alias /static /home/arman/mysite/static
      &lt;Directory /home/arman/mysite/static&gt;
          Require all granted
      &lt;/Directory&gt;
  
      &lt;Directory /home/arman/mysite/mysite&gt;
          &lt;Files wsgi.py&gt;
              Require all granted
          &lt;/Files&gt;
      &lt;/Directory&gt;    
  
      WSGIScriptAlias / /home/arman/mysite/mysite/wsgi.py
      WSGIDaemonProcess mysite python-path=/home/arman/mysite python-home=/home/arman/mysite/VENV
      WSGIProcessGroup mysite
  
  
  
  
  Include /etc/letsencrypt/options-ssl-apache.conf
  ServerAlias mail.armanpopat.co.uk
  SSLCertificateFile /etc/letsencrypt/live/armanpopat.co.uk/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/armanpopat.co.uk/privkey.pem
  &lt;/VirtualHost&gt;
  &lt;/IfModule&gt;
  &lt;IfModule mod_ssl.c&gt;
  &lt;VirtualHost *:443&gt;
      # The ServerName directive sets the request scheme, hostname and port that
      # the server uses to identify itself. This is used when creating
      # redirection URLs. In the context of virtual hosts, the ServerName
      # specifies what hostname must appear in the request's Host: header to
      # match this virtual host. For the default virtual host (this file) this
      # value is not decisive as it is used as a last resort host regardless.
      # However, you must set it for any further virtual host explicitly.
      ServerName  blog.armanpopat.co.uk
  
      ServerAdmin webmaster@localhost
      DocumentRoot /var/www/html
  
      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
      # error, crit, alert, emerg.
      # It is also possible to configure the loglevel for particular
      # modules, e.g.
      #LogLevel info ssl:warn
  
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  
      # For most configuration files from conf-available/, which are
      # enabled or disabled at a global level, it is possible to
      # include a line for only one particular virtual host. For example the
      # following line enables the CGI configuration for this host only
      # after it has been globally disabled with &quot;a2disconf&quot;.
      #Include conf-available/serve-cgi-bin.conf
  
      Alias /static /home/arman/Test/static
      &lt;Directory /home/arman/Test/static&gt;
          Require all granted
      &lt;/Directory&gt;
  
      Alias /media /home/arman/Test/media
      &lt;Directory /home/arman/Test/media&gt;
              Require all granted
      &lt;/Directory&gt;
  
      &lt;Directory /home/arman/Test/Test&gt;
          &lt;Files wsgi.py&gt;
              Require all granted
          &lt;/Files&gt;
      &lt;/Directory&gt;    
  
      WSGIScriptAlias / /home/arman/Test/Test/wsgi.py
      WSGIDaemonProcess Test python-path=/home/arman/Test python-home=/home/arman/Test/VENV
      WSGIProcessGroup Test
  
  
  Include /etc/letsencrypt/options-ssl-apache.conf
  SSLCertificateFile /etc/letsencrypt/live/armanpopat.co.uk/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/armanpopat.co.uk/privkey.pem
  &lt;/VirtualHost&gt;
  &lt;/IfModule&gt;
  &lt;IfModule mod_ssl.c&gt;
  &lt;VirtualHost *:443&gt;
    ServerName mail.armanpopat.co.uk
    DocumentRoot /var/www/html/roundcubemail/roundcubemail-1.4.9/
  
    ErrorLog ${APACHE_LOG_DIR}/roundcube_error.log
    CustomLog ${APACHE_LOG_DIR}/roundcube_access.log combined
  
    &lt;Directory /&gt;
      Options FollowSymLinks
      AllowOverride All
    &lt;/Directory&gt;
  
    &lt;Directory /var/www/html/roundcubemail/roundcubemail-1.4.9/&gt;
      Options FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      allow from all
    &lt;/Directory&gt;
  
  Include /etc/letsencrypt/options-ssl-apache.conf
  SSLCertificateFile /etc/letsencrypt/live/armanpopat.co.uk/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/armanpopat.co.uk/privkey.pem
  
  &lt;/VirtualHost&gt;
  &lt;/IfModule&gt;
  </code></pre>