Skip to content

Apache Configuration

micwallace edited this page Dec 7, 2016 · 2 revisions

Apache Configuration

These are examples of the websocket proxy config required by the POS.

Version 1.4.0 or later

    <VirtualHost *:443>
         DocumentRoot %/your_install_dir%
         ServerName %your.server.fqdn%

         ErrorLog ${APACHE_LOG_DIR}/error.log
         CustomLog ${APACHE_LOG_DIR}/access.log combined

         SSLEngine on
         SSLCipherSuite !ADH:!DSS:!RC4:HIGH:+3DES:+RC4
         SSLProtocol all -SSLv2 -SSLv3
         SSLCertificateFile %certificate_location%
         SSLCertificateKeyFile %key_location%
         SSLCertificateChainFile %cert_chain_location%

         <Directory %/your_install_dir%>
            AllowOverride all
         </Directory>

         # WSPROXY CONF
         ProxyRequests Off
         ProxyPreserveHost On
         <Proxy *>
                 Order deny,allow
                 Allow from all
         </Proxy>
         RewriteEngine On
         RewriteCond %{HTTP:Connection} Upgrade [NC]
         RewriteRule /(.*) ws://localhost:8080/$1 [P,L]
         ProxyPass        /socket.io http://localhost:8080/socket.io/
         ProxyPassReverse /socket.io http://localhost:8080/socket.io/
         <Location /socket.io>
                 Order allow,deny
                 Allow from all
         </Location>
    </VirtualHost>

Pre version 1.4.0

    <VirtualHost *:443>
         DocumentRoot %/your_install_dir%
         ServerName %your.server.fqdn%

         ErrorLog ${APACHE_LOG_DIR}/error.log
         CustomLog ${APACHE_LOG_DIR}/access.log combined

         SSLEngine on
         SSLCipherSuite !ADH:!DSS:!RC4:HIGH:+3DES:+RC4
         SSLProtocol all -SSLv2 -SSLv3
         SSLCertificateFile %certificate_location%
         SSLCertificateKeyFile %key_location%
         SSLCertificateChainFile %cert_chain_location%

         <Directory %/your_install_dir%>
            AllowOverride all
         </Directory>

         # WSPROXY CONF
         ProxyRequests Off
         ProxyPreserveHost On
         <Proxy *>
                 Order deny,allow
                 Allow from all
         </Proxy>
         ProxyPass /socket.io/1/websocket/ ws://localhost:8080/socket.io/1/websocket/
         ProxyPassReverse /socket.io/1/websocket/ ws://localhost:8080/socket.io/1/websocket
         ProxyPass /socket.io/ http://localhost:8080/socket.io/
         ProxyPassReverse /socket.io/ http://localhost:8080/socket.io/
         <Location /socket.io>
                 Order allow,deny
                 Allow from all
         </Location>
    </VirtualHost>