From 7b3860ff2fb9ac5bf1b862b77dacaf3ea2abadcb Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 14 Oct 2017 18:25:23 +0300 Subject: [PATCH] Created Apache (markdown) --- Apache.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Apache.md diff --git a/Apache.md b/Apache.md new file mode 100644 index 0000000..e3aaed7 --- /dev/null +++ b/Apache.md @@ -0,0 +1,46 @@ +* Enable Mod_Proxy: `sudo a2enmod proxy proxy_http proxy_wstunnel` then restart Apache `service apache2 restart` +* Configure your virtual host (vhost) + +Let say you have the following "mytodo.org" vhost configured in `/etc/apache2/sites-available/mytodo.org.conf`: + +```ApacheConf + + ServerName mytodo.org + ServerAdmin webmaster@mytodo.org + + DocumentRoot /var/www-vhosts/mytodo.org + + Options FollowSymLinks + AllowOverride AuthConfig FileInfo Indexes Options=MultiViews + + + + Options -Indexes +FollowSymLinks +MultiViews + AllowOverride AuthConfig FileInfo Indexes Options=MultiViews + Require all granted + + + ErrorLog /var/log/apache2/mytodo.org-error.log + + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + LogLevel warn + + CustomLog /var/log/apache2/mytodo.org-access.log combined + ServerSignature Off + +``` + +Add the following lines at the end just before ``: + +```ApacheConf + ProxyPassMatch "^/(sockjs\/.*\/websocket)$" "ws://127.0.0.1:8081/$1" + ProxyPass "/" "http://127.0.0.1:8081/" + ProxyPassReverse "/" "http://127.0.0.1:8081/" +``` + +**Note:** if not already done, don't forget to enable your vhost `sudo a2ensite mytodo.org` + +Reload Apache `sudo service apache2 reload` + +[Apache Mod_Proxy documentation](http://httpd.apache.org/docs/current/mod/mod_proxy.html)