This repository will help you to install/uninstall prerender as a system services on a linux machine using System V init scripts.
By using this installer you will be able to start/stop a prerender instance as service (daemon):
sudo service prerender start|stop|restart
The installer assumes you've already installed node.js, npm
Just clone the repository with
git clone https://github.com/lmammino/prerender-daemon.git
Then run
sudo prerender-daemon/install.sh
and it will do all the following hard work for you:
- Install prerender as global package
- Creates a dedicate
prerender
user that will be used to run the daemon - Adds an init script to start the daemon
- Starts the daemon
The installation command support few parameters:
-h
or--help
: Display the help-v
or--verbose
: more verbose output-u
or--uninstall
: Act as an unistaller removing prerender-daemon-p
or--node-prefix
: specify a custom node prefix (eg. "/usr")-s
or--server-script
: specify a custom server script that will be used to replace the default launch script (eg. to provide a custom configuration)
If you want to provide a custom script to run your prerender server (with custom configuration variables and plugins) you can use a custom server.js
file (you have an example on config/server.js.dist
) and pass its path as --server-script
parameter to the installer script. This file will be copied and substituted to the default server.js
script in your node_modules
folder.
Just run
sudo prerender-daemon/install.sh --uninstall
To clean up everything that has been installed previously
This code is distributed under the MIT license. Please refer to the LICENSE file to read the full version.
Contributions are always (and really) appreciated ๐