From ece6cafacba562939468ced146af7edbc5aca7dc Mon Sep 17 00:00:00 2001 From: Bigard Florian Date: Fri, 7 Apr 2017 09:41:24 +0200 Subject: [PATCH 1/1] Begin production installation guide --- ...an-Jessie-production-installation-guide.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Debian-Jessie-production-installation-guide.md diff --git a/Debian-Jessie-production-installation-guide.md b/Debian-Jessie-production-installation-guide.md new file mode 100644 index 0000000..5622749 --- /dev/null +++ b/Debian-Jessie-production-installation-guide.md @@ -0,0 +1,78 @@ +# Dependencies +We need to install dependencies: + + # echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/sources.list + # apt-get update + # apt-get upgrade -y + # curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - + # apt-get install -y nodejs ffmpeg postgresql-9.4 openssl nginx + # npm install -g npm@3 + +# Database +We need to create the database: + + # su - postgres + $ psql postgres + + CREATE USER peertube WITH PASSWORD 'peertube'; + CREATE DATABASE peertube_prod OWNER peertube; + GRANT ALL PRIVILEGES ON DATABASE peertube to peertube; + \q + +# User +We need to create the peertube user: + + # useradd -m -d /home/peertube -s /bin/bash -p peertube peertube + +And set its password: + + # passwd peertube + + +# Build PeerTube application +Master branch is for production, develop branch is for... development. + + # su - peertube + $ cd /home/peertube + $ git clone -b master https://github.com/Chocobozzz/PeerTube + $ cd PeerTube + $ npm install + $ npm run build + +# Configuration files +Copy the production configuration file template: + + $ cp config/production.yaml.example config/production.yaml + +Modify the configuration file: + + $ vim config/production.yaml + +# Webserver +Copy the nginx configuration template: + + # cp /home/peertube/PeerTube/support/nginx/peertube-https /etc/nginx/sites-available/peertube + +Modify the configuration file: + + # vim /etc/nginx/site-available/peertube + +Active the configuration file: + + # ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube + # systemctl nginx reload + +# Systemd +Copy the service file: + + # cp /home/peertube/PeerTube/support/systemd/peertube.service /etc/systemd/system/ + +Update the service file: + + # vim /etc/systemd/system/peertube.service + # systemd daemon-reload + +# Run PeerTube + + # systemctl start peertube + # journalctl -feu peertube \ No newline at end of file -- 2.25.1