I added the code into a new mysite.com file next to the default file and the only changes I made were taking out the code enabling SSL from the default file and replacing the names/directories in the mysite.com to fit my setup. (I'm keeping the directories at /var/www/ for now until everything works, then I'll copy them into /var/www/mysite.com/ instead)
Code:
<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.mysite.com
ServerAdmin webmaster@mysite.com
DocumentRoot /var/www/
<Directory /var/www>
Options -Indexes +Includes -ExecCGI -MultiViews +SymLinksIfOwnerMatch
</Directory>
</Virtualhost>
<VirtualHost *:443>
ServerName mysite.com
ServerAlias www.mysite.com
ServerAdmin webmaster@mysite.com
DocumentRoot /var/www/
<Directory /var/www/>
Options -Indexes +Includes -ExecCGI -MultiViews +SymLinksIfOwnerMatch
</Directory>
SSLEngine on
SSLOptions +StrictRequire
SSLCertificateFile /etc/ssl/certs/mysite.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
</Virtualhost>
but after enabling and trying to restart, I get the following errors:
[Fri Mar 27 12:59:43 2009] [error] VirtualHost *:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Fri Mar 27 12:59:43 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Fri Mar 27 12:59:53 2009] [error] VirtualHost *:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Fri Mar 27 12:59:53 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
What info do I need to keep under the default file? (I don't really know what exactly the default file is used for when other vhost files are enabled. Is it for localhost? Since it's directory is /var/www/, will it include all the /var/www/mysites(*).com/ folders under it? despite other vhost files pointing to those specific directories?) And what about all those override and log error lines? Do I keep them under NameVirtualHost or move them under each of the VirtualHosts in the mysite.com file or need them at all?
On trying out the site, only http: works, not https. I assume this is because I got rid of the SSL stuff in the default file but the error messages mean that the mysite.com file isn't being used properly.[/code]