Apollo Troubleshooting
OnSite Deployment
Customers have reported problems running Apollo as a service in Windows. The following methods have successfully been used as alternatives, with Method 1 being the preferred approach.
Note : You must upgrade your Apollo server to V6 in order to use OnSite V6.
Method 1
-
Install NSSM (https://nssm.cc/download). Download and extract into a directory, such as D:\directory\apps\nssm.
-
Open the command prompt and make sure to run as Administrator.
-
Go to NSSM Directory. For example, D:\directory\apps\nssm\win64
-
Run: nssm install Apollo "D:\directory\apps\nodejs\node.exe"
-
Run: nssm set Apollo AppDirectory "D:\directory\apps\apollo\src"
-
Run: nssm set Apollo AppParameters "index.js"
-
Run: nssm start Apollo
Method 2
-
Create a file in the root of the Apollo application folder called ApolloService.js
-
Paste the following into the file (make sure to update the script location)
//run Apollo as a windows servicevar Service = require('node-windows').Service;// Create Apollo Service objectvar svc = new Service({name:'Apollo',description: 'Apollo app run as a service',script: 'D:\\directory\\path\\onsite\\src\\index.js'});// Listen for the "install" event, which indicates the// process is available as a service.svc.on('install',function(){svc.start();}); svc.install();
-
Using CMD as Administrator run the following commands:
npm install -g node-windowsnpm link node-windowsnpm install node-windowsnode ApolloService.js
Linux Service
Install Service for Linux environment Apollo app to run as service
sudo nano /etc/systemd/system/apollo.service # Systemd unit file for Apollo [Unit] Description=Apollo app as service After=network.target [Service] User=ec2-user Type=simple ExecStart=/usr/bin/node index.js WorkingDirectory=/opt/apollo/ Restart=on-failure [Install] WantedBy=multi-user.target Reload and restart service sudo systemctl daemon-reload sudo systemctl enable apollo sudo systemctl status apollo sudo systemctl start apollo
