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

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
Code:
root@owncloud:/ # ls -l /var/run/php-fpm.sock
srw-rw----  1 root  wheel  0 Oct 14 16:38 /var/run/php-fpm.sock
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
Code:
root@owncloud:/ # sockstat | grep php
www      php-fpm    97681 0  stream /var/run/php-fpm.sock
www      php-fpm    97680 0  stream /var/run/php-fpm.sock
root     php-fpm    97679 8  stream -> ??
root     php-fpm    97679 10 stream -> ??
root     php-fpm    97679 11 stream /var/run/php-fpm.sock
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Code:
root@owncloud:/ # ls -l /var/run/php-fpm.sock
srw-rw----  1 root  wheel  0 Oct 14 16:38 /var/run/php-fpm.sock
you didn't uncomment the prescribed lines in the php-fpm.conf
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
Not sure what that means, but I did replace the relevant lines mentioned in the install instructions into my php-fpm.conf:
I did just notice that there was missing a ";" in front of listen = /var/run/php-fpm.sock however after making that change i still am getting the same result
  1. listen = /var/run/php-fpm.sock
Is there a way to 'select all' so I can post of php-fpm.conf so you can see it?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Not sure what that means, but I did replace the relevant lines mentioned in the install instructions into my php-fpm.conf:
I did just notice that there was missing a ";" in front of listen = /var/run/php-fpm.sock however after making that change i still am getting the same result
  1. listen = /var/run/php-fpm.sock
Is there a way to 'select all' so I can post of php-fpm.conf so you can see it?
did you uncomment out the other 3 lines as specified?
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
yes, copied straight from my php-fpm.conf

;listen = /var/run/php-fpm.sock
;listen.owner = www
;listen.group = www
;env[PATH] = /usr/local/bin:/usr/bin:/bin
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
yes, copied straight from my php-fpm.conf

;listen = /var/run/php-fpm.sock
;listen.owner = www
;listen.group = www
;env[PATH] = /usr/local/bin:/usr/bin:/bin
no you didn't. you need to read very carefully
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
I am not sure what you mean? I have replaced the 4 lines as mentioned in the installation instructions in the php-fpm.conf, I just rechecked and they are the exact same as in the instructions.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I am not sure what you mean? I have replaced the 4 lines as mentioned in the installation instructions in the php-fpm.conf, I just rechecked and they are the exact same as in the instructions.
The lines you show above are commented out by leading ;'s unlike the instructions.
Once you have fixed this you need to restart php-fpm.
Code:
service php-fpm restart
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
Wow, great. So before you mentioned that I had actually tired that but it produced the same result because I didnt "service php-fpm restart" I would personally like to thank you for being patient and offering your help. I would also glady donate to you for the help you have provided along with the guide, just let me know how I can. Thank you!
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Wow, great. So before you mentioned that I had actually tired that but it produced the same result because I didnt "service php-fpm restart" I would personally like to thank you for being patient and offering your help. I would also glady donate to you for the help you have provided along with the guide, just let me know how I can. Thank you!
No problem. Glad you got through it and hope it work well for you.

Here's a link if you use paypal. Thanks!
https://www.paypal.com/cgi-bin/webs...lig@gmail.com&item_name=JRuehlig Technologies
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
Can anyone post there nignx.conf for freenas, I apparently was modifying the wrong nginx when attempting to setup ssl on owncloud's nginx.conf and now I lost web access to frenas.... wow
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Can anyone post there nignx.conf for freenas, I apparently was modifying the wrong nginx when attempting to setup ssl on owncloud's nginx.conf and now I lost web access to frenas.... wow
If you reboot the config should be overwritten by the one on the read only partition
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
This is what my freenas nginx.conf is now if anyone can see what I screwed up.
Code:
#
#    FreeNAS nginx configuration file
#

user www www;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    # reserve 1MB under the name 'proxied' to track uploads
    upload_progress proxied 1m;

    sendfile        on;
    #tcp_nopush     on;
    client_max_body_size 512mb;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
    #upload_store /var/tmp/firmware;
    client_body_temp_path /var/tmp/firmware;

    server {
        server_name  localhost;
        listen                  192.168.12.168:80  default_server ssl spdy;
        listen                  80;

        ssl_certificate         "";
        ssl_certificate_key     "";
        ssl_dhparam /data/dhparam.pem;

        ssl_session_timeout     120m;
        ssl_session_cache       shared:ssl:16m;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EDH+
        add_header Strict-Transport-Security max-age=31536000;

        ## TODO: OCSP Stapling
        #ssl_stapling on;
        #ssl_stapling_verify on;
        #resolver ;
        #ssl_trusted_certificate ;

        location / {
            include fastcgi_params;
            fastcgi_pass 127.0.0.1:9042;
            fastcgi_pass_header Authorization;
            fastcgi_intercept_errors off;
            fastcgi_read_timeout 600m;
            #fastcgi_temp_path /var/tmp/firmware;
            fastcgi_param HTTPS $https;

            # track uploads in the 'proxied' zone
            # remember connections for 30s after they finished
            track_uploads proxied 30s;
        }

        location /progress {
            # report uploads tracked in the 'proxied' zone
            report_uploads proxied;
        }

        location /dojango {
            alias /usr/local/www/freenasUI/dojango;
        }

        location /static {
            alias /usr/local/www/freenasUI/static;
}

        location /reporting/graphs {
            alias /var/db/graphs;
        }

        location /dojango/dojo-media/release/1.10.1 {
            alias /usr/local/www/dojo;
        }

        location /docs {
                alias /usr/local/www/data/docs;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }

        #include plugins.conf;
    }
    server {
        listen 192.168.12.168:443;
        listen 443;
        server_name localhost;
        return 307 https://$host:443$request_uri;
    }
}

 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
Last edited:

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
I seem to have fixed it haha I changed
Code:
  'trusted_domains' =>
   array (
    0 => '192.168.1.52',
  ),

to
Code:
  'trusted_domains' =>
  array (
    0 => '<mydomain>.com',
  ),

at the top of config.php, worked on my phone with wifi off. Not sure if it's the right way to do it, but it worked haha


What file do I need to edit to make the the changes? You mentioned config.php is that the php-fpm.conf? I could not find the trusted domains line there. Thanks for the help.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
What file do I need to edit to make the the changes? You mentioned config.php is that the php-fpm.conf? I could not find the trusted domains line there. Thanks for the help.
/usr/local/www/owncloud/config/config.php
 

Chakalov

Explorer
Joined
Feb 9, 2015
Messages
53
I tried to update my OC from 8.0.1 to 8.1.3 by doing the following:
- stopping the services
- renaming the current ownCloud directory
- download the latest version and unarchive it in the right place and setting the correct (www:www) permissions recursively
- copied back the config.php file and also created a new nginx.conf copied from the fist post of this thread
- started back all services and opened the OC via the web browser where a welcome upgrade message has waited for me. Despite it said that all upgrade procedures went just fine the upgrade page continued to show up.
- I tried to manually update via the shell and occ command but still with no luck: it get stuck at this point:

Code:
root@cloud:/usr/local/etc/nginx # su www
$ php /usr/local/www/owncloud/occ upgrade
ownCloud or one of the apps require upgrade - only a limited number of commands are available
Checked database schema update
Checked database schema update for apps
Updated database


.... and just hangs there.

What am I doing wrong? :(
 
Top