Member-only story

How to serve a JavaScript build with Apache — boobo94

To serve a JavaScript build with Apache is a very simple task and today I want to present you a very simple way of achieving that.

<VirtualHost *:80>
ServerName subdomain1.example.com
ServerAlias subdomain2.example.com

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName subdomain1.example.com
ServerAlias subdomain2.example.com

DocumentRoot /var/vhosts/www/client
<Directory />
DirectoryIndex index.html
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>


Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
</VirtualHost>
</IfModule>

If you consider this helpful please give it a share. For any question or discussion please consider the comments section.

Originally published at https://whyboobo.com/devops/serve-js-with-apache/ on June 9, 2020.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

No responses yet

Write a response