Nodejs on Nearlyfreespeech?

I am browsing an existing website deployed on an NFS server. I would like to rewrite some of its parts to work on nodes. As far as I can tell, nodejs is not supported by the NFS file, but I have to use their servers.

So, is there a way for novice nodal nodes on a server with near resolution? Has anyone tried this successfully?

+6
source share
3 answers

As of September 24, 2014, NFS now supports ongoing processes:


To summarize the process described in the mopsled.com third-party example:

1) In the user interface of the NFS.N administrator, select the short domain name of the site in the " Sites" section, and then change the "Server Type" of this site to "Custom" instead of PHP / Apache.

2) Put your Node server code somewhere in /home/protected/

3) Create a shell script file (e.g. run.sh ) somewhere in /home/protected/ that contains the commands to start your server (e.g. npm run start or node server.js ). NFS.N will automatically run this script as a continuous process using the "Daemon", which we will configure in the next step.

4) Select "Demons" in the NFS.N user interface of your site and enter the path to the shell script to start your server in the "Command line" field. Fill in the other fields as you see fit.

5) NFS.N now guarantees that your user server process will run indefinitely. Your web server will now be accessible through the port that your server is listening on. However, NFS.N does not provide root access to your server for communication through regular "low-level" Internet ports (for example :80 and :443 ), so if you want to service them, you must use NFS.N ". Function proxy "is described in the next step.

6) If you need to listen to low-level ports: select "Add proxy" in the NFS.N user interface of your site and enter the appropriate parameters, checking the "Bypass Apache completely" option and providing the port that your server is listening on. for Target Port.

It! Now you can stop / restart the continuous server process (the shell script that the daemon supports) on the daemon configuration page.

+6
source

NFS.net has a new NFGI architecture that can open this opportunity:

NFGI can be made to work with other languages, making them first-class citizens of our service, as fast and integrated as PHP is currently. This paves the way for creating all kinds of wireframes that have traditionally been too slow to go through CGI. Rails Catalyst. Django We also believe that this can be used to make node.js work on our service, but are not 100% sure about it.

(Source: http://blog.nearlyfreespeech.net/2013/09/21/cgissh-upgrades/ )

If you want this feature, you can vote for it in your feature request system https://members.nearlyfreespeech.net/support/voting

Although, to be honest, I agree with the earlier answers, using Node through CGI will lose some of the benefits ... but it won’t be without its charms. Something like http://larsjung.de/node-cgi/ for NFS.net would be an interesting JavaScript replacement for PHP.

+2
source

The problem is not that NFS.net does not support NodeJS. The fact is that you cannot have “lengthy processes”, that is, servers. Since you cannot start servers, you cannot start Node.

In fact, the only way you can have anything dynamic is to use CGI. There is no reason why the Javascript engine could not be used to generate pages in response to requests, but I'm not sure that this can be done using Node.

+1
source

Source: https://habr.com/ru/post/897050/


All Articles