Deploying Angular 7 Application with Apache on Amazon EC2 Ubuntu Server: A Step-by-Step Guide

Deploying Angular 7 Application with Apache on Amazon EC2 Ubuntu Server.

Prerequisites to Install

Install Node Package Manager

Install Nodejs


Install the Angular CLI


Install Apache




After successful installation. Follow the below steps
  1. Clone the complete project repository on the server.
  2. Install the dependencies using

  3. To deploy, start the production build using

    An output folder (dist/ by default) will be created on the server.
  4. Change the Apache root to your project directory, specifically /dist/ng7/.
  5. Enabled mod_rewrite, and restarted Apache.

  6. And finally, add this .htaccess inside dist/ng7 directory.
    </ifmodule mod_rewrite.c="">
        RewriteEngine On
        RewriteBase /
        RewriteRule ^index\.html$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.html [L]
    </ifmodule>
    


Comments

Popular posts from this blog

Using Redis in PHP for handling background Jobs

DrillDown using Flot Charts

Securely setting Files and Folder permissions on Laravel 5