I want to use Markdoc, a system that converts markdown files into wiki pages. Markdoc comes with its own server. I created a new user for the wiki and put the wiki files into that user's home folder. My current (very inelegant) solution is to su into the markdoc user I and run this command, starting the server in the background:
markdoc serve -p 8577 2>/dev/null &
Then I exit back into my normal user. In my Nginx configuration, I have this section:
server {
listen 80;
server_name myserver.com;
location / {
proxy_pass http://127.0.0.1:8577;
}
}
This works, but I have the sneaking suspicion that it is not the accepted best practice. However, I don't know what I am looking for. Am I supposed to wrap the Markdoc server in some kind of init script? Does that make it a daemon? Can any program be a daemon, or does it have to be specifically designed for that?
I also don't think my terminology is entirely accurate. Any input would be greatly appreciated!