0

How should we need to run Node.js app especially, from the Web Interface causes Error:403 & 500 Server Error

  • Document Root Application will not work because document root is not a subchild of application root

enter image description here

After setting the Document Root to point to the Application Root structure error disappeared

enter image description here

  • Without even enabling the Node.js startup button

enter image description here

  • After Enabling the Node.js startup button

enter image description here

Got 500 Internal Server Error

When logging from the SSH and running from the terminal it did worked without causing any server error

root@user:/var/www/vhosts/somedomain/httpdocs/app# node app.js
Listening on http://127.0.0.1:5000
Connected!
^C
root@user:/

and the same code was up and running from Heroku server after allowing remote connections from any host to access our server's database

  • Node.js Version: 9.10.1
  • Plesk Onyx 17.8.11

How should we need to configure the Plesk Onyx panel. So that Forbidden(403) Error & Internal Server Error(500) should be vanished?

  • 403 is generally caused by permissions so ensure you have chmod 0644 on the folder that has the JS. – Simon Hayter Jan 26 at 11:26
  • For the directory, permission is set with 755 (rwx r-x r-x) & for *.js file it is set with 644 (rw- r-- r--) @SimonHayter – Nɪsʜᴀɴᴛʜ ॐ Jan 26 at 11:34
0
  • 403 Forbidden: The node.js application shows the following error if PHP support is set as PHP FPM handler served by nginx in Domains > example.com > PHP Settings:

  • The following error may be found in /var/www/vhosts/example.com/proxy_error_log and in /var/log/httpd/error_log

Reason:

Plesk does not support the scenario when PHP-FPM is being used along with Node.js on the same domain.

Solutions:

  1. If it is necessary to have both PHP and Node.js, it is recommended to use separate subdomains for each application. For example, a site with PHP application — www.example.com, chat as Node.js application — chat.example.com. and PHP-FPM is faster when compared to the FastCGI especially in this context with Plesk Onyx panel.

  2. Otherwise, change handler type from FPM to the FastCGI under Domains > example.com > PHP Settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.