Installing Node.js
Node.js is not supported for the OpenLiteSpeed web server in the current version of ispmanager.
Node.js requirements
Node.js repositories must be accessible over HTTPS.
Node.js installation
- Log in to ispmanager with superuser permissions.
- Go to the Software configuration section.
- Select Node.js.
- Click
on the toolbar. - Confirm the installation.
- Wait for the installation to complete.
After installation, the panel will:
- connect the Node.js repository
- install npm and the latest LTS version of Node.js
- install pm2 to manage running projects
Next, proceed to user setup.
User setup
To enable a user to work with Node.js projects, enable the following options in their user settings:
- Access to Node.js
These options can be used when creating user templates.
Users with the ability to use Node.js are marked with the
icon in the Settings column.
This option can be dasibled if the user doesn't have any Node.js-enabled sites.
Uninstalling Node.js
Uninstalling is not possible if there are sites running Node.js in the control panel.
To uninstall Node.js:
- Log in to ispmanager with superuser rights.
- Go to the Software configuration section.
- Select Node.js from the list.
- On the toolbar, click
. - On the Settings page, uncheck Node.js.
- Click Save.
The control panel will uninstall Node.js and related software — npm, pm2.
Node.js technical details
When installing Node.js, the ispmanager panel downloads the ispmanager-pkg-nodejs package.
Request handling
A Node.js application is run via the process manager pm2, while the site's web server—Nginx, LiteSpeed, or Apache—acts as a reverse proxy, forwarding requests to it:
- Nginx: proxies dynamic content only, using the
ngx_http_proxy_module - LiteSpeed and Apache: proxy both static and dynamic content, including requests for non-existent files, using the
mod_proxymodule. The built-in LiteSpeed handler for Node.js is not used.
If both Apache and Nginx are installed on a server running ispmanager, Nginx handles and proxies all requests to the site; Apache is not used for the site in this configuration.
Exceptions to proxying
Requests to the following paths are not proxied to Node.js but are instead handled directly by the site's web server (LiteSpeed, Apache, or Nginx):
- the
/.well-known/acme-challengedirectory (used for Let's Encrypt validation) - the site statistics directory (if statistics collection is enabled)
- site redirects
- phpMyAdmin, phpPgAdmin, and Roundcube when accessed via the site's domain
In the Apache configuration files for phpMyAdmin, phpPgAdmin, and Roundcube (located at /etc/apache2/conf.d/ or /etc/httpd/conf.d/), an exception has been added next to the Alias directive to exclude the path from proxying—for example:
Alias /roundcube /usr/share/roundcube
<IfModule proxy_module>
<Location /roundcube>
ProxyPass !
</Location>
</IfModule>If access to the ispmanager control panel is configured via the website's domain, then HTTPS requests to the site are handled by the panel's built-in web server.
For more details on proxy configuration parameters, please refer to the official Apache documentation.
A block is added to the Apache configuration file for the site:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
<IfModule proxy_module>
ProxyRequests Off
ProxyPreserveHost On
<Location /.well-known/acme-challenge>
ProxyPass !
</Location>
ProxyPass / unix:/var/www/www-root/data/nodejs/0.sock|http://localhost/
ProxyPassReverse / http://localhost/
</IfModule>
<IfModule headers_module>
RequestHeader set X-Forwarded-Proto "http"
</IfModule>- The
Rewriteblock is added only if the site has HTTP-to-HTTPS redirection enabled, and it is placed exclusively within the HTTP host configuration:RewriteEngine on— enables themod_rewriteURL rewriting moduleRewriteCond %{HTTPS} off— checks whether the current request was made via the unencrypted HTTP protocolRewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge— creates an exception for the directory used to verify SSL certificates (e.g., for Let's Encrypt). Without it, Let's Encrypt would be unable to verify the site's domain over HTTP, preventing the issuance of a certificate.RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]— redirects all other HTTP requests to the same address, but usinghttps://. TheRflag indicates a redirect, while theLflag stops the processing of any subsequent rules
ProxyRequests Off— disables the use of Apache as a forward proxyProxyPreserveHost On— passes the originalHostheader (the site name) to the Python application<Location …> ProxyPass !— defines exceptions for proxying- Methods for connecting to Python:
ProxyPass / unix:<ПУТЬ_К_СОКЕТУ>|http://localhost/— a socket fileProxyPass / http://127.0.0.1:ПОРТ/— a port
X-Forwarded-Proto— indicates the connection protocol:httporhttpsProxyPassReverse / http://localhost/— replaces internal web server addresses with the actual domain name in responses from the Python application.
Node.js service directories
To ensure proper project operation, utility directories are created in the user directory:
/var/www/USERNAME_data/.npm/— npm package manager data/var/www/USERNAME_data/.nvm/— installed Node.js versions/var/www/USERNAME/data/.pm2/— pm2 process manager data
If you delete these directories, they will be recreated the next time you edit the site, though npm and pm2 may not function properly.
Node.js log
Select a project in the Sites section → click
→ in the context menu, click Log.
List of logs:
PROJECT_NAME-error.log— a file containing startup commands errorsPROJECT_NAME-install.log— a file containing the results of readingpackage.jsonand installing dependenciesPROJECT_NAME-out.log— a file containing the output of the new command and its entry in the Select a command from the list of available commandsPROJECT_NAME.access.log— a file containing information about the devices which the project was opened onPROJECT_NAME.error.log— a file containing projects launch errors