I have an Apache web server running on my ubuntu server. I recently tried to learn JavaScript, and I came across node.js. I would like to create some multiplayer games for web applications, and I found out that node.js can come in handy. I am having problems with the configuration. How will I run both apache and node.js servers on the same computer? I do not mind if the applications on node.js are on a different port and should be accessible by entering the server_name: portNumber in the file. I'm not too concerned about performance advantages / disadvantages, I just want to take the opportunity to try JavaScript and node.js. Are there any files that need to be changed?
Here is the code that I have for the script running on the server (only for its use at the moment):
var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(1337);
I started the server (node ββfileName.js). However, when I try to access it with another client computer on the network, it does not seem to work because the page does not seem to exist.
What is the procedure so that I can get Hello World for my browser when I visit the server on port 1337?
source share