Introduction
If you are accessing your NodeJS Application using port 8081 instead of the Apache secure port of 443, you will receive a warning that the connection is insecure. Apache does not listen on port 8081, and the SSLs installed are not accessible by default. The following procedure can show you how to copy the SSL from Apache to NodeJS.
Procedure
- Make sure the application is already registered in cPanel. The instructions here will show you how to accomplish this:
How to install a Node.js application - Copy the application's configuration file from the source into Apache's SSL configuration. In the command below, replace "$user" with the account's username, "$domain" with the domain name including the TLD, and "$application" with the registered name of your Node JS Application:
cp -a /etc/apache2/conf.d/userdata/std/2_4/$user/$domain/$application.conf /etc/apache2/conf.d/userdata/ssl/2_4/$user/$domain/$application.conf
- Rebuild the Apache configuration
/usr/local/cpanel/scripts/rebuildhttpdconf
- Restart the Apache service
/usr/local/cpanel/scripts/restartsrv_httpd