]> git.evergreen-ils.org Git - OpenSRF.git/blob - examples/apache_24/websockets/apache2.conf
LP#1391248: Fix NameVirtualHost warnings in websockets apache2.conf
[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 <VirtualHost *:7682>
54     DocumentRoot /var/www
55     ServerName localhost:7682
56     ServerAlias 127.0.0.1:7682
57     SSLEngine on
58     SSLHonorCipherOrder On
59     SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM
60
61     # re-use the certs from the main apache instance
62     SSLCertificateFile /etc/apache2/ssl/server.crt
63     SSLCertificateKeyFile /etc/apache2/ssl/server.key
64 </VirtualHost>
65
66 # WebSockets via non-SSL
67 Listen 7680
68 <VirtualHost *:7680>
69     ServerName localhost:7680
70     ServerAlias 127.0.0.1:7680
71     DocumentRoot /var/www
72 </VirtualHost>
73                                                                                 
74 # OpenSRF WebSockets gateway
75 <Location /osrf-websocket-translator>
76     SetHandler websocket-handler
77     WebSocketHandler /usr/lib/apache2/modules/osrf_websocket_translator.so osrf_websocket_init
78 </Location>