SOLVED Help with Install Guide: FreeNAS (FreeBSD) for nZEDb

Status
Not open for further replies.

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I'm not sure if I did this correctly but I enabled logging in nginx by removing the # from the line in the nginx.conf file

#user nobody;
worker_processes 1;

error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;


2016/04/02 18:29:39 [error] 70146#0: *1 "/usr/local/www/nzedb/www/index.html" is not found (2: No such file or directory), client: 192.168.1.6, server: , request: "GET / HTTP/1.1", host: "192.168.1.155"
2016/04/02 21:37:01 [emerg] 79385#0: open() "/usr/local/etc/nginx/logs/error.log" failed (2: No such file or directory)
2016/04/02 21:37:07 [emerg] 79394#0: open() "/usr/local/etc/nginx/logs/error.log" failed (2: No such file or directory)
2016/04/02 21:37:28 [error] 78606#0: *2 "/usr/local/www/nzedb/www/index.html" is not found (2: No such file or directory), client: 192.168.1.6, server: , request: "GET / HTTP/1.1", host: "192.168.1.155"
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
nginx is looking in /usr/local/www/nzedb/www. make sure your nginx root is set to the actual folder, which might be nZEDb?

also I'd change the index line to "index index.php;"
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Both of those lines are in the nginx.conf file.
I noticed on nginx restart that I was getting errors for the log file saying dir/file doesn't exist. Probably because the root folder was changed, so I created /usr/local/etc/nginx/logs/error_log.
The first error I think was because nzedb should be nZEDb as you said so I change it did a restart and got the second error message trying to run the ip of the nZEDb jail which is a 502 bad gateway error.

2016/04/03 08:33:23 [error] 15459#0: *1 "/usr/local/www/nzedb/www/index.html" is not found (2: No such file or directory), client: 192.168.1.6, server: , request: "GET / HTTP/1.1", host: "192.168.1.155"
2016/04/03 08:40:07 [crit] 15862#0: *1 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.6, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/$

Does reload wipe out the nginx.conf and replace it with the original?
My line 'include nzedb.conf;' is now missing

I'm getting very confused so let me post my current nzedb.conf

Code:
server {
    # Change these settings to match your machine.
    listen 80 http://192.168.1.155
    #server_name localhost;

    # These are the log locations, you should not have to change these.
    access_log /var/log/nginx-access.log;
    error_log /var/log/nginx-error.log;

    # This is the root web folder for nZEDb, you shouldn't have to
change this.
    root /usr/local/www/nZEDb/www/;
    index index.php;

    # Everything below this should not be changed unless noted.
    location ~*
\.(?:css|eot|gif|gz|ico|inc|jpe?g|js|ogg|oga|ogv|mp4|m4a|mp3|png|svg|ttf|txt|wo$
{
        expires max;
        add_header Pragma public;
        add_header Cache-Control "public, must-revalidate,
proxy-revalidate";
    }

    location / {
        try_files $uri $uri/ @rewrites;
    }

    location ^~ /covers/ {
    # This is where the nZEDb covers folder should be in.
        root /usr/local/www/nZEDb/resources;
    }



and part of my nginx.conf
Code:
    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
include nzedb.conf;

   # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


on nginx restart I'm getting this error

root@nZEDb:/usr/local/etc/nginx # service nginx restart
Performing sanity check on nginx configuration:
nginx: [emerg] invalid parameter "http://192.168.1.155" in /usr/local/etc/nginx/nzedb.conf:7
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed
root@nZEDb:/usr/local/etc/nginx #
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Both of those lines are in the nginx.conf file.
I noticed on nginx restart that I was getting errors for the log file saying dir/file doesn't exist. Probably because the root folder was changed, so I created /usr/local/etc/nginx/logs/error_log.
The first error I think was because nzedb should be nZEDb as you said so I change it did a restart and got the second error message trying to run the ip of the nZEDb jail which is a 502 bad gateway error.

2016/04/03 08:33:23 [error] 15459#0: *1 "/usr/local/www/nzedb/www/index.html" is not found (2: No such file or directory), client: 192.168.1.6, server: , request: "GET / HTTP/1.1", host: "192.168.1.155"
2016/04/03 08:40:07 [crit] 15862#0: *1 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.6, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/$

Does reload wipe out the nginx.conf and replace it with the original?
My line 'include nzedb.conf;' is now missing

I'm getting very confused so let me post my current nzedb.conf

Code:
server {
    # Change these settings to match your machine.
    listen 80 http://192.168.1.155
    #server_name localhost;

    # These are the log locations, you should not have to change these.
    access_log /var/log/nginx-access.log;
    error_log /var/log/nginx-error.log;

    # This is the root web folder for nZEDb, you shouldn't have to
change this.
    root /usr/local/www/nZEDb/www/;
    index index.php;

    # Everything below this should not be changed unless noted.
    location ~*
\.(?:css|eot|gif|gz|ico|inc|jpe?g|js|ogg|oga|ogv|mp4|m4a|mp3|png|svg|ttf|txt|wo$
{
        expires max;
        add_header Pragma public;
        add_header Cache-Control "public, must-revalidate,
proxy-revalidate";
    }

    location / {
        try_files $uri $uri/ @rewrites;
    }

    location ^~ /covers/ {
    # This is where the nZEDb covers folder should be in.
        root /usr/local/www/nZEDb/resources;
    }



and part of my nginx.conf
Code:
    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
include nzedb.conf;

   # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


on nginx restart I'm getting this error

root@nZEDb:/usr/local/etc/nginx # service nginx restart
Performing sanity check on nginx configuration:
nginx: [emerg] invalid parameter "http://192.168.1.155" in /usr/local/etc/nginx/nzedb.conf:7
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed
root@nZEDb:/usr/local/etc/nginx #

It tells you right there the line that is wrong. Your listen line should not have an HTTP address behind it.

Listen 80;

Is all that should be on that line.

These error messages are telling you exactly what is wrong with your configuration. You just need to read them. NGINX is easy once you take a few minutes to understand what you're doing. Stop trying to blindly follow a guide and take a minute to learn what you're using.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
pirateghost,
Thanks so much for you help. With Joshua and your help I'm learning a lot trying to fix my errors. I guess the confusion for me was 'Listen 80 http://192.168.1.155' worked earlier maybe because it was missing the ;
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Joshua,
I noticed you updated the wiki page I referenced (thanks). The server now runs but I couldn't get past the database setup.
nZEDb Server 09.jpg

I thought that the problem was with the Adding SQL user and table:
so I tried to redo those steps

mysql –u root –p
gave my password and got
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 9
Server version: 5.5.47-MariaDB FreeBSD Ports

MariaDB [(none)]> CREATE USER 'nzedb' IDENTIFIED VIA 'password';
ERROR 1396 (HY000): Operation CREATE USER failed for 'nzedb'@'%'
Still no luck with the database setup above.
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
The error isn't related to the SQL user, looks like it might be related not being able to connect to mariadb.
Are you running mariadb and PHP in the same jail? if not, you probably shouldn't be entering anything for the socket.

I don't like how the guide has application not installed all in the same jail. It makes sense in some situations to have a central mysql server for multiple applications, but here it complicated things because you can't use a socket.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
PHP is in nZEDb Jail 192.168.1.155 and SQL is in SQL jail 192.168.1.156.
so do you think I should delete the mysql jail and follow the directions in Part 2 in the main nZEDb jail?
Before you edited the wiki it said to enable SSHD in the jail. Is that necessary?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
PHP is in nZEDb Jail 192.168.1.155 and SQL is in SQL jail 192.168.1.156.
so do you think I should delete the mysql jail and follow the directions in Part 2 in the main nZEDb jail?
Before you edited the wiki it said to enable SSHD in the jail. Is that necessary?
If you want to keep them in different jails then change your nzedb settings to connect to the mysql jail IP and delete that socket.
Or if you want, you can just install mysql into the PHP jail.

no, you don't need SSH in either jail. I'm not sure why they said that; sounded like a linux person wrote that, not knowing how to use 'jexec'
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I start to install in the nZEDb jail SQL
Something is messed up with his commands so it adds stuff when copy and pasting if not careful

root@nZEDb:/ # pkg install \342\200\223y mariadb101-server
Updating FreeBSD repository catalogue...
[nZEDb] Fetching meta.txz: 100% 968 B 1.0kB/s 00:01
[nZEDb] Fetching packagesite.txz: 100% 5 MiB 5.6MB/s 00:01
Processing entries: 100%
FreeBSD repository update completed. 24810 packages processed.
New version of pkg detected; it needs to be installed first.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
pkg: 1.6.4_1 -> 1.7.1

The process will require 83 KiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]: root@nZEDb:/ # y
y: Command not found.

then: I fix it
root@nZEDb:/ # pkg install -y mariadb101-server
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
pkg: No packages available to install matching 'mariadb101-server' have been found in the repositories
root@nZEDb:/ # cd /usr/local/share/mysql
/usr/local/share/mysql: No such file or directory.

but it didn't create the mysql directory
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
hmm, I think the dash is someweird formatting. and 101 isn't in the repo. you could get mariadb100-server
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Success thanks so much.
BTW there is an error in the sql part of the wiki, a ; is missing from one of the mariadb commands.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
nice, k. yeah that guide needs some fine tuning
 

diedrichg

Wizard
Joined
Dec 4, 2012
Messages
1,319
Status
Not open for further replies.
Top