Skip to content

Latest commit

 

History

History
88 lines (60 loc) · 3.72 KB

README.md

File metadata and controls

88 lines (60 loc) · 3.72 KB

Deploy Apache 2 on bare machine (not recommended)

Edit config file

Edit in Apache config file a Redirect line to target API server. Ensure Rewrite lines remains commented for now.

For instance:

Redirect "/heos-api-server" "http://192.168.1.90:5000/"
# xor
Redirect "/heos-api-server" "http://local.nas.coulombel.net:5000/"
Warning on IP/FQDN: This is the IP/FQDN which is targeted by client browser doing:
Redirect "/heos-api-server" "http://localhost:5000/"

Would only work if the client browser is located on same machine where API server is running.

Then trigger installation script:
cd apache-setup
sudo ./purge.sh # Reset Apache2 configuration
sudo ./setup.sh # Setup Apache2
sudo systemctl status apache2
Redirection

Opening a browser developer tool we can see we have 2 round-trip (http code: 302 and 200). The client browser is doing the call directly to API server where we want Apache to make direct call to API server. This would also simplify setup process: cf. previous Warning on IP/FQDN.

We should use RewriteRule in heos.conf.

Comment Redirect lines and add a RewriteRule line, for instance

RewriteRule "^/heos-api-server/(.*)$" "http://local.nas.coulombel.net:5000/$1" [P,NC]
# xor
RewriteRule "^/heos-api-server/(.*)$" "http://localhost:5000/$1" [P,NC]

and trigger installation.

Note this feature requires to enable module: rewrite, proxy, proxy_http in setup.sh.