From f7caccbd6007e088f376aa1b761e0a05506bd4d4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 16 Jan 2018 16:11:53 +0100 Subject: [PATCH] Destroyed Ubuntu 16 Production Installation Guide (markdown) --- Ubuntu-16-Production-Installation-Guide.md | 107 --------------------- 1 file changed, 107 deletions(-) delete mode 100644 Ubuntu-16-Production-Installation-Guide.md diff --git a/Ubuntu-16-Production-Installation-Guide.md b/Ubuntu-16-Production-Installation-Guide.md deleted file mode 100644 index 22c3042..0000000 --- a/Ubuntu-16-Production-Installation-Guide.md +++ /dev/null @@ -1,107 +0,0 @@ -Credit: https://github.com/Chocobozzz/PeerTube/issues/33 - -# Dependencies -We need to install dependencies: - - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - - sudo add-apt-repository ppa:jonathonf/ffmpeg-3 - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list - sudo apt-get update - sudo apt-get dist-upgrade - curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - - sudo apt-get install -y nodejs ffmpeg postgresql-9.5 openssl nginx yarn g++ make - -# Database -We need to create the database: - - sudo -u postgres createuser -P peertube - sudo -u postgres createdb -O peertube peertube_prod - -# User -We need to create the peertube user: - - sudo useradd -m -d /home/peertube -s /bin/bash -p peertube peertube - -And set its password: - - sudo passwd peertube - - -# Build PeerTube application -Master branch is for production, develop branch is for... development. - - sudo su - peertube - cd /home/peertube - git clone -b master https://github.com/Chocobozzz/PeerTube - cd PeerTube - yarn install - npm run build - -# Configuration files -Copy the production configuration file template: - - sudo su - peertube - cd /home/peertube/PeerTube/config/ - cp production.yaml.example production.yaml - mv default.yaml default.yaml.bak - ln -s production.yaml default.yaml - vim production.yaml - -# Webserver - -Create the TLS certificate. (TODO: instructions to install using Let's Encrypt. For now, direct them to https://letsencrypt.org/) - -Copy the nginx configuration template: - - sudo cp /home/peertube/PeerTube/support/nginx/peertube-https /etc/nginx/sites-available/peertube - -Modify the configuration file: - - sudo vim /etc/nginx/sites-available/peertube - -Active the configuration file: - - sudo ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube - sudo systemctl reload nginx - -# Systemd -Copy the service file: - - sudo cp /home/peertube/PeerTube/support/systemd/peertube.service /etc/systemd/system/ - -Update the service file: - - sudo vim /etc/systemd/system/peertube.service - -It should look like this: (Note what `Working Directory` is set to) - - [Unit] - Description=PeerTube daemon - - [Service] - Type=simple - Environment=NODE_ENV=production - User=peertube - Group=peertube - ExecStart=/usr/bin/npm start - WorkingDirectory=/home/peertube/PeerTube/ - StandardOutput=syslog - StandardError=syslog - SyslogIdentifier=peertube - Restart=always - - [Install] - WantedBy=multi-user.target - -Then tell systemd to reload its config: - - sudo systemctl daemon-reload - -# Run PeerTube - - sudo systemctl start peertube - sudo journalctl -feu peertube - -The output from starting peertube for the first time will include the credentials for your instance's administrative account, and this information will not be repeated. Make note of it. - - sudo systemctl enable peertube \ No newline at end of file -- 2.25.1