ethercalc
Version:
Multi-User Spreadsheet Server
61 lines (50 loc) • 1.96 kB
Plain Text
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#
# Hint for Apache 2.4
# You need to enable:
# - mod_proxy
# - mod_proxy_http
# - mod_proxy_wstunnel
# else you get a working ethercalc instance with datashifts in it!
ServerName myethercalc.domain.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/ethercalc-error.log
CustomLog ${APACHE_LOG_DIR}/ethercalc-access.log combined
# Proxy pass to the node.js server (port 8000)
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
# Set up websockets to work through the proxy
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/socket.io [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://localhost:8000/$1 [P,L]
# Simple Auth for both viewing and editing sheets
<LocationMatch "^/">
AuthType Basic
AuthName "Ethercalc Viewer"
AuthUserFile "/etc/apache2/htpasswd"
Require valid-user
Order allow,deny
Allow from all
</LocationMatch>
<LocationMatch ^/(.*)/edit$>
AuthType Basic
AuthName "Ethercalc Viewer"
AuthUserFile "/etc/apache2/htpasswd"
Require user admin
Order allow,deny
Allow from all
</LocationMatch>
# Set up an alias for static files. Saves having to serve them from node.js
Alias /static /path/to/ethercalc/install/static
Alias /l10n /path/to/ethercalc/install/l10n
Alias /images /path/to/ethercalc/install/images
</VirtualHost>