Author Topic: HowTO: Install nZEDb on Ubuntu 16.0.4  (Read 1008 times)

Offline digger

  • Junior Indexer
  • **
  • Posts: 13
  • Helpful: +2/-0
HowTO: Install nZEDb on Ubuntu 16.0.4
« on: 2017-08-22, 10:18:10 AM »
This is a Copy / Paste from different websites with instruction about installing nZEDb.
None of the websites have a 100% working install because they all missed some steps.
So I combined them all together to this after a lot of searching.
( just tested it now on a clean install and it works! - 22/08/2017 )

Last Edit : 25/08/2017



Step 0: Install Ubuntu 16.04 LTS

Just install

Step 1: Update Ubuntu 16.04 LTS

Code: [Select]
sudo apt-get update
Code: [Select]
sudo apt-get upgrade
Code: [Select]
sudo apt-get dist-upgrade
Step 2: Install Apache Web Server

Code: [Select]
sudo apt-get install apache2 apache2-utils
Code: [Select]
sudo systemctl start apache2
Code: [Select]
sudo systemctl enable apache2
Code: [Select]
sudo chown www-data /var/www/html/ -R
Step 3: Install MariaDB

Code: [Select]
sudo apt-get install mariadb-server mariadb-client
Code: [Select]
sudo systemctl start mysql
Code: [Select]
sudo systemctl enable mysql
Code: [Select]
sudo mysql_secure_installation
Quote
•   Enter Current Password : Just hit <Enter>
•   Set root Password : Enter a password – your password!
•   For the rest just Hit <Enter>

Step 4: Install PHP7

Code: [Select]
sudo apt-get –f install php7.0-fpm php7.0-mysql php7.0-common php7.0-gd php7.0-json php7.0-cli php7.0-curl libapache2-mod-php7.0
Code: [Select]
sudo a2enmod php7.0
Code: [Select]
sudo systemctl restart apache2
Code: [Select]
sudo apt-get –f install
Step 5: Configure MariaDB

Code: [Select]
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Quote
•   Add the following lines under[mysqld] section.

Code: [Select]
### configurations by nZEDb ####
innodb_file_per_table = 1
max_allowed_packet = 16M
group_concat_max_len = 8192

Quote
•   Save and close the file.

Code: [Select]
sudo systemctl restart mysql
Code: [Select]
sudo mysql -u root –p
Quote
•   create database nzedb;
•   grant all privileges on nzedb.* to 'nzedb'@'localhost' identified by 'your-password';
•   grant file on *.* TO 'nzedb'@'localhost';
•   flush privileges;
•   exit;

Code: [Select]
sudo apt install apparmor-utils
Code: [Select]
sudo aa-complain /usr/sbin/mysqld
Quote
•   If you get an error after the last command, ignore it !!

Step 6: Install some Tools

Code: [Select]
sudo apt-get install time unrar-free p7zip-full mediainfo lame ffmpeg libav-tools
Step 7: Install unrar

Code: [Select]
mkdir -p ~/new_unrar && cd ~/new_unrar
Code: [Select]
wget http://www.rarlab.com/rar/rarlinux-x64-5.5.0.tar.gz
Code: [Select]
tar -xzf rarlinux*.tar.gz
Code: [Select]
sudo mv /usr/bin/unrar /usr/bin/unrar4
Code: [Select]
sudo mv rar/unrar /usr/bin/unrar
Code: [Select]
sudo chmod 755 /usr/bin/unrar
Code: [Select]
cd ~/ && rm -rf ~/new_unrar

Step 8: Install yEnc

Code: [Select]
cd ~
Code: [Select]
mkdir yenc
Code: [Select]
cd yenc
Code: [Select]
wget https://ayera.dl.sourceforge.net/project/yydecode/yydecode/0.2.10/yydecode-0.2.10.tar.gz
Code: [Select]
tar xzf yydecode-0.2.10.tar.gz
Code: [Select]
cd yydecode-0.2.10
Code: [Select]
sudo apt install gcc make
Code: [Select]
./configure
Code: [Select]
make
Code: [Select]
sudo make install
Code: [Select]
cd ../..
Code: [Select]
rm -rf ~/yenc
Code: [Select]
wget https://github.com/niel/php-yenc/releases/download/v1.3.0/php7.0-yenc_1.3.0_amd64.deb
Code: [Select]
sudo apt-get –f install
Code: [Select]
sudo dpkg -i php7.0-yenc_1.3.0_amd64.deb
Step 9: Install nZEDb

Code: [Select]
sudo mkdir /var/www/nZEDb/
Code: [Select]
sudo chown www-data:www-data /var/www/nZEDb -R
Code: [Select]
sudo chmod g+w /var/www/nZEDb/ -R
Code: [Select]
sudo adduser username www-data
Quote
•   Log out for this change to take effect
Code: [Select]
sudo logout
Quote
•   Log in
Code: [Select]
sudo newgrp www-data
Code: [Select]
sudo apt install git
Code: [Select]
cd /var/www/
Code: [Select]
git clone https://github.com/nZEDb/nZEDb.git
Code: [Select]
sudo cp /var/www/nZEDb/_install/install.sh /var/www/
Code: [Select]
sudo chmod a+x /var/www/install.sh
Code: [Select]
sudo apt-get -f install php7.0-mcrypt php-imagick php-pear php7.0-curl php7.0-gd php7.0-json php7.0-dev php7.0-gd php7.0-mbstring php7.0-xml
Code: [Select]
cd /var/www/
Code: [Select]
sudo apt-get install curl
Code: [Select]
./install.sh
Code: [Select]
sudo nano /etc/apache2/sites-available/nzedb.conf
Quote
•   Put the following text into the file. Replace 127.0.0.1 with your Ubuntu server’s IP address. You can also use a domain name.

Code: [Select]
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName 127.0.0.1
    DocumentRoot "/var/www/nZEDb/www"
    LogLevel warn
    ServerSignature Off
    ErrorLog /var/log/apache2/error.log
    <Directory "/var/www/nZEDb/www">
       Options FollowSymLinks
       AllowOverride All
       Require all granted
    </Directory>
    Alias /covers /var/www/nZEDb/resources/covers
</VirtualHost>

Quote
•   Save and close the file

Code: [Select]
sudo a2dissite 000-default
Code: [Select]
sudo a2ensite nzedb.conf
Code: [Select]
sudo a2enmod rewrite
Code: [Select]
sudo systemctl reload apache2
Step 10: Change PHP.ini

Code: [Select]
sudo nano /etc/php/7.0/apache2/php.ini
Quote
•   Change the value of max_execution_time from 30 to 120.
o   max_execution_time = 120
•   Change the value of memory_limit from 128M to 1024M.
o   memory_limit = 1024M
•   Define a timezone like Europe/Brussels
o   date.timezone = Europe/Brussels

Code: [Select]
sudo nano /etc/php/7.0/cli/php.ini
Quote
•   Change the value of max_execution_time from 30 to 120.
o   max_execution_time = 120
•   Change the value of memory_limit from 128M to 1024M.
o   memory_limit = 1024M
•   Define a timezone like Europe/Brussels
o   date.timezone = Europe/Brussels

Step 11: Install tmux version 2

Code: [Select]
sudo apt install libevent-dev build-essential git autotools-dev automake pkg-config ncurses-dev
Code: [Select]
sudo apt remove tmux
Code: [Select]
git clone https://github.com/tmux/tmux.git --branch 2.0 --single-branch
Code: [Select]
cd tmux
Code: [Select]
./autogen.sh
Code: [Select]
./configure
Code: [Select]
make -j4
Code: [Select]
sudo make install
Code: [Select]
make clean
Step 13: Install Certificates

Code: [Select]
sudo wget -P /etc/ssl/certs/ http://curl.haxx.se/ca/cacert.pem
Code: [Select]
sudo chmod 744 /etc/ssl/certs/cacert.pem
Step 14: Run this before configuring nZEDb

Code: [Select]
mysql_tzinfo_to_sql /usr/share/zoneinfo | sudo mysql -u root -p mysql
Code: [Select]
cd /var/www/nZEDb/resources
Code: [Select]
mkdir tmp
Code: [Select]
cd /tmp
Code: [Select]
mkdir unrar
Code: [Select]
chmod 777 /var/www/nZEDb/resources
Step 15: Configure nZEDb

your-server-ip/install
or
your-domain.com/install

Step 16: Load PreDB

Code: [Select]
cd /var/www/nZEDb/cli
Code: [Select]
php data/predb_import_daily_batch.php 0 local true
Step 17: Setup IRCScraper

Code: [Select]
cd /var/www/nZEDb/
Code: [Select]
cp configuration/ircscraper_settings_example.php configuration/ircscraper_settings.php
Code: [Select]
nano configuration/ircscraper_settings.php
Quote
•   Change $username to the username you want.

Step 18: Run the Scripts in tmux

Code: [Select]
cd /var/www/nZEDb/misc/update/nix/tmux/
Code: [Select]
php start.php

Look @ it running  :o
« Last Edit: 2017-08-24, 11:33:59 PM by digger »

Offline Wally73

  • Overlord
  • ******
  • Posts: 251
  • Helpful: +27/-1
  • i'm nuts
Re: HowTO: Install nZEDb on Ubuntu 16.0.4
« Reply #1 on: 2017-08-22, 10:27:11 AM »
add the timezone values to MySQL's timezone tables

Code: [Select]
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -pyourpassword mysql
If you have an older install, you might also have to add the date.timezone setting to the php.ini file. Make sure to quote it.

Offline digger

  • Junior Indexer
  • **
  • Posts: 13
  • Helpful: +2/-0
Re: HowTO: Install nZEDb on Ubuntu 16.0.4
« Reply #2 on: 2017-08-22, 11:24:57 AM »
date.timezone is in step 10.