• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Nodejs App error EACCES on port 80

MiSuisse

New Pleskian
Server operating system version
Windows 2022 Datacenter
Plesk version and microupdate number
Plesk Obsidian 18.0.48
[details="System Information"]
Strapi Version: 4.4.5
Operating System: Windows 2022 Datacenter + Plesk Obsidian 18.0.48
Database: MariaDB 10.6.9
Node Version: 16.16
NPM Version: 8.19.2
Yarn Version: N/A
[/details]

-> server.js
JavaScript:
module.exports = ({env}) => ({
  host: '0.0.0.0',
  port: 8081,
  app: {
    keys: env.array('APP_KEYS'),
  },
});

-> package.json
JSON:
  "dependencies": {
    "@strapi/plugin-i18n": "4.4.5",
    "@strapi/plugin-users-permissions": "4.4.5",
    "@strapi/strapi": "4.4.5",
    "better-sqlite3": "7.4.6",
    "cross-env": "^7.0.3",
    "mysql": "^2.18.1"
  },
  "engines": {
    "node": ">=14.19.1 <=18.x.x",
    "npm": ">=6.0.0"
  },

---

Hi,
if use port 8081, application run in localhost:8081, but if use my domain xyz.com:8081, i have this error :

-> localhost : 80
JavaScript:
$ npm run-script start

> [email protected] start
> strapi start


 Project information

┌────────────────────┬──────────────────────────────────────────────────┐
│ Time               │ Tue Jan 10 2023 16:05:06 GMT+0100 (heure normal… │
│ Launched in        │ 1628 ms                                          │
│ Environment        │ development                                      │
│ Process PID        │ 11532                                            │
│ Version            │ 4.4.5 (node v16.19.0)                            │
│ Edition            │ Community                                        │    

Actions available                                                                   

Welcome back!
To manage your project , go to the administration panel at:
http://localhost:8081/admin

To access the server , go to:
http://localhost:8081


-> xyz.com : 8081
Code:
HRESULT: 0x2
HTTP status: 500
HTTP subStatus: 1002
HTTP reason: Internal Server Error
Application has thrown an uncaught exception and is terminated:
TypeError: process.send is not a function
    at Strapi.stop (E:\plesk\vhost\xyz.com\strapi-demo.xyz.com\node_modules\@strapi\strapi\lib\Strapi.js:321:15)
    at Strapi.stopWithError (E:\plesk\vhost\xyz.com\strapi-demo.xyz.com\node_modules\@strapi\strapi\lib\Strapi.js:314:17)
    at Server.<anonymous> (E:\plesk\vhost\xyz.com\strapi-demo.xyz.com\node_modules\@strapi\strapi\lib\services\server\http-server.js:31:21)
    at Server.emit (node:events:513:28)
    at emitErrorNT (node:net:1490:8)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

if change for port 80, localhost & online not runing, i have this error :

-> localhost : 80
Code:
$ npm run-script start

> [email protected] start
> strapi start

[2023-01-10 16:02:29.555] error: listen EACCES: permission denied 0.0.0.0:80
Error: listen EACCES: permission denied 0.0.0.0:80
    at Server.setupListenHandle [as _listen2] (node:net:1446:21)
    at listenInCluster (node:net:1511:12)
    at doListen (node:net:1660:7)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)

-> xyz.com : 80
Code:
(node:10548) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
 
The way you worded this doesn't make too much sense what you're trying to achieve but will try to give you some general guidance.

First of all, you can't run applications on ports lower then 1024 without running them as administrator since they're considered well-known ports and assigned to specific applications. This means you would need to run your application on ports 1025 and above to avoid the permission denied.

Also, Plesk does have built in support for running Node Applications, so you might want to make sure you have it configured to run with the default settings as localhost, then this way you can have plesk configure to pass the request (like port xyz.com port 80 to localhost port 8081).
 
I understand that this is not very clear.

my topic presents two examples, a launch of the application on port 80, and on port 8081;

port 80 is necessarily open for the web.
I understand that nodejs cannot open an additional service on port 80, but plesk does not run the application natively.

i want to run this application as a standard web application on port 80. but i can't find how to run it correctly
 
I mean, technically speaking, you could run it on port 80 still but you would need to run the application as and administrator which is not safe to do. Plesk should have a native way of letting you run the application through it's interface using the default settings on port 8081 which should then let you proxy port 80 to port 8081. I just don't know how it's down on Windows since IIS is different compared to Apache and Nginx. Refer to the following articles to get some guidance for hosting a Node application:
 
thanks, no problem with deployment for nodejs.

by adding the reverse proxy it works,
but i never needed to do this before with my other applications in vuejs/nuxtjs/nextjs
they are shared and globally developed on port 80 / 3000
 
Back
Top