Apache 2.22 Websocket Proxying on Ubuntu with mod_proxy_wstunnel

Apache, BBS, Server, Ubuntu Add comments

OK, so I am going to go geeky and deep on this one. But as part of my Color64 BBS project I needed to use a WebSocket proxy tunnel to the Color64 BBS software. It turns out Ubuntu isn’t up to the newest version of Apache. A little Googling and I came across this post.

The only problem is that it’s on someone else’s blog, which means I might forget where I found it should my server crash. 🙂 And the code for the exact steps need to be altered. So here goes with the modified steps for Apache 2.22:

# Check apache version (should be 2.2.22 as of writing, if not adjust the next step to the right version)
dpkg -s apache2

# Checkout apache source
svn checkout http://svn.apache.org/repos/asf/httpd/httpd/tags/2.2.22/ httpd-2.2.22

# Get patch and apply it
wget http://cafarelli.fr/gentoo/apache-2.2.24-wstunnel.patch
cd httpd-2.2.22
patch -p1 < ../apache-2.2.24-wstunnel.patch

# Build Apache 
svn co http://svn.apache.org/repos/asf/apr/apr/branches/1.4.x srclib/apr
svn co http://svn.apache.org/repos/asf/apr/apr-util/branches/1.3.x srclib/apr-util
./configure --enable-proxy=shared --enable-proxy_wstunnel=shared

# Copy the module and recompiled mod_proxy (for new symbols) to the ubuntu apache installation and update the permissions to match the other modules
sudo cp modules/proxy/.libs/mod_proxy{_wstunnel,}.so /usr/lib/apache2/modules/
sudo chmod 644 /usr/lib/apache2/modules/mod_proxy{_wstunnel,}.so
echo -e "# Depends: proxy\nLoadModule proxy_wstunnel_module /usr/lib/apache2/modules/mod_proxy_wstunnel.so" | sudo tee -a /etc/apache2/mods-available/proxy_wstunnel.load

# Enable the module (also make any configuration changes you need)
sudo a2enmod proxy_wstunnel
sudo service apache2 restart

Edit: Ubuntu may have upgraded Apache to allow for WebSocket Proxies. So I am simply posting this as a reference at this point until I update and confirm that these steps aren’t needed.

Leave a Reply

You must be logged in to post a comment.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in