My domain is: boosterclubnetwork.com madisonboosters.com
My web server is (include version): Apache2
The operating system my web server runs on is (include version): Ubuntu 18.04
My hosting provider, if applicable, is: Linode VPS
I can login to a root shell on my machine (yes or no, or I don’t know): Yes
I’m using a control panel to manage my site (no, or provide the name and version of the control panel): No
I want to run multisite on a Ubuntu VPS using LAMP. I want to support subsite domains as well as custom URLs. I am using letsencrypt.
I couldn’t figure out my virtualhost file, so I let my friend take a swing at it, now it’s jacked up even worse.
I am having 2 problems.
-
The url boosterclubnetwork.com (or www.boosterclubnetwork.com) loads a completely different site on the same server.
-
I get a certificate domain mismatch (this seems to be obviously related to the fact that the wrong site is loading).
<VirtualHost *:80>
# 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 www.boosterclubnetwork.com
ServerAlias boosterclubnetwork.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/boosterclubnetwork.com/public_html
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
# 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 "a2disconf".
#Include conf-available/serve-cgi-bin.conf
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.boosterclubnetwork.com [OR]
RewriteCond %{SERVER_NAME} =boosterclubnetwork.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
<VirtualHost *:80>
DocumentRoot /var/www/html/boosterclubnetwork.com/public_html
ServerName www.madisonboosters.com
ServerAlias madisonboosters.com
# not required Alias /mysite-2.dev "/home/mysite-2"
<Directory /var/www/html/boosterclubnetwork.com/public_html>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.madisonboosters.com [OR]
RewriteCond %{SERVER_NAME} =madisonboosters.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]