Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:cloudlinux:node.js_selector [2018/05/23 10:34]
Tihomir
litespeed_wiki:cloudlinux:node.js_selector [2023/03/25 13:38] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== How to use CloudLinux Node.js Selector with LSWS ====== +~~REDIRECT>​https://​docs.litespeedtech.com/lsws/cp/cpanel/cloudlinux/#​rubypythonnodejs-selector~~
- +
-As JavaScript became one of the most popular programming languages, more and more customers demand Node.js hosting. CloudLinux Node.js Selector was introduced to facilitate the performance related to Node.js. ​ LSWS added CloudLinux Node.js Selector support starting from 5.3RC1 release. +
- +
-===== LSWS Node.js Selector support out of the box  === +
- +
-Node.js Selector from Cloudlinux is supported by Litespeed Web server out of the box. You will need only to setup correctly the CloudLinux Node.js selector. You can refer to [[https://​docs.cloudlinux.com/index.html?​nodejs_selector.html|CloudLinux official documentation]]. +
- +
- +
-===== How to test Node.js with LSWS ===== +
- +
-You can create file with the name index.js and content: +
- +
-<​code>​var http = require('​http'​);​ +
-var server = http.createServer(function(req,​ res) { +
-    res.writeHead(200,​ {'​Content-Type':​ 'text/plain'​});​ +
-    var message = 'It works!\n',​ +
-        version = '​NodeJS ' + process.versions.node + '​\n',​ +
-        response = [message, version].join('​\n'​);​ +
-    res.end(response);​ +
-}); +
-server.listen();​ +
-</code> +
- +
-Point your browser to http://domain.com/​index.js +
- +
-The result is: +
- +
-{{:​litespeed_wiki:​cloudlinux:​nodejs.png?​400|}} +
- +
-===== Troubleshooting ===== +
- +
-If you see only the code of the file like this: +
- +
-{{:​litespeed_wiki:​cloudlinux:​nodejstb.png?​400|}} +
- +
-you need to check from cPanel ​-> NoteJS ​selector ​if your application is start. You can start it from there or restart. If you still see only the source code make sure that your server is running Litespeed web server version 5.3 or higher.  +
- +
  • Admin
  • Last modified: 2018/05/23 10:34
  • by Tihomir