skip to Main Content

I am on Windows, and I compile my Angular project using Putty.
So I don’t use Git, and I don’t test my app locally.

Instead, I work directly on my server.

I try to follow this Hero tutorial: https://angular.io/tutorial/toh-pt0

I have compiled my project on my server like this:

cd freelancer
ng serve --host=0.0.0.0 --disable-host-check

It compiles successfully.

It is the only project on my server.

Now when I go to my website http://217.160.44.200/ it shows me the Plesk Start Page instead of my project:

enter image description here

I expected that going to the start page of my server would show me the app right away. However, it shows that Plesk start page.

Now when I go to http://217.160.44.200/freelancer or http://217.160.44.200/freelancer/index.html instead, it says "404 The requested URL was not found on this server."

This is what it looks like when viewed in an ftp program:

enter image description here

How could I actually view my project now?

2

Answers


  1. Chosen as BEST ANSWER

    MikeOne answered the question in the comment section, I would be glad if he posted the answer. Just in case he doesn't do it, I will write down his solution:

     ng build --prod
    

    This creates a folder named "dist". It contains all the necessary, compiled files including an index.html file.

    The contents of this "dist" folder should be put into the /var/www/html folder.


  2. Using ng serve –host 0.0.0.0 will allow you to connect to the ng serve using your IP instead of localhost. If you want to see in your local machine I would remove the –host 0.0.0.0 and just pass ng serve within the freelancer directory.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search