DEV Community

Bogdan Alexandru Militaru
Bogdan Alexandru Militaru

Posted on • Originally published at boobo94.github.io on

How to serve a JavaScript build with Apache

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>
Enter fullscreen mode Exit fullscreen mode

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

The post How to serve a JavaScript build with Apache appeared first on boobo94.

SurveyJS custom survey software

Simplify data collection in your JS app with a fully integrated form management platform. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more. Integrates with any backend system, giving you full control over your data and no user limits.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❀ or a friendly comment on this post if you found it helpful!

Okay