Skip to content

Instantly share code, notes, and snippets.

@francois
Created February 20, 2009 21:16
Show Gist options
  • Save francois/67695 to your computer and use it in GitHub Desktop.
Save francois/67695 to your computer and use it in GitHub Desktop.
<VirtualHost _default_:443>
SSLEngine On
SSLRequireSSL
ServerName xlsuite.com
ServerAlias *.xlsuite.com
SSLCertificateKeyFile /var/www/xlsuite/releases/20090220205909/config/ssl/_.xlsuite.com/_.xlsuite.com.key
SSLCertificateFile /var/www/xlsuite/releases/20090220205909/config/ssl/_.xlsuite.com/_.xlsuite.com.crt
SSLOptions +StdEnvVars
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
Include /var/www/xlsuite/current/config/common.conf
</VirtualHost>
# mod_cache, mod_disk_cache configuration
CacheRoot /mnt/apache/cache
CacheEnable disk /
CacheDirLevels 3
CacheDirLength 2
CacheMinFileSize 128
# 20 Mb
CacheMaxFileSize 20971520
# Remove extraneous information from the response
ServerTokens Min
ProxyVia Off
ServerSignature Off
ExtendedStatus Off
ProxyStatus On
# We can't cache the Set-Cookie header, or else everyone will share the same session
# Ooops! See http://thread.gmane.org/gmane.comp.apache.user/77647/focus=77778
CacheIgnoreHeaders Set-Cookie
# Include the default configuration
Include /var/www/xlsuite/current/config/sites/default.conf
# Include all generated sites
# This is for sites that have an SSL certificate
Include /var/www/xlsuite/current/config/sites/*
# Passenger configuration
RailsSpawnMethod smart
PassengerMaxPoolSize 24
PassengerMaxInstancesPerApp 12
# 10 minutes * 60 seconds = 600
PassengerPoolIdleTime 600
<Proxy *>
Allow from all
</Proxy>
DocumentRoot /var/www/xlsuite/current/public
<Directory "/var/www/xlsuite/current/public">
AllowOverride None
Options -Indexes +FollowSymlinks
Order Allow,Deny
Allow from all
</Directory>
RewriteEngine On
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L]
# Deflate
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
<VirtualHost *:80>
# This file should be loaded as the first VHOST. This will allow Apache to
# answer with this configuration for any domain.
ServerName xlsuite.com
Include /var/www/xlsuite/current/config/common.conf
</VirtualHost>
$ ls -l /etc/apache2/sites-enabled/
lrwxrwxrwx 1 root root 43 2009-02-20 16:27 00-default -> /var/www/xlsuite/current/config/apache.conf
$ ls -l /var/www/xlsuite/current/config/
-rw-rw-r-- 1 www-data www-data 899 2009-02-20 20:58 apache.conf
-rw-rw-r-- 1 www-data www-data 725 2009-02-20 20:58 common.conf
drwxr-xr-x 2 www-data www-data 120 2009-02-20 21:00 sites
drwxrwxr-x 3 www-data www-data 80 2009-02-20 16:30 ssl
$ ls -l /var/www/xlsuite/current/config/sites/
-rw-r--r-- 1 www-data www-data 244 2009-02-20 21:00 default.conf
-rw-r--r-- 1 www-data www-data 572 2009-02-20 21:00 _.xlsuite.com.ssl.conf
$ ls -lR /var/www/xlsuite/current/config/ssl/
/var/www/xlsuite/current/config/ssl/:
drwxrwxr-x 2 www-data www-data 168 2009-02-20 16:30 _.xlsuite.com
/var/www/xlsuite/current/config/ssl/_.xlsuite.com:
-rwxrwxr-x 1 www-data www-data 1732 2009-02-20 16:30 _.xlsuite.com.crt
-rw-rw-r-- 1 www-data www-data 733 2009-02-20 16:30 _.xlsuite.com.csv
-rw-rw-r-- 1 www-data www-data 963 2009-02-20 16:30 _.xlsuite.com.key
$ ls -l /etc/apache2/mods-enabled/
lrwxrwxrwx 1 root root 28 2009-02-20 16:22 alias.conf -> ../mods-available/alias.conf
lrwxrwxrwx 1 root root 28 2009-02-20 16:22 alias.load -> ../mods-available/alias.load
lrwxrwxrwx 1 root root 33 2009-02-20 16:22 auth_basic.load -> ../mods-available/auth_basic.load
lrwxrwxrwx 1 root root 33 2009-02-20 16:22 authn_file.load -> ../mods-available/authn_file.load
lrwxrwxrwx 1 root root 36 2009-02-20 16:22 authz_default.load -> ../mods-available/authz_default.load
lrwxrwxrwx 1 root root 38 2009-02-20 16:22 authz_groupfile.load -> ../mods-available/authz_groupfile.load
lrwxrwxrwx 1 root root 33 2009-02-20 16:22 authz_host.load -> ../mods-available/authz_host.load
lrwxrwxrwx 1 root root 33 2009-02-20 16:22 authz_user.load -> ../mods-available/authz_user.load
lrwxrwxrwx 1 root root 32 2009-02-20 16:22 autoindex.conf -> ../mods-available/autoindex.conf
lrwxrwxrwx 1 root root 32 2009-02-20 16:22 autoindex.load -> ../mods-available/autoindex.load
lrwxrwxrwx 1 root root 28 2009-02-20 16:22 cache.load -> ../mods-available/cache.load
lrwxrwxrwx 1 root root 27 2009-02-20 16:22 cgid.conf -> ../mods-available/cgid.conf
lrwxrwxrwx 1 root root 27 2009-02-20 16:22 cgid.load -> ../mods-available/cgid.load
lrwxrwxrwx 1 root root 30 2009-02-20 16:22 deflate.conf -> ../mods-available/deflate.conf
lrwxrwxrwx 1 root root 30 2009-02-20 16:22 deflate.load -> ../mods-available/deflate.load
lrwxrwxrwx 1 root root 26 2009-02-20 16:22 dir.conf -> ../mods-available/dir.conf
lrwxrwxrwx 1 root root 26 2009-02-20 16:22 dir.load -> ../mods-available/dir.load
lrwxrwxrwx 1 root root 33 2009-02-20 16:22 disk_cache.conf -> ../mods-available/disk_cache.conf
lrwxrwxrwx 1 root root 33 2009-02-20 16:22 disk_cache.load -> ../mods-available/disk_cache.load
lrwxrwxrwx 1 root root 26 2009-02-20 16:22 env.load -> ../mods-available/env.load
lrwxrwxrwx 1 root root 27 2009-02-20 16:22 info.conf -> ../mods-available/info.conf
lrwxrwxrwx 1 root root 27 2009-02-20 16:22 info.load -> ../mods-available/info.load
lrwxrwxrwx 1 root root 27 2009-02-20 16:22 mime.conf -> ../mods-available/mime.conf
lrwxrwxrwx 1 root root 27 2009-02-20 16:22 mime.load -> ../mods-available/mime.load
lrwxrwxrwx 1 root root 34 2009-02-20 16:22 negotiation.conf -> ../mods-available/negotiation.conf
lrwxrwxrwx 1 root root 34 2009-02-20 16:22 negotiation.load -> ../mods-available/negotiation.load
lrwxrwxrwx 1 root root 32 2009-02-20 16:24 passenger.conf -> ../mods-available/passenger.conf
lrwxrwxrwx 1 root root 32 2009-02-20 16:24 passenger.load -> ../mods-available/passenger.load
lrwxrwxrwx 1 root root 37 2009-02-20 16:22 proxy_balancer.load -> ../mods-available/proxy_balancer.load
lrwxrwxrwx 1 root root 28 2009-02-20 16:22 proxy.conf -> ../mods-available/proxy.conf
lrwxrwxrwx 1 root root 33 2009-02-20 16:22 proxy_http.load -> ../mods-available/proxy_http.load
lrwxrwxrwx 1 root root 28 2009-02-20 16:22 proxy.load -> ../mods-available/proxy.load
lrwxrwxrwx 1 root root 30 2009-02-20 16:22 rewrite.load -> ../mods-available/rewrite.load
lrwxrwxrwx 1 root root 31 2009-02-20 16:22 setenvif.conf -> ../mods-available/setenvif.conf
lrwxrwxrwx 1 root root 31 2009-02-20 16:22 setenvif.load -> ../mods-available/setenvif.load
lrwxrwxrwx 1 root root 26 2009-02-20 16:22 ssl.conf -> ../mods-available/ssl.conf
lrwxrwxrwx 1 root root 26 2009-02-20 16:22 ssl.load -> ../mods-available/ssl.load
lrwxrwxrwx 1 root root 29 2009-02-20 16:22 status.conf -> ../mods-available/status.conf
lrwxrwxrwx 1 root root 29 2009-02-20 16:22 status.load -> ../mods-available/status.load
$ /usr/sbin/apache2ctl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server xlsuite.com (/var/www/xlsuite/current/config/sites/default.conf:1)
port 80 namevhost xlsuite.com (/var/www/xlsuite/current/config/sites/default.conf:1)
port 80 namevhost xlsuite.com (/var/www/xlsuite/current/config/sites/default.conf:1)
Syntax OK
$ /usr/sbin/apache2ctl -M
Loaded Modules:
core_module (static)
log_config_module (static)
logio_module (static)
mpm_worker_module (static)
http_module (static)
so_module (static)
alias_module (shared)
auth_basic_module (shared)
authn_file_module (shared)
authz_default_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cache_module (shared)
cgid_module (shared)
deflate_module (shared)
dir_module (shared)
disk_cache_module (shared)
env_module (shared)
info_module (shared)
mime_module (shared)
negotiation_module (shared)
passenger_module (shared)
proxy_module (shared)
proxy_balancer_module (shared)
proxy_http_module (shared)
rewrite_module (shared)
setenvif_module (shared)
ssl_module (shared)
status_module (shared)
Syntax OK
$ /usr/sbin/apache2ctl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server xlsuite.com (/var/www/xlsuite/current/config/sites/default.conf:1)
port 80 namevhost xlsuite.com (/var/www/xlsuite/current/config/sites/default.conf:1)
port 80 namevhost xlsuite.com (/var/www/xlsuite/current/config/sites/default.conf:1)
Syntax OK
$ /usr/sbin/apache2 -v
Server version: Apache/2.2.9 (Ubuntu)
Server built: Sep 19 2008 13:45:10
$ openssl s_client -connect localhost:443
CONNECTED(00000003)
22774:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:583:
$ telnet localhost 443
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
asdf
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>501 Method Not Implemented</title>
</head><body>
<h1>Method Not Implemented</h1>
<p>asdf to / not supported.<br />
</p>
</body></html>
Connection closed by foreign host.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment