Hi,
I have just installed nodejs, and I have a script running that is listening on port 1337
ie.
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337);
console.log('Server running at 1337/');
I have run:
iptables -F
iptables -A INPUT -p tcp -m tcp --dport 1337 -j ACCEPT
I did - and stiil do have apache running. And there is an SSL certificate operating on the Ubuntu server.
https://xxx:1337 (where xxx is known by the SSL cert) says ‘This webpage is not available’.
Of course, https://xxx brings up the page via apache.
Can I access nodejs while apache is running? What am I missing here?
Colin G
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Here is the nmap output:
Starting Nmap 5.21 ( http://nmap.org ) at 2014-10-25 11:57 UTC Found no matches for the service mask ‘lunt’ and your specified protocols QUITTING!
https://xxx:1337 (where xxx is known by the SSL cert) says ‘This webpage is not available’.
You are accessing port 1337 on your server, which goes directly to your nodejs app. Your app isn’t configured to use SSL, so you’ll get an error when you try to access it via https://.
In this case I would recommend using Apache as a reverse proxy to your nodejs app which will also serve as an SSL termination proxy so your app wouldn’t have to know anything about SSL – it would just work.
See How To Use Apache HTTP Server As Reverse-Proxy Using mod_proxy Extension | DigitalOcean.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.