Answer the question
In order to leave comments, you need to log in
How to properly set up virtualbox + nodejs local development environment?
I decided to try the capabilities of nodejs, but in order not to use it from under Windows, I installed it on virtualbox centos7, connected to the guest OS via ssh 192.168.137.125:22, installed nodejs, initialized the project folder, wrote the code from the tutorial into the file
var http = require('http');
var server = http.createServer(function(req, res) {
res.writeHead(200, {"Content-Type": "text/html"});
res.write('<!DOCTYPE html>'+
'<html>'+
' <head>'+
' <meta charset="utf-8" />'+
' <title>My Node.js page!</title>'+
' </head>'+
' <body>'+
' <p>Here is a paragraph of <strong>HTML</strong>!</p>'+
' </body>'+
'</html>');
res.end();
});
server.listen(8080);
console.log(server);
Answer the question
In order to leave comments, you need to log in
https://stackoverflow.com/a/13752409/3544196
Need to "dig a hole" in the firewall
Save config
Restart iptables
Now try to open your project in a browser
Vagrant is
suitable for local development , after installation you select the appropriate box and go ahead. It greatly simplifies the work with a virtual machine and is optimized specifically for creating and managing a local infrastructure environment for the developer.
Alternatively, you can use Docker, where the approach is completely different, but there is a little more manipulation during development. But for installation on a server, just the same, Docker with its concept (one process per service / server, painless software upgrade, etc.) is much better suited.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question