I have a subdomain that has an SSL certificate that is working nicely. The web address for it is, lets say, like this:
sd1.mydomain.com (sd1=sub-domain 1). Now I want to add a second subdomain, but it doesn't need to have the certificate encrypting the data. Thus, I want:
I adjusted my
sites-enabled directory to have two config files, one for each subdomain. The config file for the first, and working, subdomain looks like this (changing actual domain, to "mydomain", obviously):
<VirtualHost *:443> SSLEngine on SSLProtocol all SSLCertificateFile /usr/local/ssl/crt/certificate.crt SSLCertificateKeyFile /usr/local/ssl/crt/sd1.mydomain.com SSLCertificateChainFile /usr/local/ssl/crt/intermediate.crt ServerAdmin firstname.lastname@example.org ServerName https://sd1.mydomain.com AliasMatch ^/([^/]*\.css) /srv/www/cpm/static_media/css/$1 Alias /static_media/ /srv/www/cpm/static_media/ Alias /static/admin/ /usr/local/lib/python2.6/dist-packages/django/contrib/admin/media/ Alias /favicon.ico "/srv/www/cpm/static_media/img/favicon.ico" <Directory /srv/www/cpm/static_media/> Options -Indexes Order deny,allow Allow from all deny from 22.214.171.124/8 </Directory> WSGIScriptAlias / /srv/www/cpm/django.wsgi <Directory /srv/www/cpm> Options -Indexes Order deny,allow Allow from all deny from 126.96.36.199/8 </Directory> ErrorLog /srv/www/logs/cpm_logs/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /srv/www/logs/cpm_logs/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
This site runs a Django webapp that needs to be secure, and it works nicely.
Now I want to set up a second website, a WIKI actually, that does NOT need to be secure, and so I created this config file for
<VirtualHost *:80> ServerAdmin email@example.com ServerName http://sd2.mydomain.com DocumentRoot /srv/www/wiki/public_html/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /srv/www/wiki/public_html/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
I don't have
NameVirtualHost in there, because I am trying to get each site working on its own, before getting them both running at the same time. (I only activate one at a time)
My problem is that when I open a browser and try to go to
http://sd2.mydomain.com the site simply will not load and there is nothing in the error log to tell me that something is going wrong. However, if I add all the same
SSL stuff to my
sd2.mydomain.com config file, the second site does work, but I have to navigate to
https://sd2.mydomain.com for it to work, and, obviously, the SSL cert fails.
What am I doing wrong here? I feel like all the config stuff is accurate since there are no errors. What am I missing?