Introduction
This will show you the steps needed to create a custom startup file for ea-nodejs which overrides the default name of "app.js" which Passenger searches for.
Procedure
1)
Begin by creating an Apache include in the following location: (Be sure to replace $USER
& $DOMAIN
with the appropriate cPanel username and domain name)
/etc/apache2/conf.d/userdata/ssl/2_4/$USER/$DOMAIN.nodejs.conf
2)
Populate the file with the following information and modify it according to your needs:
DocumentRoot /user/example.com/public
# Use server.js as the startup file (entry point file) for
# your Node.js application, instead of the default app.js
PassengerStartupFile index.js
PassengerAppType node
PassengerAppRoot /nodejsapp/example.com
3)
Rebuild and restart the Apache configuration:
/scripts/rebuildhttpdconf && /scripts/restartsrv_httpd
For more details view our NodeJS documentation.