apt-get update\r\napt-get dist-upgrade\r\napt-get install unzip\r\n<\/code><\/pre>\nInstall JXCore<\/h3>\nAutomatically<\/h4>\n
The JXCore Team has provided a simple script for anyone to use which installs JXCore onto their system. It has been tested and works perfectly for Ubuntu, Debian, CentOS 7, and FreeBSD. To install JXCore, run the following command:<\/p>\n
curl http:\/\/jxcore.com\/xi.sh | bash\r\n<\/code><\/pre>\nIf you did not get an error, then you may proceed to the next step.<\/p>\n
Manually<\/h4>\n
If for some reason the script doesn’t work, or you wish to install it manually, then you will have to first download JXCore for your system. Please note this tutorial assumes 64-bit. If you are using 32-bit, you may need to check and make sure there is one available for your architecture and replace\u00a064<\/code>\u00a0with\u00a032<\/code>.<\/p>\nUbuntu:<\/p>\n
wget https:\/\/s3.amazonaws.com\/nodejx\/jx_ub64.zip\r\n<\/code><\/pre>\nDebian:<\/p>\n
wget https:\/\/s3.amazonaws.com\/nodejx\/jx_deb64.zip\r\n<\/code><\/pre>\nCentOS:<\/p>\n
wget https:\/\/s3.amazonaws.com\/nodejx\/jx_rh64.zip\r\n<\/code><\/pre>\nYou will now want to extract the file that you have downloaded and move the\u00a0jx<\/code>\u00a0executable file to\u00a0\/usr\/local\/bin<\/code>. Depending on which file you downloaded, replace\u00a0XX<\/code>\u00a0with\u00a0ub<\/code>\u00a0for Ubuntu,\u00a0deb<\/code>\u00a0for Debian,\u00a0rh<\/code>\u00a0for CentOS.<\/p>\nunzip jx_XX64.zip\r\ncd jx_XX64\r\nmv jx \/usr\/local\/bin\r\n<\/code><\/pre>\nIf you decide to move the\u00a0jx<\/code>\u00a0binary to a different location, then please make sure to create a link to\u00a0\/usr\/local\/bin<\/code>, or add your own path to the\u00a0PATH<\/code>\u00a0variable on your system.<\/p>\nVerify Installation<\/h3>\n
To verify a successful installation, run the following command:<\/p>\n
jx -e \"console.log('Hello World!');\"\r\n<\/code><\/pre>\nIf you see\u00a0Hello World!<\/code>, then JXCore has been successfully installed. If you wish to test the server usage, create a file called\u00a0server.js<\/code>\u00a0and populate it with the following:<\/p>\nvar http = require('http');\r\nhttp.createServer(function (req, res) {\r\n res.writeHead(200, {'Content-Type': 'text\/plain'});\r\n res.end('Hello World\\n');\r\n}).listen(1337);\r\nconsole.log('Server running on port 1337');\r\n<\/code><\/pre>\nOnce done, save the file and run\u00a0jx server.js<\/code>. Next, in your web browser, navigate to\u00a0http:\/\/0.0.0.0:1337<\/code>\u00a0(replace the IP accordingly) and you will see\u00a0Hello world<\/code>.<\/p>\nIf you wish to take advantage of one JXCore’s multi-threaded feature, run the following:<\/p>\n
jx mt-keep:2 server.js \r\n<\/code><\/pre>\nThis will spawn two processes on your server, which take advantage of 2 virtual CPUs. Note that if your server only has one CPU, then using the multi-threaded feature will not be beneficial. On the other hand, if your server has more than 2 virtual CPUs, you can increase the value of 2 to match the virtual CPU count.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[106,242],"manual_kb_tag":[403],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2705"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2705"}],"version-history":[{"count":2,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2705\/revisions"}],"predecessor-version":[{"id":2717,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2705\/revisions\/2717"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2705"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2705"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}