| 1 |
<IfDefine SSL>
|
| 2 |
|
| 3 |
# SSL virtual host
|
| 4 |
#
|
| 5 |
# SSL virtual hosts are a special form of the IP-based virtual host.
|
| 6 |
# Every virtual host that you want to run HTTPS for MUST have it's own
|
| 7 |
# IP address.
|
| 8 |
|
| 9 |
|
| 10 |
# Set the IP address of this SSL server here.
|
| 11 |
<VirtualHost 1.2.3.4:443>
|
| 12 |
|
| 13 |
# Used for creating URLs back to itself
|
| 14 |
# This should also match the name on the SSL certificate
|
| 15 |
ServerName example.com
|
| 16 |
|
| 17 |
# DocumentRoot is the location where your files will be stored
|
| 18 |
#
|
| 19 |
# For gentoo, the suggested structure is:
|
| 20 |
#
|
| 21 |
# /var/www/
|
| 22 |
# domain.com/
|
| 23 |
# htdocs/ Files for the website itself
|
| 24 |
# htdocs-secure/ Files available via HTTPS
|
| 25 |
# cgi-bin/ Site-specific executable scripts (optional)
|
| 26 |
# error/ Custom error pages for the website (optional)
|
| 27 |
# icons/ Custom icons for the website (optional)
|
| 28 |
#
|
| 29 |
# You should also set the vhost USE-flag so that you can install webapps
|
| 30 |
# easily to multiple virtual hosts
|
| 31 |
#
|
| 32 |
# Note that if you put the directory anywhere other then under /var/www
|
| 33 |
# you may run into problems with suexec and cgi scripts.
|
| 34 |
# You can reconfigure this path by running suexec2-config
|
| 35 |
#
|
| 36 |
DocumentRoot "/var/www/example.com/htdocs-secure"
|
| 37 |
|
| 38 |
# This should match the DocumentRoot above
|
| 39 |
<Directory "/var/www/example.com/htdocs-secure">
|
| 40 |
# Some sane defaults - see httpd.conf for details
|
| 41 |
Options Indexes FollowSymLinks
|
| 42 |
AllowOverride None
|
| 43 |
|
| 44 |
Order allow,deny
|
| 45 |
Allow from all
|
| 46 |
</Directory>
|
| 47 |
|
| 48 |
# By default cgi-bin points to the global cgi-bin in /var/www/localhost
|
| 49 |
# If you want site specific executable scripts, then uncomment this section
|
| 50 |
#
|
| 51 |
# If you have enabled suexec, you will want to make sure that the cgi-bin
|
| 52 |
# directory is owned by the user and group specified with SuexecUserGroup
|
| 53 |
|
| 54 |
#ScriptAlias /cgi-bin/ "/var/www/example.com/cgi-bin/"
|
| 55 |
#<Directory "/var/www/example.com/cgi-bin">
|
| 56 |
# AllowOverride None
|
| 57 |
# Options None
|
| 58 |
# Order allow,deny
|
| 59 |
# Allow from all
|
| 60 |
#</Directory>
|
| 61 |
|
| 62 |
# If you have multiple users on this system, each with their own vhost,
|
| 63 |
# then it's a good idea to use suexec to seperate them.
|
| 64 |
#
|
| 65 |
# Set the user and group that scripts in this virtual host will run as.
|
| 66 |
<IfDefine SUEXEC>
|
| 67 |
SuexecUserGroup billybob users
|
| 68 |
</IfDefine>
|
| 69 |
|
| 70 |
# If you want custom error documents uncomment this section
|
| 71 |
# See /etc/apache2/modules.d/00_error_documents.conf for the file
|
| 72 |
# name to use for the various error types
|
| 73 |
|
| 74 |
#<IfDefine ERRORDOCS>
|
| 75 |
# Alias /error/ "/var/www/example.com/error/"
|
| 76 |
# <Directory "/var/www/example.com/error/">
|
| 77 |
# AllowOverride None
|
| 78 |
# Options IncludesNoExec
|
| 79 |
# AddOutputFilter Includes html
|
| 80 |
# AddHandler type-map var
|
| 81 |
# Order allow,deny
|
| 82 |
# Allow from all
|
| 83 |
# </Directory>
|
| 84 |
#</IfDefine ERRORDOCS>
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
# If you want to use custom icons for the website autoindexes,
|
| 89 |
# then uncomment this section.
|
| 90 |
|
| 91 |
#Alias /icons/ "/var/www/example.com/icons/"
|
| 92 |
#<Directory "/var/www/example.com/icons/">
|
| 93 |
# Options Indexes MultiViews
|
| 94 |
# AllowOverride None
|
| 95 |
# Order allow,deny
|
| 96 |
# Allow from all
|
| 97 |
#</Directory>
|
| 98 |
|
| 99 |
# Create a logfile for this vhost
|
| 100 |
CustomLog /var/log/apache2/example.com.ssl_log combined
|
| 101 |
|
| 102 |
# Turn on SSL
|
| 103 |
SSLEngine on
|
| 104 |
|
| 105 |
# You will need a seperate key and certificate for every vhost
|
| 106 |
SSLCertificateFile /etc/apache2/ssl/example.com.crt
|
| 107 |
SSLCertificateKeyFile /etc/apache2/ssl/example.com.key
|
| 108 |
</VirtualHost>
|
| 109 |
|
| 110 |
# If you want to force SSL for a virtualhost, you can uncomment this section
|
| 111 |
|
| 112 |
# Make sure there is a proper NameVirtualHost already setup, if not, you
|
| 113 |
# can uncomment this one. See name-based-vhost.conf.example for details.
|
| 114 |
#NameVirtualHost *:80
|
| 115 |
|
| 116 |
# You can optionally use the IP address here instead, if you want every
|
| 117 |
# connection to this IP address to be forced to SSL
|
| 118 |
#<VirtualHost *:80>
|
| 119 |
# Match the ServerName from above
|
| 120 |
# ServerName example.com
|
| 121 |
|
| 122 |
# Add any necessary aliases if you are using name-based vhosts
|
| 123 |
# ServerAlias www.example.com
|
| 124 |
|
| 125 |
# Redirect permanent / https://example.com/
|
| 126 |
#</Virtualhost>
|
| 127 |
|
| 128 |
# vim: ts=4 filetype=apache
|