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 sudo apt install npm Install Nodejs sudo apt install nodejs Install the Angular CLI sudo npm install -g @angular/cli Install Apache sudo apt-get install apache2 After successful installation. Follow the below steps Clone the complete project repository on the server. Install the dependencies using sudo npm install To deploy, start the production build using ng build --prod An output folder (dist/ by default) will be created on the server. Change the Apache root to your project directory, specifically /dist/ng7/. Enabled mod_rewrite, and restarted Apache. sudo a2enmod rewrite sudo serivce apache2 restart And finally, add this .htaccess inside dist/ng7 directory. </ifmodule mod_rewrite.c=""> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !...