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
- Clone the complete project repository on the server.
- Install the dependencies using
- To deploy, start the production build using
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.
- 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
Post a Comment