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