]> git.evergreen-ils.org Git - OpenSRF.git/blob - examples/apache2/websockets/apache2.conf
0aaca73c5306b630f199ab211ae4cc3d18839c9b
[OpenSRF.git] / examples / apache2 / websockets / apache2.conf
1 # This is the main Apache server configuration file for the OpenSRF
2 # WebSockets gateway.  
3
4 # if we don't want to run as "opensrf", change the LockFile
5 LockFile ${APACHE_LOCK_DIR}/accept.lock
6 PidFile ${APACHE_PID_FILE}
7 User ${APACHE_RUN_USER}
8 Group ${APACHE_RUN_GROUP}
9
10 DefaultType None
11 HostnameLookups Off
12 ErrorLog ${APACHE_LOG_DIR}/error.log
13 LogLevel warn
14
15 # only affects the initial connection, which should be quick.
16 Timeout 30
17
18 # WebSockets is KeepAlive on steroids
19 KeepAlive Off
20
21 <IfModule mpm_prefork_module>
22     StartServers          5
23     MinSpareServers       5
24     MaxSpareServers      20
25     # use ServerLimit to raise beyond 256
26     MaxClients          256
27     MaxRequestsPerChild   0
28 </IfModule>
29
30 # include the exact mods we need
31 Include mods-available/mime.load
32 Include mods-available/mime.conf
33 # SSL requires mime
34 Include mods-available/ssl.load
35 Include mods-available/ssl.conf
36 Include mods-available/websocket.load
37
38 LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
39 LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
40 LogFormat "%h %l %u %t \"%r\" %>s %O" common
41 LogFormat "%{Referer}i -> %U" referer
42 LogFormat "%{User-agent}i" agent
43
44 # WebSockets via SSL
45 Listen 7682
46 NameVirtualHost *:7682                                                          
47 <VirtualHost *:7682>                                                            
48     DocumentRoot /var/www                                                       
49     ServerName localhost:7682                                                   
50     ServerAlias 127.0.0.1:7682                                                  
51     SSLEngine on                                                                
52     SSLHonorCipherOrder On                                                      
53     SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM
54
55     # re-use the certs from the main apache instance
56     SSLCertificateFile /etc/apache2/ssl/server.crt
57     SSLCertificateKeyFile /etc/apache2/ssl/server.key
58 </VirtualHost>                                                                  
59                                                                                 
60 # WebSockets via non-SSL
61 Listen 7680
62 NameVirtualHost *:7680                                                          
63 <VirtualHost *:7680>                                                            
64     ServerName localhost:7680                                                   
65     ServerAlias 127.0.0.1:7680                                                  
66     DocumentRoot /var/www                                                       
67 </VirtualHost>                                                                  
68                                                                                 
69 # OpenSRF WebSockets gateway
70 <Location /osrf-websocket-translator>                                           
71     SetHandler websocket-handler                                                
72     WebSocketHandler /usr/lib/apache2/modules/osrf_websocket_translator.so osrf_websocket_init
73 </Location>