Commands run
Code:
> sudo a2dissite website1.com.conf
Site website1.com disabled.
To activate the new configuration, you need to run:
service apache2 reload
> sudo a2dissite website2.com.conf
Site website2.com disabled.
To activate the new configuration, you need to run:
service apache2 reload
> sudo a2ensite test.conf
Enabling site test.
To activate the new configuration, you need to run:
service apache2 reload
> service apache2 reload
* Reloading web server apache2
*
Content of /etc/apache2/sites-enabled/test.conf
Code:
<VirtualHost *:443>
ServerName www.website1.com
DocumentRoot /var/www/website1.com
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/website1.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/website1.com.key
SSLCertificateChainFile /etc/apache2/ssl/website1.com.ca-bundle
</VirtualHost>
<VirtualHost *:443>
ServerName www.website2.com
DocumentRoot /var/www/website2.com
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/www_website2_com.crt
SSLCertificateKeyFile /etc/apache2/ssl/www_website2_com.key
SSLCertificateChainFile /etc/apache2/ssl/www_website2_com.ca-bundle
</VirtualHost>
Results of apache2ctl -S
Code:
VirtualHost configuration:
*:443 is a NameVirtualHost
default server www.website1.com (/etc/apache2/sites-enabled/test.conf:1)
port 443 namevhost www.website1.com(/etc/apache2/sites-enabled/test.conf:1)
port 443 namevhost www.website2.com (/etc/apache2/sites-enabled/test.conf:11)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: ENABLE_USR_LIB_CGI_BIN
User: name="www-data" id=33
Group: name="www-data" id=33
Result is a directory listing of /var/www when using either URL