Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy Angular 5 application on Linux Server

I am new to deploying angular application on Linux, I used to do it on IIS which was pretty simple. I have a Linux server which I access through Putty. I want to deploy my angular 5 application on this server. I have performed following steps till now

  1. Run ng build --prod
  2. Copy the files in dist folder on one of the folder on linux server through pscp

Now, when I am trying to access the folder like http://hostname/folderPath/index.html, nothing comes up. I know I am missing some steps, could anyone please help me in deploying the application.

like image 644
Gagan Jaura Avatar asked Aug 02 '26 02:08

Gagan Jaura


1 Answers

Just remove the base tag from index.html that's it

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Angular App</title>
<base href="/">
Some more code
Don't do anything to this

After Removing Your code will like this

    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>Angular App</title>
    Some more code
    Don't do anything to this
like image 127
nitishk72 Avatar answered Aug 04 '26 16:08

nitishk72