Deploy nodejs app, but existing document root

MayorqueDev

Registered
Oct 7, 2020
1
0
1
Mexico
cPanel Access Level
Root Administrator
I need to deploy a nodejs application, so I need to config a proxy pass with apache, the thing is that in that domain has already a document root with an autogenerated index (and I need a proxy pass instead). So i've been searching for the configuration file that set that document root for that domain, and I cant found it, the /etc/apache2/conf/httpd.conf file have comments that say that file is autogenerated and I should add files to /etc/apache2/conf.d/includes path instead.

I've tried to write a file in the includes path to set the proxy pass but when I reload httpd.service the autogenerated index is still there
I think that cpanel is writing in the httpd.conf file to set the document root, how can I stop cpanel doing that?
 

cPanelJamesW

Linux Technical Analyst I
Staff member
Mar 13, 2018
24
1
78
Houston
cPanel Access Level
Root Administrator
Greetings,

It sounds as though you would like to alter a single domain's vHost, we have some great information on doing so here:

Once you have made the desired changes to the domain's vHost, the configuration will need to be rebuilt. I recommend first making a copy of the file:
Code:
cp -via /etc/apache2/conf/httpd.conf{,.$(date +%s).bak}
This makes a copy of the file with an epoch timestamp for reference and provides a method for reverting the change should Apache fail to start after the include has been added.

You can then rebuild the Apache configuration file with:
Code:
/scripts/rebuildhttpdconf
Finally, you can then restart the service with:
Code:
/scripts/restartsrv_httpd
Alternatively, CloudLinux does include a NodeJS selector to help with the deployment of NodeJS apps. More information on that can be found here:

Thanks!