Author Topic: nZEDb install script for Ubuntu Server 16.04.1  (Read 8750 times)

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
nZEDb install script for Ubuntu Server 16.04.1
« on: 2017-02-07, 11:45:14 PM »
Hello everyone.

Update:  8/24/2017
I wrote this guide quite a while ago.  I am now going through this guide to confirm these steps still work.

When that step has been verified, you will see Veriefed: [Date]
When the step has been updated you will see Updated: [Date]

I have been having a heck of a time getting nZEDb installed on a vm working properly.  I have not found any reliable documentation to support the install on to this operating system.

To no end I am going to document my problems and issues for others to follow in the future.

I am using this documentation as reference:  http://nzedb.readthedocs.io/en/master/ubuntu.html and will document all my mis-adventures with the hope of clarifying up some confusion I have run into.  My next post will start my progress using the referenced document above.

Please feel free to comment on any of these steps below, to point out any pitfall you might have encountered.

A bit about the indexer I am about to build. 

This is a virtual machine running on unraid version 6.3.1  The server has a Intel® Xeon® CPU E31240 @ 3.30GHz with 32gb RAM using a Supermicro - X9SCL/X9SCM motherboard.  The VM itself is configured for 4096GB RAM and a 256GB "Hard Drive", using 2 of the 6 "CPUs"  Currently no other VMS are running on this server.

~Harold
« Last Edit: 2017-08-24, 10:48:27 PM by hrobinson »

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #1 on: 2017-02-08, 12:09:25 AM »
1. Ensure you’re using the most up to date packages:

I did not see any issues with this step.  I have installed ubuntu too many times to count. These steps work very well.  The only thing I did different is during the partitioning phase of the OS install, I elected to change the default ext4 file system to xfs.  The reason for selecting xfs is the immediate write to disk vs allowing the writes to sit in cache memory for a bit.  The goal is to try to make this as bullet proof as possible.

I named my system nzedb-01, my local user ID is hrobinson my password is ******************** {What you thought I would tell you my super secret password?}

I selected only the default software with one additional package which is the ssl server package so that I can use putty.

This process depending on your internet connection, can take up to an hour.   Mine took just about 30 minutes.  So go grab a coffee or a cold one during the upgrade process.

I saw some warning messages during the
Code: [Select]
sudo apt-get upgrade step.  about rebooting when convenient, So I rebooted the server before starting
Code: [Select]
sudo reboot
Then I started the dist-upgrade step.
Code: [Select]
sudo apt-get dist-upgrade
I rebooted the server one final time and this is my starting point for my server.
Code: [Select]
sudo reboot
« Last Edit: 2017-02-08, 12:27:49 AM by hrobinson »

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #2 on: 2017-02-08, 12:23:46 AM »
2.  Decide on what to do with Apparmor

I have learned by trial and error that you must make this decision now.  The reason is if you decide to remove Apparmor and wait until step 5 of this document, when you purge Apparmor, you pretty much gut the server and have to start over. 

If you are going to keep Apparmor, then you can skip this step and wait to configure apparmor later.

I have decided to purge Apparmor from my server.

I have also found that the order of purging Apparmor is out of order but probably does not hurt anything at this point.  For clarity sake, here is how Apparmor should be removed.

Remove Apparmor:
Code: [Select]
sudo update-rc.d apparmor disable
Code: [Select]
sudo apt-get purge apparmor
Then I rebooted the server before continuing the software install.
Code: [Select]
sudo reboot

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #3 on: 2017-02-08, 12:35:18 AM »
3. Ensure some essential system utilities are installed

At this point I am going to work from a putty terminal.  I like the cut and paste feature of putty and it helps in getting the commands correctly typed in.

I logged into the server console one more time, just to get the IP address of the server.  Which at this point is 10.1.1.181.  I then setup a putty session and logged in.

After relogging in I continued with the software install by issuing this command:

Code: [Select]
sudo apt-get install software-properties-common python-software-properties git
Executing this code installs the software requested without any issues.
« Last Edit: 2017-02-08, 06:59:04 PM by hrobinson »

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #4 on: 2017-02-08, 07:36:16 PM »
4.  Install PHP

My next step is to install PHP.  This command is pretty large and  copied directly from the original document.

Code: [Select]
sudo apt-get install php-pear php7.0 php7.0-cli php7.0-dev php7.0-common \
php7.0-curl php7.0-json php7.0-gd php7.0-mysql php7.0-mbstring php7.0-mcrypt php7.0-xml

Upon execution, this will install some 96 packages.  Just answer Y to install everything.  This software install took roughly 10 minutes to complete.

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #5 on: 2017-02-08, 07:46:16 PM »
5. Install MySQL

This next command will install MySQL.  The document (in the first post) details out 3 different installs.  I will be selecting the regular MySQL install for my server.

Just paste this code into your putty terminal and answer Y to install all software packages.  This will install roughly 24 packages.

Code: [Select]
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
During the install, you will be prompted to input the new root password for the MySQL user 'root'.  DO NOT skip this step.  Enter a password that you will remember.  You will need this later.

This install should take about 5-10 minutes.

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #6 on: 2017-02-08, 07:51:45 PM »
6.  Decide on what to do with Apparmor

Here is where we will deal with Apparmor.  If you have chosen to configure Apparmor, you will enter the following commands below.  SKIP THIS STEP if you have removed Apparmor in Step 2 of this "Script"

First install some utilites to manage Apparmor
Code: [Select]
sudo apt-get install apparmor-utilsAnswer "Y" to install the packages.

Next we will configure Apparmor to ignore MySQL:
Code: [Select]
sudo aa-complain /usr/sbin/mysqld
Now reboot the server to ensure all the software starts cleanly.

Code: [Select]
sudo reboot
« Last Edit: 2017-02-09, 07:27:24 PM by hrobinson »

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #7 on: 2017-02-09, 07:54:13 PM »
7. Configure MySQL

After reboot we will start by configuring MySQL.

Remember I have installed the standard MySQL server.  The config file will be located in
Code: [Select]
/etc/mysql/mysql.conf.d
the name will be called
Code: [Select]
mysqld.cnf
enter the command
Code: [Select]
cd /etc/mysql/mysql.conf.d
then enter the command
Code: [Select]
sudo nano mysqld.cnf to start editing the file.

locate the [mysqld] section in the file.

add the following line directly after lc-messages-dir option:

Code: [Select]
innodb_file_per_table = 1
so that the file will look like this: 
Code: [Select]
[mysqld]
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
innodb_file_per_table = 1

Now locate the option
Code: [Select]
max_allowed_packet = 16M
Ensure this is set to 16M

Press return (to create a blank line) and add this option to your mysqld.cnf file:
Code: [Select]
group_concat_max_len = 8192
Now save your file by pressing CTRL-X
When nano asks if you want to save the modified buffer answer
Code: [Select]
Y
then press enter to write the changes to mysqld.cnf

I will get some information about my server that is needed to complete the MySQL configuration part.

ElementData
Host name:                nzedb-01@localhost
nZEDb user name:nzedbindexer
nZEDb database name:nzedbdb

Now you will want to start the mysql client by executing this command:

Code: [Select]
sudo mysql -u root -p
enter the password you entered when you first installed the mysql package.  if you are successful you will see the
Code: [Select]
mysql>
prompt

A couple of commands to help you through this process:

Code: [Select]
select host, user, authentication_string, password_lifetime from mysql.user;
will show this table:
Code: [Select]
+-----------+------------------+-------------------------------------------+-------------------+
| host      | user             | authentication_string                     | password_lifetime |
+-----------+------------------+-------------------------------------------+-------------------+
| localhost | root             | *THISISNOTMYPASSWORDTHISISNOTMYPASSWORDTH |              NULL |
| localhost | mysql.sys        | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |              NULL |
| localhost | debian-sys-maint | *EACC4A02EFF116700804AAC86F5CB4A0860D5653 |              NULL |
+-----------+------------------+-------------------------------------------+-------------------+
3 rows in set (0.00 sec)

You can use this command to make sure your database user has been created.

The other command that is important is to show the existance of the nzedb database.  To see a list of databases that exist in MySQL you enter this command:
Code: [Select]
show databases;
Which will show a table like this:
Code: [Select]
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

You will notice there is no nzedb data base.  Remember the database name is nzedbdb.

To create the user you will use this command:

Code: [Select]
GRANT ALL ON SomeDatabaseName.* TO 'SomeUserName'@'SomeHostName' IDENTIFIED BY 'SomePassword';
So to make an actual working example, and using the database user name above this is what the command should look like:
Code: [Select]
GRANT ALL ON nzedbdb.* TO 'nzedbindexer'@'localhost' IDENTIFIED BY 'MyPasswordWentHere';
MySQL should respond with this:
Quote
Query OK, 0 rows affected, 1 warning (0.00 sec)

Then when you check to make sure the user was created execute this command:
Code: [Select]
select host, user, authentication_string, password_lifetime from mysql.user;
The table should be modified and look like this:
Code: [Select]
+-----------+------------------+-------------------------------------------+
| host      | user             | authentication_string                     |
+-----------+------------------+-------------------------------------------+
| localhost | root             | *THISISNOTMYPASSWORDTHISISNOTMYPASSWORDTH |
| localhost | mysql.sys        | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| localhost | debian-sys-maint | *EACC4A02EFF116700804AAC86F5CB4A0860D5653 |
| localhost | nzedbindexer     | *THISISNOTMYPASSWORDTHISISNOTMYPASSWORDTH |
+-----------+------------------+-------------------------------------------+
4 rows in set (0.00 sec)

Now that the user as been created and you confirmed its creation, you need to grant access to your indexer user, in my case nzedbindexer to the database.

This is accomplished with this command:
Code: [Select]
GRANT FILE ON *.* TO 'SomeUserName'@'SomeHostName';
in my exact configuration I will enter the following command:
Code: [Select]
GRANT FILE ON *.* TO 'nzedbindexer'@'localhost';
MySQL should respond with:
Code: [Select]
Query OK, 0 rows affected (0.00 sec)

At this point MySQL should be configured properly.  You can type:
Code: [Select]
quitto exit the MySQL client.
« Last Edit: 2017-02-11, 12:36:16 AM by hrobinson »

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #8 on: 2017-02-11, 01:28:21 AM »
8. Install and configure the web server

If everyone is following along this will be step 7 on the install guide mentioned in the first post of this thread.

At this point you must decide weather or not to use Apache or nginx web server.  The choice is strictly up to you, and I am (at this time) not going to go into configuring both web servers.  The install guide I mentioned has installation instructions for both Apache and nginx.

For this install, I am going to select Apache web server.

Install and configure Apache web server

1.  The first thing we get to do is:  you got it, Install more packages.  Enter the command below to start that process:

Code: [Select]
sudo apt-get install apache2 libapache2-mod-php7.0
apt will warn you that you are about to install 11 additional packages.  Answer

Code: [Select]
Y and press enter
to continue.  This should only take a few minutes.

When the package install is complete enter this command:
Code: [Select]
apache2 -v
Apache should respond with:
Code: [Select]
Server version: Apache/2.4.18 (Ubuntu)
Server built:   2016-07-14T12:32:26

The important part about this output is Apache should respond with 2.4.xx.  Anything greater than 2.4 or less than 2.4 and your mileage may vary.

2. Create new nzedb web site:
now execute the following command which will open up a new file to begin setting up a new web site.

Code: [Select]
sudo nano /etc/apache2/sites-available/nZEDb.conf
Now copy and paste the following into your file:
Code: [Select]
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName localhost
    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>

Now exit nano
Code: [Select]
CTRL-x
Code: [Select]
Press Y to save your file
Code: [Select]
Press Enterto save and exit nano.

3.  Changing additional settings:
At this point the install guide I am following is not clear what to do next.  I had to poke around to figure out what the install guide was asking me to do.  This will clarify things quite a bit.

Enter the following command:
Code: [Select]
sudo nano /etc/apache2/apache2.conf
Locate the section of the configuration file that looks exactly like this:
Code: [Select]
<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

Locate the line that reads
Code: [Select]
AllowOverride none
Change ONLY that line to read
Code: [Select]
AllowOverride All
Now exit nano
Code: [Select]
CTRL-x
Code: [Select]
Press Y to save your file
Code: [Select]
Press Enterto save and exit nano.

4.  Disable the default website.

These steps will disable the default website.
Code: [Select]
sudo a2dissite 000-default
Apache will respond with:
Code: [Select]
Site 000-default disabled.
To activate the new configuration, you need to run:
  service apache2 reload

Apache is reminding you to reload the apache2 service.  We are going to ignore that until the very last.

Now enter this next command:
Code: [Select]
sudo a2ensite nZEDb.conf
Apache will respond with:
Code: [Select]
Enabling site nZEDb.
To activate the new configuration, you need to run:
  service apache2 reload

Again we will ignore the reminder and enter the next command:
Code: [Select]
sudo a2enmod rewrite
Apache will respond with:
Code: [Select]
Enabling module rewrite.
To activate the new configuration, you need to run:
  service apache2 restart

NOW we will restart the apache2 service by entering the command below:
Code: [Select]
sudo service apache2 restart
5.  Verify everything is working
Open up your favorite browser and enter http://10.1.1.181 and hit enter (remember my server is on 10.1.1.181 your server might be on a different address) you should see "Not Found" or "404 Not Found"  This is good, and shows that Apache is still working, it just can't find the files.  Because we have not installed them yet.

 
« Last Edit: 2017-02-11, 01:54:18 AM by hrobinson »

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #9 on: 2017-02-11, 01:36:24 AM »
9. Fix user permissions for later

You need to add a user to the www-data group so you have access to put nZEDb where it needs to go. Once the following command is complete, you’ll need to log out and back in prior to continuing. If you’re not using the account you plan to use later, change $USER to the username.

This too gave me a little trouble.  Maybe because its late at night.  But the command is this:
Code: [Select]
sudo usermod -a -G www-data $USER
If you use the above command, it will add your currently logged in user to the www-data group.  You can also change $USER to any user you choose if you are not going to use the currently logged in user.  In my case this looks good to me and I just simply entered the above command into my terminal.

Now enter:
Code: [Select]
exit
to log off.

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #10 on: 2017-02-11, 03:06:59 AM »
10. Configure the PHP settings

Now comes the time to configure PHP  There are some pit falls that I have experienced here too. As they come up I will point them out.

Lets start off by configuring the CLI

Execute this command, which will open the cli/php.ini file.
Code: [Select]
sudo nano /etc/php/7.0/cli/php.ini
This file is very well documented.  Becuase of this its time to introduce a new feature of Nano.  Nano has a search feature.  To activate it:

Code: [Select]
Press CTRL-W
which stands for the command Where  as in Where is?

When CTRL-W is pressed you will see the prompt

Code: [Select]
Search:
Type in:
Code: [Select]
max_execution_timeand press ENTER.  you will be taken directly to that entry by passing all that documentation.

Change this line that currently reads:
Code: [Select]
max_execution_time = 30
and change it to read:
Code: [Select]
max_execution_time = 120
Next press CTRL-W and enter the following:
Code: [Select]
memory_limit
Here comes another problem I had with the install guide.  PHP 7.0 comes preset to the following:
Code: [Select]
memory_limit = -1What this simply means is use any available memory. 

The install guide suggested that this be set to

Quote
memory_limit = 1024M

The problem with setting this memory limit too low is PHP will run out of memory very quickly.  A lot of times you wont know anything is wrong with the exception that pages will not display correctly or settings will not stay set, or worse, the website will crash for no reason. 

After poking around in the log files and then researching what this setting actually does, I feel its safe to leave this at -1.  The setting -1 allows PHP to allocate memory as needed and does not restrict is ability to run correctly.  No this does not mean that PHP uses all available server memory.  It means that it CAN use all available server memory if it needs to.  I have found that PHP is very frugal with the RAM it uses.  If I find this installation is using too much RAM, then I will update this post.  I do positively know 1024M is not enough RAM.

Next press CTRL-W and enter:
Code: [Select]
date.timezone
This is a commented out field that looks like this in the file:

Code: [Select]
;date.timezone =
Remove the semi colon so the line now looks like this:

Code: [Select]
date.timezone =
Now add your local time zone.  You can look up your local timezone here: http://php.net/manual/en/timezones.php.  My timezone is "America/Los_Angeles" so when finished the changed line will look like this:

Code: [Select]
date.timezone = America/Los_Angeles
Setting Debugging Options
These options are for debugging purposes and are optional, for me since I don't know much about running an indexing server I will enable these.  The Install guide has recommended that these be enabled.  Possible Impact to the server are possible disk space issues or slower indexing performance.  If you choose not to enable these options, you can skip this section.

Press CTRL-W and enter:
Code: [Select]
error_reporting =
The line currently reads:

Code: [Select]
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
Change it to read:
Code: [Select]
error_reporting = E_ALL
Press CTRL-W

Enter the following:
Code: [Select]
log_errors =
Verify the line reads:
Code: [Select]
log_errors = On
Press CTRL-W

Enter the following:
Code: [Select]
error_log =
The line will read:
Code: [Select]
;error_log = php_errors.log
Change the parameter to remove the semi colon at the beginning of the line and change the _ in php_errors.log to a dash.  Just like the example below:
Code: [Select]
error_log = php-errors.log
Now save your new configuration file by pressing CTRL-X
Code: [Select]
CTRL-XAnswer Y to save the buffer
Code: [Select]
Yand press ENTER to save it to the php.ini you recently opened.
Code: [Select]
ENTER
Now we will configure the SAPI for Apache.  To do this enter the following:
Code: [Select]
sudo nano /etc/php/7.0/apache2/php.ini
The CLI and SAPI files for PHP must match.  So go to the top of this message and repeat the same steps.

Once both files match we will need to reload the Apache service.

Execute the following command:
Code: [Select]
sudo service apache2 restart
« Last Edit: 2017-02-12, 08:03:23 PM by hrobinson »

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #11 on: 2017-02-12, 08:30:02 PM »
11. Install more system extras.

A:  Now we are going to install media handling extras.  Execute the command below to install the necessary software packages:

Code: [Select]
sudo apt-get install unrar p7zip-full mediainfo lame ffmpeg libav-tools
This will install 108 new packages.  Answer:

Code: [Select]
Y and press ENTER
To continue.  This will take a few minutes to complete.

B:  yEnc - speeds up header and message processing during indexing:


there is no automated way you can do this.  Just enter the commands below one at a time (Copy and Paste works but not the whole thing at once like I tried)

Code: [Select]
cd ~
mkdir yenc
cd yenc
wget http://heanet.dl.sourceforge.net/project/yydecode/yydecode/0.2.10/yydecode-0.2.10.tar.gz
tar xzf yydecode-0.2.10.tar.gz
cd yydecode-0.2.10
./configure
make
sudo make install
cd ../..
rm -rf ~/yenc

You might see warnings like this:
Code: [Select]
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.

but those can be ignored.  When finished you should be able to execute this command:
Code: [Select]
yydecode -V
you then should see this response:

Code: [Select]
yydecode 0.2.10
C:  php-yenc extension - even faster header and message processing.

C.
Make sure you download the php7.0 version of the package from https://github.com/niel/php-yenc/releases

as of 2/12/2017 this is the current package.  So you can enter the following command:
Code: [Select]
wget https://github.com/niel/php-yenc/releases/download/v1.3.0/php7.0-yenc_1.3.0_amd64.deb
To install the downloaded package use this command:
Code: [Select]
sudo dpkg -i php7.0-yenc_1.3.0_amd64.deb
dpkg should respond with the following:
Code: [Select]
Selecting previously unselected package php7.0-yenc.
(Reading database ... 104221 files and directories currently installed.)
Preparing to unpack php7.0-yenc_1.3.0_amd64.deb ...
Unpacking php7.0-yenc (1.3.0) ...
Setting up php7.0-yenc (1.3.0) ...
Creating symlink for configuration file.
Processing triggers for php7.0-cli (7.0.13-0ubuntu0.16.04.1) ...

Indicating that the package has been properly installed.
« Last Edit: 2017-02-12, 10:47:42 PM by hrobinson »

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #12 on: 2017-02-12, 11:34:10 PM »
12. Obtain nZEDb

A.  Install Composer
To obtain nZEDb we need to obtain composer, a PHP dependency manager. You can install it locally or globally. We recommend globally. This guide details a global install:
Code: [Select]
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r 'if (hash_file("SHA384", "composer-setup.php") === preg_filter("#^.*?<pre>|</pre>.*$#s", "", file_get_contents("https://composer.github.io/pubkeys.html"))) { echo "Installer verified"; } else { echo "Installer corrupt"; unlink("composer-setup.php"); } echo PHP_EOL;'
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

PHP will respond with the following:

Code: [Select]
All settings correct for using Composer
Downloading...

Composer (version 1.3.2) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

Continue with the following commands:

Code: [Select]
php -r "unlink('composer-setup.php');"

When complete execute this command:

Code: [Select]
composer -V
Composer should respond with:

Code: [Select]
Composer version 1.3.2 2017-01-27 18:23:41
The date and time are current date and time and will change depending on when you are checking the version of Composer.  If the Composer version was not displayed then open up a new thread in this forum to request help.

C.  Install nZEDb.

After all this its finally time to install nZEDb.

First we are going to set permissions:

1.  Change to the var folder:
Code: [Select]
cd /var2.  Change ownership of the folder www
Code: [Select]
sudo chown www-data:www-data -R www3.  Change into the www folder
Code: [Select]
cd www4.  create new group www-data
Code: [Select]
sudo newgrp www-data
5.  Install imagick packages to allow composer to work
Code: [Select]
sudo apt-get install php-imagick
Apt will ask to install 23 new packages.

Code: [Select]
Press Y then press ENTER
Now we retreive the nZEDb software  execute the command below.

Code: [Select]
bash <(curl -s https://raw.githubusercontent.com/nZEDb/nZEDb/0.x/_install/install.sh)
Quote
*** Editors note:  I have already updated the install instructions to include this package.  The original install script did not include the step to install imagick.  So this part was a documentation of the problem I encountered, then resolved.  You can skip this section as you should not see this at all.  I simply kept it here for my installation notes:
 
Now starts my problems:

After the command is executed I see the following error:
Code: [Select]
root@nzedb-01:/var/www# bash <(curl -s https://raw.githubusercontent.com/nZEDb/nZEDb/0.x/_install/install.sh)
nZEDb Installer
----------------------

Getting the nZEDb app from GitHub

Cloning into 'nZEDb'...
remote: Counting objects: 119885, done.
remote: Compressing objects: 100% (392/392), done.
remote: Total 119885 (delta 212), reused 0 (delta 0), pack-reused 119482
Receiving objects: 100% (119885/119885), 91.53 MiB | 6.11 MiB/s, done.
Resolving deltas: 100% (82914/82914), done.
Checking connectivity... done.

Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested PHP extension ext-imagick * is missing from your system. Install or enable PHP's imagick extension.


Setting cache directory permissions for you...


Installation complete.
Now run the setup via the web site's /install page.
------------------------

The obvious next step is to install the package/s 'ext-imagick'

After googling around I found this command should do the job.  Execute this command:

Code: [Select]
sudo apt-get install php-imagick
Apt will ask to install 23 new packages.

Code: [Select]
Press Y then press ENTER
Now re-execute this command ensuring you are in the /var/www folder:

Code: [Select]
bash <(curl -s https://raw.githubusercontent.com/nZEDb/nZEDb/0.x/_install/install.sh)**** End Editors Note
This will take several minutes to complete.
« Last Edit: 2017-04-01, 12:51:44 AM by hrobinson »

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #13 on: 2017-02-13, 05:29:44 AM »
13. Configure nZEDb

And now the moment you have been waiting for: 

Open a web browser and head to http://<host/ip of your machine>/install
Follow the instructions on the wizard, and everything should go smoothly.  If you find you are having problems, then refer to the next section "Troubleshooting"

Once the wizard is complete, more detailed setup instructions are located http://nzedb.readthedocs.io/en/master/config_nzedb.html#config-nzedb.

These are the settings I used to get the server running.  If you have followed this guide to the letter, then these settings will apply, otherwise use this only as an example:  Please note that I have not provided a Socket Path option.  If you are supplying a socket path, then DO NOT supply a hostname and port number.  Use one or the other BUT NOT BOTH.

Code: [Select]
Database System (type in mysql):  mysql
Hostname:                         0.0.0.0
Port Number:                      3306
Socket Path(optional):
Username:                         nzedbindexer
Password:                         thisisnotmypassword
Database (to connect to):         nzedbdb
« Last Edit: 2017-02-21, 07:37:28 PM by hrobinson »

Offline hrobinson

  • Junior Indexer
  • **
  • Posts: 49
  • Helpful: +1/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #14 on: 2017-02-14, 07:45:55 PM »
Troubleshooting:

1.  Preflight check error.

Sometimes if permissions are not set correctly you will see this error in the preflight check:

Code: [Select]
Checking if the config.php file is writable:
The installer cannot write to /var/www/nZEDb/nzedb/config/.
A quick solution is to run:
chmod 777 /var/www/nZEDb/nzedb/config/

Another solution is to run:
chown -R YourUnixUserName:www-data /var/www/nZEDb/
Then give your user access to the group:
usermod -a -G www-data YourUnixUserName
Finally give read/write access to your user/group:
chmod -R 774 /var/www/nZEDb/

What I did to correct this issue since everything else was corrected was to execute this command:
Code: [Select]
chmod -R 774 /var/www/nZEDb/
2.  Error from MySQL

When creating the database, I saw the following error:
Code: [Select]
Unable to create database and data. Check permissions of your mysql user.
My MySQL user is:  nzedbindexer

When I execute the MySQL command:
Code: [Select]
SHOW GRANTS FOR 'nzedbindexer'@'localhost';
It shows the following:

Code: [Select]
+-------------------------------------------------------------------+
| Grants for nzedbindexer@localhost                                 |
+-------------------------------------------------------------------+
| GRANT FILE ON *.* TO 'nzedbindexer'@'localhost'                   |
| GRANT ALL PRIVILEGES ON `nzedbdb`.* TO 'nzedbindexer'@'localhost' |
+-------------------------------------------------------------------+
2 rows in set (0.00 sec)

In step two 'Database Setup' the username was only set to 'nzedbindexer'.  I changed this to 'nzedbindexer@localhost' but did not correct this problem.  If you have followed this guide and did not skip any steps, the file system security should be set correctly.

Ultimately after a bit of research I read an article that instructed me to use 0.0.0.0 in place of "localhost". After discussing this with other users on the forum, I found out that 0.0.0.0 instructs the db to listen on any address.
« Last Edit: 2017-02-21, 07:20:07 PM by hrobinson »