Argp / Docs / Nnpy / Setup
Nnpy requires packages under Debian distribution (similar packages for other distributions).
After installing packages, create a virtual environment under the root directory of Nnpy and activate it.
Now, install Python modules which are used by Nnpy.
The packages marked as “Build Only” in the list above are required to build the dependencies and can be uninstalled later.
Now we need to create a database with the
pastes table with two columns for
Nnpy is ready to run now. It can be run directly by starting the web server. Alternatively, it can create a UNIX socket which can be used by proxy servers like Nginx to proxy the web requests to Nnpy. The
wsgi.ini file handles the configuration. Default settings will run it in HTTP mode and start web server which will listen at port 5000.
Execute the subsequent command to test
uwsgi in place.
Systemd, which is the default init system and service manager in a lot of popular Linux Distributions, use service files to manage services. Please create a new file with the following content and save it as
[Unit] Description=nnpy paste After=network.target [Service] WorkingDirectory=/path/to/nnpy/ Environment='PATH=/path/to/nnpy/env/bin' ExecStart=/path/to/nnpy/env/bin/uwsgi --ini nnpy.ini Restart=on-failure RestartSec=5s KillSignal=SIGQUIT Type=notify StandardError=syslog NotifyAccess=all Group=www-data [Install] WantedBy=multi-user.target
To add the service file to Systemd, you need to copy the file into
Now, Systemd daemon needs to reload to recognize and process the service file.
Now the web app can be run by executing the following command.
To set the service to run on boot, execute the following command.