'ionic serve' fails on AWS EC2 RHEL8; possible security group issue

  1. Symptom: Command ‘ionic serve’ fails on AWS EC2 instance with RHEL 8. The browser says the connection is refused.

  2. Message:

> ng run app:serve --host=localhost --port=8100
[ng] ℹ 「wds」: Project is running at http://localhost:8100/webpack-dev-server/
[ng] ℹ 「wds」: webpack output is served from /
[ng] ℹ 「wds」: 404s will fallback to //index.html

Additionally, the same message comes out when I successfully ran the same command on Win 10; but there were some more like below:

[ng] chunk {common} common.js, common.js.map (common) 22.9 kB  [rendered]
[ng] chunk {core-js-js} core-js-js.js, core-js-js.js.map (core-js-js) 77.9 kB  [rendered]
[ng] chunk {css-shim-3ea8955c-3ea8955c-js} css-shim-3ea8955c-3ea8955c-js.js, css-shim-3ea8955c-3ea8955c-js.js.map (css-shim-3ea8955c-3ea8955c-js) 20.7 kB  [rendered]
  1. IONIC info:
   Ionic CLI                     : 5.2.5 (/usr/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.7.1
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0


   cordova-res : not installed
   native-run  : not installed


   NodeJS : v10.14.1 (/usr/bin/node)
   npm    : 6.4.1
   OS     : Linux 4.18
  1. Security group on AWS:
    Inbound: HTTP 80 and SSH 20 to my computer IP and TCP 8100 to all IPs.
    Outbound: HTTP 80 and TCP 8100 to all IPs.

Does anyone have an idea to check out what make the problem? Any comment will be appreciated.

In RDP Windows usually passes these errors, enters the rdp and enters the firewall and opens those ports from the firewall as well and that should solve the problem.

Good luck :smiley:

This maybe help…

Delete this two folders in your project… Theses are created will start the app…

platforms end www

Sometimes the error is solved!