Deploy with Apache
Learn how to serve Chartbrew on a domain with Apache
Before starting, ensure you have built Chartbrew using the guide Build and deploy.
Install Apache
As you already guessed, you will need Apache for this one. Below is guide on how to install it on Ubuntu 22.04:
Set up VirtualHosts
Create a new Apache configuration file for the Chartbrew site.
This configuration file will have everything necessary to serve the backend and frontend on your domains. Since both apps are already running on different ports, we will use a reverse proxy method to serve these on a domain.
Make sure you type your domain correctly and all the subdomains that you use are registered in your DNS configuration (Cloudflare example). Now activate the site and you will be able to access Chartbrew using your domain:
If you’re making your site public, it’s strongly recommended that you enable https
on it. Some providers offer that automatically, but in case that’s not happening have a look at Certbot as it’s super simple to set up and it’s free.
Troubleshooting the Chart Embedding feature
A problem that might arrise with embedding charts on other website is to do with the X-Frame-Options
header being set as deny
by the server. If your charts can’t load on other sites because of this problem make sure you add the following configuration to the VirtualHost
that serves your frontend:
This is already added in the example above, but if you create new virtual hosts for https
, for example, don’t forget to add it there as well.