Index →

vhost_ssl

	Path: /etc/apache2/sites-available/vhost_ssl
	Size: 996 bytes

Virtual hosting configuration for Apache 2, SSL support using Snake-oil certificate. After storing this file you can enable it using a2esite vhost_ssl. Make sure you have the Snake oil certificate generated. Look up make-ssl-cert for more information.

Content

# get the server name from the Host: header
UseCanonicalName Off

NameVirtualHost *:443
<VirtualHost _default_:443>
	#Keep server from doing reverse lookup
	ServerName logfish.net
	
	# Make www.example.com go to vhost/example.com/www/
	VirtualDocumentRoot /var/www/vhost/%-2.0.%-1/%-3+/
	#Suppress File does not exist: /htdocs
	DocumentRoot /var/www/empty/

	<Directory /var/www/>
		Options All
		Options -Indexes
		AllowOverride All
		#At least drupal needs: Indexes Limit Options FileInfo
		<LimitExcept GET POST OPTIONS>
			Order deny,allow
			Deny from all
		</LimitExcept>
	</Directory>
	#Simple, self-signed certificate. Will not be trusted by anyone
	#Created with: openssl req -new -x509 -nodes -out server.crt -keyout server.key
	#Vhosts can't have proper certificates: http://httpd.apache.org/docs/2.2/ssl/ssl_faq.html#vhosts
	SSLEngine on
	SSLCipherSuite HIGH:MEDIUM
	SSLCertificateFile /etc/apache2/ssl/server.crt
	SSLCertificateKeyFile /etc/apache2/ssl/server.key
	
</VirtualHost>



License

    Copyright (C) 2010 A. Bram Neijt
    This file is part of the logfish.net configuration collection.

    This file is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This file is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You can find a copy of the GNU General Public License
    online at <http://www.gnu.org/licenses/>.