You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@httpd.apache.org by Apache Wiki <wi...@apache.org> on 2012/03/12 00:27:23 UTC
[Httpd Wiki] Update of "ExampleVhosts" by Sling
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.
The "ExampleVhosts" page has been changed by Sling:
http://wiki.apache.org/httpd/ExampleVhosts?action=diff&rev1=9&rev2=10
Comment:
updated to 2.4, added full ssl configuration and reference to SNI article
## page was renamed from Recipies/ExampleVhosts
= Example VirtualHost Configurations =
- The excerpts below show some example name-based !VirtualHost configurations that can be used in Apache.
+ The excerpts below show some example name-based !VirtualHost configurations that can be used in Apache. For more detailed instructions, please see the [[http://httpd.apache.org/docs/2.4/vhosts/|official documentation]].
- For each TCP port that you want to use to serve content, you will need to define these before configuring your !VirtualHosts.
+ For each TCP port that you want to use to serve content, you will need to define a Listen directive before configuring your !VirtualHosts.
+ When using Apache version 2.2.x or lower, each port will also need a NameVirtualHost directive.
- You will need both a Listen directive and a !NameVirtualHost directive.
-
{{{
# This tells Apache to listen on port 80
Listen 80
- # This tells Apache to listen on port 443
+ # This tells Apache to listen on port 443 (Only required when using SSL)
Listen 443
# This tells Apache that you will be using name-based vhosts on port 80
+ # Note: Only required when using Apache version 2.2.x or lower
NameVirtualHost *:80
}}}
@@ -82, +82 @@
== SSL-enabled VirtualHost with custom log files ==
{{{
- <VirtualHost _default_:443>
+ <VirtualHost *:443>
- # Only one virtual host allowed on this port, because name-based
- # virtual hosting doesn't work with SSL
ServerName www.foo.com
DocumentRoot /var/www/www.foo.com/htdocs
CustomLog /var/log/apache/www.foo.com-access.log combined
ErrorLog /var/log/apache/www.foo.com-error.log
+ # Example SSL configuration
- SSLEngine On
+ SSLEngine on
-
+ SSLProtocol all -SSLv2
+ SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
+ SSLCertificateFile "/var/www/www.foo.com/ssl/server.crt"
+ SSLCertificateKeyFile "/var/www/www.foo.com/ssl/server.key"
</VirtualHost>
}}}
+ Warning: If you want to run multiple SSL vhosts on a single IP, see [[http://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI|this article]].
+
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org