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

Offline archer

  • Overlord
  • ******
  • Posts: 25
  • Helpful: +5/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #15 on: 2017-02-23, 02:44:53 PM »
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

Hi. In my original docs that is how it is. i.e. second step and as you show the instructions. This was changed for the readthedocs documentation, but I have reverted it in my dev branch of those docs.
Support my tech addiction.

Offline archer

  • Overlord
  • ******
  • Posts: 25
  • Helpful: +5/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #16 on: 2017-02-23, 02:52:14 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.

We've changed this to recommend MariaDb and only provide instructions for it. There are a number of reasons for this, not list is just one set of option for beginners to follow.
Support my tech addiction.

Offline archer

  • Overlord
  • ******
  • Posts: 25
  • Helpful: +5/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #17 on: 2017-02-23, 03:06:19 PM »
10. Configure the PHP settings

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.

You're correct that 1024 is too little on current machines. The WIP has this set to 2048M. We actually want a concrete setting here, because it is easier to catch problems when they exhaust RAM early instead of when something else uses the remaining RAM and we have to backtrack to PHP causing it.
Support my tech addiction.

Offline archer

  • Overlord
  • ******
  • Posts: 25
  • Helpful: +5/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #18 on: 2017-02-23, 03:18:03 PM »
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.

0.0.0.0 does apply to all TCP/IP addresses, but it is preferable to use a unix socket file when your Db is local as (in theory) it has less overhead and is faster.
Support my tech addiction.

Offline archer

  • Overlord
  • ******
  • Posts: 25
  • Helpful: +5/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #19 on: 2017-02-23, 03:20:56 PM »
Thanks for this post, it has a number of useful insights which I will be sure to incorporate into the WIP docs.

Feel free to contact me (Archer and niel are my nicks) in IRC with further comments or if you would like to help improve the docs.
Support my tech addiction.

Offline traydee

  • Newbie
  • *
  • Posts: 3
  • Helpful: +0/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #20 on: 2017-03-04, 09:51:15 AM »
Thanks for this hrobinson. Really appreciate the work.

I just followed your guide step-by-step, twice, but I just get Server 500 errors, and cant find anything in the logs to indicate why.

Two things to note, sudo apt-get install imagick doesnt work on my 16.04.1. Even with an apt-get update and adding repositories. php-imagick does work however, so I'm thinking the command needs to be sudo apt-get install php-imagick. nZEDb install errored until I ran php-imagick.

Also the URL for yydecode is already dead, so i had to google for an alternative.

While I certainly appreciate all the work everyone has done, its unfortunate that installing software in 2017 still has to be so complex. I've been a sys-admin for 15 years now, and I've tried installing nZEDb about 12 times, and its worked once, but even then I couldn't get it to backfill more than 10 days for some reason.

Offline traydee

  • Newbie
  • *
  • Posts: 3
  • Helpful: +0/-0
Re: nZEDb install script for Ubuntu Server 16.04.1
« Reply #21 on: 2017-03-04, 08:53:17 PM »
I think I might have figured out why I was getting Server 500 errors. After I ran into the problem installing imagick (it wouldn't install with apt-get install imagick), i tried installing nZEDb anyway. It looked like it installed ok, so I then went to the /install page which errored out with Server 500, but I now think that was because the actual nZEDb didnt finish installing because it couldn't find imagick. I did the Install Guide for Ubuntu 16.10 with PHP 7 and Oracle MySQL 5.7.17, and it worked great. Im now up and running.

So just a note for others, its sudo apt-get install php-imagick (the other guide worked because it includes the php-imagik up in the base software install line.