[How-To] ownCloud using NGINX, PHP-FPM, and MySQL

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Ok that worked, thanks.

Next issue. Not sure what I am supposed to do here. Am I supposed to find an existing file in this directory or does it need to be created? There is nothing in this directory.



Also I assume these are commands below are to be run from the CLI or do they go into a file also?

 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ok that worked, thanks.

Next issue. Not sure what I am supposed to do here. Am I supposed to find an existing file in this directory or does it need to be created? There is nothing in this directory.



Also I assume these are commands below are to be run from the CLI or do they go into a file also?

by default the my.cnf doesn't exist, so yes create it.

yeah those lines are run on the shell, the indented lines need to be run on mysql's shell but it'll popup for you. any code I put is run on the shell unless I specify it goes into a file.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Ok ran the first line
Code:
service nginx start && service php-fpm start && service mysql-server start

And I get this error
Code:
Shared object "libiconv.so.2" not found, required by "php-fpm"
/usr/local/etc/rc.d/php-fpm: WARNING: failed to start php_fpm


I swear to god I'm about to give up on this. :mad:
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ok ran the first line
Code:
service nginx start && service php-fpm start && service mysql-server start

And I get this error
Code:
Shared object "libiconv.so.2" not found, required by "php-fpm"
/usr/local/etc/rc.d/php-fpm: WARNING: failed to start php_fpm


I swear to god I'm about to give up on this. :mad:
the packages with the jail get out of date.
Code:
pkg upgrade
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
And now 502 bad gateway. :(
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
And now 502 bad gateway. :(
is php running?
Code:
service php-fpm status


if so did you set the listen address in the php-fpm.conf
Code:
ls -l /var/run/php-fpm.sock
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
I get this
Code:

php-fpm does not exist in /etc/rc.d or the local startup
directories (/etc/ix.rc.d /usr/local/etc/rc.d)
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I get this
Code:

php-fpm does not exist in /etc/rc.d or the local startup
directories (/etc/ix.rc.d /usr/local/etc/rc.d)
you ran that on your host!? only run these commands in the jail, unless specified.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Not sure what happened but putty reverted back to the main shell. It's running.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
No it was run in the jail
hmm strange. you should have installed php-fpm when you installed php56
please try this again..
Code:
pkg install nginx mariadb55-server php56-extensions php56-curl php56-exif php56-fileinfo php56-gd php56-mbstring php56-pdo_mysql php56-openssl php56-zip php56-zlib
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
if so did you set the listen address in the php-fpm.conf
Code:
ls -l /var/run/php-fpm.sock

No I set to what you had listed in the tutorial

Code:
listen = /var/run/php-fpm.sock
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
No I set to what you had listed in the tutorial

Code:
listen = /var/run/php-fpm.sock
If you set this, you obviously had php-fpm installed at one point (its an included extension of php56). that's why im surprised the script is gone from /usr/local/etc/rc.d
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Ok I'm out of patience to try and figure anything more out with this. Thanks for trying to help.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
OK I lied. This is what I get now when I try to start the service
Code:
root@owncloud:/ # service php-fpm start
Starting php_fpm.
[14-Jan-2015 20:41:06] ERROR: unable to bind listening socket for address '/usr/local/ls -l /var/run/php-fpm.sock': No such file or directory (2)
[14-Jan-2015 20:41:06] ERROR: FPM initialization failed
/usr/local/etc/rc.d/php-fpm: WARNING: failed to start php_fpm
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
OK I lied. This is what I get now when I try to start the service
Code:
root@owncloud:/ # service php-fpm start
Starting php_fpm.
[14-Jan-2015 20:41:06] ERROR: unable to bind listening socket for address '/usr/local/ls -l /var/run/php-fpm.sock': No such file or directory (2)
[14-Jan-2015 20:41:06] ERROR: FPM initialization failed
/usr/local/etc/rc.d/php-fpm: WARNING: failed to start php_fpm
there was a misunderstanding earlier.
'ls -l' was a command. I wanted to see if the socket existed.
set the listen option back to /var/run/php-fpm.sock then run..
service php-fpm start
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
php-fpm is running now but I still get the bad gateway error

output from the command is
Code:
srw-rw----  1 root  wheel  0 Jan 14 20:56 /var/run/php-fpm.sock
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
php-fpm is running now but I still get the bad gateway error

output from the command is
Code:
srw-rw----  1 root  wheel  0 Jan 14 20:56 /var/run/php-fpm.sock
that socket should be owned by www, check you uncommented the 'listen.owner' lines in php-fpm.conf
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
FINALLY! It's up.I didn't uncomment the lines in the php-fpm.conf file.

Sorry for all the trouble I've caused for being a noob. :oops:
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
FINALLY! It's up.I didn't uncomment the lines in the php-fpm.conf file.

Sorry for all the trouble I've caused for being a noob. :oops:
No problem, glad you got through it.

At least you can say you know how to setup stuff on FreeBSD. Or at least learned a thing or two.
 

hearts12181

Cadet
Joined
Jul 1, 2012
Messages
3
This worked! Thanks!


Try this. Then run, "service nginx reload"
Code:
worker_processes 2;

events {
    worker_connections  1024;
}

http {
    include      mime.types;
    default_type  application/octet-stream;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    access_log  logs/access.log  main;
    sendfile        off;
    #keepalive_timeout  0;
    keepalive_timeout  65;
    gzip off;

    server {
        root /usr/local/www/owncloud;
        location = /robots.txt { allow all; access_log off; log_not_found off; }
        location = /favicon.ico { access_log off; log_not_found off; }
            index index.php;
            try_files $uri $uri/ /index.php$is_args$args;
            client_max_body_size 512M;
            location ~ ^/(?:\.|data|config|db_structure\.xml|README) {
                deny all;
            }
            location ~ \.php(?:$|/) {
                fastcgi_split_path_info ^(.+\.php)(/.*)$;
                fastcgi_pass unix:/var/run/php-fpm.sock;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                include fastcgi_params;
                fastcgi_param MOD_X_ACCEL_REDIRECT_ENABLED on;
            }
            location ~* \.(?:jpg|gif|ico|png|css|js|svg)$ {
                expires 30d; add_header Cache-Control public;
            }
            location ^~ /data {
                internal;
                alias /mnt/files;
            }
    }
}
 
Top