1. Home
  2. Languages
  3. How to Debug a Node.js, Ruby or Python Application

How to Debug a Node.js, Ruby or Python Application


On our N0C servers, we use Passenger to run your Node.js, Ruby and Python applications. When an error occurs in an application using one of these programming languages, a page like the one below will be displayed:

This page is not very explanatory. Activating the development mode will allow further investigation and find the cause of the problem. The detailed error display simplifies the analysis and correction of the problem.

Note :The Glossary of N0C contains explanations on multiple topics and can be consulted to clarify certain terms.

Activation of the Development Mode

In order to activate the development mode, you must modify the .htaccess file linked to your application. Warning: the folder containing the .htaccess file is not the same as the one containing the source files of the application.

  1. You can find the folder that contains the .htaccess of the application by going to the “File Manager” option of your N0C panel. On this page, you will be able to find all your domains as well as the root of the document linked to this domain (how).
  1. Once you have found the .htaccess file, you will be able to modify this file by editing it via the N0C file manager (how) and via FTP (how).
  2. You will find a section in the comments entitled “# DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION”. You should not modify the content between these lines. It is after this section that you will have to add the code necessary to activate the development mode. Here is the code to add:

PassengerFriendlyErrorPages on
PassengerAppEnv development

Note : If you want to disable the development mode after the problem has been fixed, just change these lines like this:

PassengerFriendlyErrorPages off
PassengerAppEnv production

  1. Once the development mode is activated, a detailed error page will be displayed and will allow you to know the error.
Updated on February 8, 2024

Related Articles