- 18 Sep 2024
- 4 Minutes To Read
-
Print
-
DarkLight
-
PDF
Host content on your Server
- Updated On 18 Sep 2024
- 4 Minutes To Read
-
Print
-
DarkLight
-
PDF
Whatfix content can be easily exported and deployed from your servers. Self-hosting is useful when you are on an internal network and cannot access the Flows from the Whatfix cloud, or in cases when your IT security doesn't allow resource loading from remote servers.
Before hosting Whatfix content on your server, ensure that you have exported the production package. For more information, see Export Production Package for Self Hosted Deployment.
Extract the content of the production package to your server. The extracted folder contains a file called embed.nocache.js inside the embed folder.
Add the file as a static file in your application's HTML file as shown in the following.
<script type="text/javascript" src="/public/whatfix.com/embed/embed.nocache.js"></script>
Ensure that your web server has Cache-control set to "no-cache" for the *.nocache.js file so that the request to the origin server is validated before releasing a cached copy.
Popular Web servers and their no-cache settings are listed in the following snippet:
Apache:
<FilesMatch ".(nocache.js)$">
Header set Cache-Control no-cache
< /FilesMatch>
Nginx:
location ~ ^.*(nocache.js)$
{
add_header Cache-Control no-cache;
}
Prerequisite: Before you begin with this procedure, you must have a separate, non-root user account with sudo(superuser do) privileges set up on your server.
Extract the content of the production package to your server. The extracted folder contains a file called embed.nocache.js inside the embed folder.
Add the file as a static JS file in the section of your application's HTML file as shown in the following:
<script type="text/javascript" src="http://server_ip/whatfix.com/embed/embed.nocache.js"></script>
Refresh your application to see the live Whatfix content.
Ensure that your web server has Cache-control set to no-cache for the *.nocache.js file, so that the request to the origin server is validated before releasing a cached copy.
Use the following steps to set up your Amazon S3 bucket to host your content:
- Create an S3 bucket (if you don't already have one).
- Create a user in Amazon AWS using IAM and give the user write access to S3 under the individual's security policies.
- Install Amazon AWS CLI to upload your exported flows directory to your S3.
- Configure from the command line using 'configure' command.
- Enable static website hosting on your S3 bucket.
- Point your browser extension to your S3 URL.
Use the following steps to host Whatfix content on Amazon S3:
Step 1: Export Whatfix content
Before hosting Whatfix content on your server, ensure that you have exported the production package. For more information, see Export Production Package for Self Hosted Deployment.
Step 2: Configure and Upload Content on Step
There are different ways to host your content on Amazon. Host the content directly on Amazon S3 or use it along with Amazon CloudFront. Follow the instructions in Hosting your content on Amazon
- Go to your S3 instance and copy the Endpoint URL for your static website hosting.
- Replace //whatfix.com in your content JS with the Endpoint URL that you copied in the step above.
- Refresh your application and you should be able to view all the exported Flows.
- Whatfix recommends you use CDN servers to serve your content to ensure content scalability and good performance.
- To host your content on AWS CDN (Cloudfront), see How do I use CloudFront to serve HTTPS requests for my Amazon S3 bucket?
- Once you have the CDN configured, you can access Whatfix content from CDN with the domain name configured in Cloudfront.
Use the following steps to set up Azure to access your website content:
- Open the Azure portal in your web browser.
- Create a storage account (if you don't already have one).
- Locate your storage account and display the account overview.
- Select Static website to display the configuration page for static websites.
- Select Enabled to enable static website hosting for the storage account.
- In the Index document name field, specify a default index page of index.html . The default index page is displayed when a user navigates to the root of your static website.
- Click Save. The Azure portal now displays your static website endpoint.
- Click the " $web" (link to Azure storage container for this account) in this page.
- Upload all the static files in this storage and make sure to provide public read access. With this, you can access your website content using the account endpoint.
Use the following steps to host Whatfix content on Azure:
Step 1: Export Whatfix content
Before hosting Whatfix content on your server, ensure that you have exported the production package. For more information, see Export Production Package for Self Hosted Deployment.
Step 2: Configure and Upload Content
There are different ways to host your content on Azure. Click the link below to evaluate your options.
For detailed instructions, see Hosting your content on Microsoft Azure.
-
Go to your Azure instance and copy the Endpoint URL for your static website hosting.
-
Replace whatfix.com in your content with the Endpoint URL that you copied in the aforementioned step.
-
Refresh your application to see all the exported content.
-
Once you have hosted your content on Azure, Whatfix recommends using a CDN to serve your content to ensure content scalability and good performance.
-
For more information on setting up your Whatfix content on Azure CDN, see Integrate a static website with Azure.