I have a simple Meteor web app that I am trying to host on my own server. Server details;
- Debian (Jessie) Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt2-1 (2014-12-08) x86_64 GNU/Linux
- systemd
- NodeJS version 0.10.36
- Meteor version 1.0.3.1
- MongoDB version 2.6.7
/etc/systemd/system/customwebapp.service file;
[Service]
ExecStart=/usr/bin/node /opt/customwebapp/bundle/main.js
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=customwebapp
User=customwebapp
Group=customwebapp
Environment=NODE_ENV=production MONGO_URL='mongodb://localhost'
[Install]
WantedBy=multi-user.target
I create the service account using;
sudo useradd -mrU customwebapp
I build the Meteor app using;
sudo meteor build --directory /opt/customwebapp
cd /opt/customwebapp/programs/server
sudo npm install
I try to register the service with;
sudo systemctl enable customwebapp
sudo systemctl start customwebapp
Syslog reports the following;
/opt/customwebapp/bundle/programs/server/node_modules/fibers/future.js:173
Error: URL must be in the format mongodb://user:pass@host:port/dbname
at Error (<anonymous>)
I have tried for hours to fix this problem. I have used a number of different MONGO_URL values. I created an admin or root user in MongoDB using the mongo command and put the user:pass@localhost:27017/customwebapp format into the URL environment variable.
No matter what I do it comes back with the same error.
I have also tried using Meteor Up but it seems to configure Upstart not systemd.
And it goes without saying, I have tried a large number of solutions from SO. Not all of the solutions I have tried are listed here.
I suspect the reason I am having issues is because of systemd.
This is my first question on SO because, to be honest, most problems I have somebody else has had the issue before me. SO is brilliant for helping me and has many times. Now I'm hoping SO will help again.
Thanks for taking the time to help.