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!
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!
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
You should be using a reverse proxy which connects the domain to the node app. I would recommend setting up Nginx as a reverse proxy, so it handles all the domain stuff. You can follow the bottom part of this guide, but just use 127.0.0.1 as IP, since you only have a single server (from what I can understand). https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-centos-7
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.
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.