Question

I have 3 websites each running a different application I produced using socket.io and/or node.js. I need help with SSL/HTTPS setup for them.

The server is mine and has 64G, 8TB, 8 i7’s and is running over 100 domains on a single IP. I use cloudflare for SSL for most of them. My problem is this… in order to run my apps, currently I have to use https://<hostIP>:port to access them. I need to be able to access them through the domain they are intended for… as in… https://domainname:port or https://www.domainname:port. I have CenTOS7, WHM, cPanel and a loooong time ago was a good linux admin and DNS guy, but I’m really feeling out-of-date today. If someone could either give me a 1,2,3 step by step procedure to do what I need to do or do it for me on the cheap, I’d really appreciate it!


Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @jtittle, I planned to test the integration of Node.js/Node-RED in an application developed by my company. It’s a LAMP environment application with extensive use of js.

Now we need to test Node.js/Node-RED but, our servers are all on WHM/cPanel infracstructure.

I really interesting about your suggestion. Make use of DigitalOcean to implement and test the Node part and, if it’s possible, let it collaborate with the platform instance hosted on our server.

When the test end successfully, build a new dedicated server without any panel (I have enough skill on *nix and Bash) and rebuild the production environment.

Could you lead us into this scenario? on the System side, of course :)

Maurizio

I appreciate the lengthy response and it makes a lot of sense. However, I am using apache2 (easyapache4 through cpanel) and have no knowledge of nginx, nor how to set up a droplet at digitalocean. My node stuff runs fine, with the exception of the issues described. Also, if I go the droplet route, it increases my costs… and… my apps, though peer-to-peer, might someday have a high user load. Can you or someone reading this thread help me with any solution so I don’t have to do it myself and not charge me an arm and a leg, as it were? I don’t mind paying for help, but have already invested most of my savings in this project.

@jjosserand

When it comes to cPanel, tasks that would normally be relatively simple on a server running Apache or NGINX become more of a headache as cPanel doesn’t currently support NodeJS. Installation on a cPanel server would most likely void any support from their team as well.

The post below was updated 8 months ago stating that it’s on their radar, not their roadmap.

https://features.cpanel.net/topic/nodejs-hosting

So what can you do? Well, you could install NGINX in front of Apache using Engintron. NGINX would act as a reverse proxy to Apache. As long as you can modify server blocks, you could turn the block created for each site in to a reverse proxy for the NodeJS app. This, again, however, would not be supported by cPanel and may also void support from their team because it’s not stock.

Engintron: https://engintron.com/

General Warning

The above script would be install at your own risk. Since you have over 100 domains on the server, I would highly recommend testing the above on a non-production server first.

Since cPanel won’t provide support for third-party modifications, you’d be on your own if something screws up.

Other Options

If you need to run NodeJS, you’d be far better off deploying a Droplet here at DigitalOcean and then installing NGINX + NodeJS on the Droplet and skip Apache altogether. It’s far easier to do a simple setup than it would be to modify an existing production cPanel server – you’re also mitigating risk.

Running NGINX as a reverse proxy to NodeJS apps is really simple and takes very little time to get up and running. You’d simply install NodeJS, make sure your apps are responding on the port they should be and then you could setup the proxy with NGINX and boom, no port in the URL.

Setting up SSL on NGINX is also pretty simple. The longest part of the process is really generating the certificates – more so if you don’t use LetsEncrypt, but if you do, then it’s pretty quick altogether.