Skip to content

Installation Guide: Apache

Mark Hughes edited this page May 13, 2021 · 1 revision

Wiki Home / Installation Guides / Apache


This guide is for how you can setup droppy with apache, a popular web server that can also be used as a reverse proxy. For this use case, we're setting up Apache to work with a reverse proxy.

Requirements

The following modules are required, please ensure they are loaded - you can do so by uncommenting them in your httpd.conf file.

  • mod_headers
  • mod_proxy
  • mod_proxy_wstunnel
  • mod_remoteip
  • mod_rewrite
  • mod_ssl

Configuration

We are going to create a virtual host.

You can use the same configuration in a HTTPS virtual host (<VirtualHost *:443>)

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName droppy.example.com
    ErrorLog /var/log/httpd/droppy.example.com.error.log

    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/!/socket [NC]
    RewriteRule /(.*) ws://127.0.0.1:8989/$1 [P,L]

    RewriteCond %{HTTP:Connection} Upgrade [NC]
    RewriteCond %{HTTP:Upgrade} websocket [NC]

    RemoteIPHeader X-Forwarded-For
    RequestHeader set X-Forwarded-Proto "https"
    ProxyPreserveHost On

    ProxyPass / http://127.0.0.1:8989/
    ProxyPassReverse / http://127.0.0.1:8989/

</VirtualHost>

Common Errors

Request content-length of x is larger than the configured limit of x

You need to edit the httpd.conf file and set the directive to an increased value. For example, to set the maximum download size to 10MB you would use something like this:

LimitRequestBody 10240000

Optionally, removing it all together - not the best idea though, you should set a limit!