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

Offline digger

  • Junior Indexer
  • **
  • Posts: 13
  • Helpful: +4/-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 : 18/12/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]
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
Quote
Ignore the "Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it." warning.

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-12-18, 06:46:25 AM by archer »

Offline Wally73

  • Overlord
  • ******
  • Posts: 260
  • Helpful: +28/-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: +4/-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.

Offline kaibosh

  • Overlord
  • ******
  • Posts: 159
  • Helpful: +18/-0
Re: HowTO: Install nZEDb on Ubuntu 16.0.4
« Reply #3 on: 2017-12-07, 11:17:18 AM »
This is currently the best guide there is for Ubu 16.04. Be sure to load the TZ data into the DB was Wally mentions above.

Offline ragga64

  • Newbie
  • *
  • Posts: 2
  • Helpful: +0/-0
Re: HowTO: Install nZEDb on Ubuntu 16.0.4
« Reply #4 on: 2018-02-11, 09:05:44 AM »

Step 8: Install yEnc  [ERROR]
like to say thank you for the good write up for the install.
there was  a thew hickups but finaly got round them, [Step 8: Install yEnc ] came across an error that kept coming up, and for some reason it was saying php7.0 not in stalled, even thow it was, so  apt-get install php7.0  reinstalled and all was good.
this is the first time i manage to get to install page with your install guied, would always get white screen myip/install antill now.
and again nice guied and many thank.
 ragga
« Last Edit: 2018-02-12, 09:07:29 AM by ragga64 »

Offline ragga64

  • Newbie
  • *
  • Posts: 2
  • Helpful: +0/-0
Re: HowTO: Install nZEDb on Ubuntu 16.0.4
« Reply #5 on: 2018-02-11, 11:59:10 AM »
Spoke to soon :)
got new error.
ERROR: unable to connect to usenet
yet checked the config .php and is all set up in there ok and don't know were else i can look, as ubuntu is not my best plus running on VM

[11-Feb-2018 20:38:06 Europe/London] PHP Notice:  Only variables should be assigned by reference in /usr/share/php/PEAR.php on line 601
[11-Feb-2018 20:38:06 Europe/London] PHP Warning:  stream_socket_client(): Peer certificate CN=`news.sslusenet.com' did not match expected CN=`europe-ssl.newsdemon.com' in /var/www/nZEDb/libs/PEAR/Net_NNTP/NNTP/Protocol/Client.php on line 514
[11-Feb-2018 20:38:06 Europe/London] PHP Warning:  stream_socket_client(): Failed to enable crypto in /var/www/nZEDb/libs/PEAR/Net_NNTP/NNTP/Protocol/Client.php on line 514
[11-Feb-2018 20:38:06 Europe/London] PHP Warning:  stream_socket_client(): unable to connect to tls://europe-ssl.newsdemon.com:563 (Unknown error) in /var/www/nZEDb/libs/PEAR/Net_NNTP/NNTP/Protocol/Client.php on line 514
[11-Feb-2018 20:38:06 Europe/London] PHP Notice:  Only variables should be assigned by reference in /usr/share/php/PEAR.php on line 601
[11-Feb-2018 20:38:06 Europe/London] PHP Notice:  Only variables should be assigned by reference in /usr/share/php/PEAR.php on line 601




/ Use the aforementioned CA bundle file to verify remote SSL certificates when connecting to a server using TLS/SSL.
define('nZEDb_SSL_VERIFY_PEER', '');      [took out the 1 ]
// Verify the host is who they say they are.
define('nZEDb_SSL_VERIFY_HOST', '');     [took out the 1 ]
// Allow self signed certificates. Note this does not work on CURL as CURL does not have this option.
define('nZEDb_SSL_ALLOW_SELF_SIGNED', '1');  [put the 1 in ]


and now seems to be working    ;D

« Last Edit: 2018-02-12, 09:09:17 AM by ragga64 »

Offline Roelski

  • Junior Indexer
  • **
  • Posts: 27
  • Helpful: +1/-0
Re: HowTO: Install nZEDb on Ubuntu 16.0.4
« Reply #6 on: 2018-05-16, 01:22:18 PM »
Can anyone add instructions on how to get updating to work?

i tried this, but failed in the last step:

--
--removed a lot of junk--
-

// edit ***********************
Ok, I figured it out.

// accidental composer installed. First need to remove package
sudo apt-get remove composer

mkdir ~/composerinstall
cd ~/composerinstall
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir=/usr/bin
php -r "unlink('composer-setup.php');"

// Composer (version 1.6.5) successfully installed to: /usr/bin/composer.phar
// Use it: php /usr/bin/composer.phar

cd /var/www/nZEDb/
sudo cp /usr/bin/composer.phar /usr/bin/composer
// ok, should have created a ln

// try updating (and stopping tmux, and restarting it):
cd /var/www/nZEDb/
tmux kill-session -t nZEDb
sudo ./zed update nzedb
rm /var/www/nZEDb/resources/smarty/templates_c/*
cd /var/www/nZEDb/misc/update/nix/tmux/
php start.php

// YESSSS (but no updates found, lol)
« Last Edit: 2018-05-23, 03:43:30 PM by Roelski »
using nZEDb on a N5550 nas upgraded to 8Gig.