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

robuyo

Dabbler
Joined
Apr 13, 2015
Messages
11

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
a temporary fix is to browse to owncloud at /owncloud/index.php/apps/files

I'm still working on updating the nginx config for the owncloud documentation
 

robuyo

Dabbler
Joined
Apr 13, 2015
Messages
11
Tried but same error.
I'm also looking for a config that works for me, now trying...

upstream php-handler {
server unix:/var/run/php5-fpm.sock;
}

Thanks for the effort Joshua.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Tried but same error.
I'm also looking for a config that works for me, now trying...

upstream php-handler {
server unix:/var/run/php5-fpm.sock;
}

Thanks for the effort Joshua.
that's not going to make a difference.

There's no point in looking, there isn't one developed for owncloud 9 yet.
Me and a few others are writing it https://github.com/owncloud/documentation/issues/2014
 

robuyo

Dabbler
Joined
Apr 13, 2015
Messages
11

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
File upload from UI working with your latest nginx conf! What about inviting you paella? :p
Thanks!
yup, it should all work now. =]
 

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
Hi Joshua,
Have you done the Upgrade to V9? Can you please explain the steps. I am continous reading this tread but havent found nothing about how to Upgrade from 8.x.

Thank you very much

Gesendet von meinem SM-G900F mit Tapatalk
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Joshua,
Have you done the Upgrade to V9? Can you please explain the steps. I am continous reading this tread but havent found nothing about how to Upgrade from 8.x.

Thank you very much

Gesendet von meinem SM-G900F mit Tapatalk
I did. theres a page in the owncloud docs about upgrading a source install like ours.
basically move your owncloud folder, download the new source folder, copy over your config, set permissions, run 'occ upgrade'.
maybe I or someone else could document the steps, only a few lines.
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
ill be the first one to say it then, some of us literally would end up wrecking/failing at "a few lines." :( However, I am patient and have no problem waiting for you to update the guide when you get the time. Thanks for all your efforts.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
can you try this out and see if it works?

Code:
mv /usr/local/www/owncloud /usr/local/www/owncloud-bak
fetch "http://download.owncloud.org/community/owncloud-9.0.0.tar.bz2"
tar jxf owncloud-*.tar.bz2 -C /usr/local/www
rm owncloud-*.tar.bz2
cp /usr/local/www/owncloud-bak/config/config.php /usr/local/www/owncloud/config
chown -R www:www /usr/local/www/owncloud

chsh -s /bin/sh www
su www
php /usr/local/www/owncloud/occ upgrade
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
can you try this out and see if it works?

Code:
mv /usr/local/www/owncloud /usr/local/www/owncloud-bak
fetch "http://download.owncloud.org/community/owncloud-9.0.0.tar.bz2"
tar jxf owncloud-*.tar.bz2 -C /usr/local/www
rm owncloud-*.tar.bz2
cp /usr/local/www/owncloud-bak/config/config.php /usr/local/www/owncloud/config
chown -R www:www /usr/local/www/owncloud

chsh -s /bin/sh www
su www
php /usr/local/www/owncloud/occ upgrade

trying now :)

root@OC82:/ # mv /usr/local/www/owncloud /usr/local/www/owncloud-bak
root@OC82:/ # fetch "http://download.owncloud.org/community/owncloud-9.0.0.tar.bz2"
owncloud-9.0.0.tar.bz2 100% of 21 MB 349 kBps 01m04s
root@OC82:/ # tar jxf owncloud-*.tar.bz2 -C /usr/local/www
tar: /usr/local/www: Not found in archive
tar: -C: Not found in archive
tar: owncloud-9.0.0.tar.bz2: Not found in archive
tar: Error exit delayed from previous errors.

I am on FreeNAS 9.10, that shouldn't matter I hope.
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I don't think 9.10 should make a difference. looks like the tar command isn't seeing your "-C" flag, please double check your executing the command exactly as I outlined. its the same as in the install post
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
I copied and pasted the commands you posted, tried 3 separate times, made sure there were no extra spaces by accident, same error :(
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I copied and pasted the commands you posted, tried 3 separate times, made sure there were no extra spaces by accident, same error :(
then just drop the -C flag and the path. then move the folder over
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
then just drop the -C flag and the path. then move the folder over

For some reason its not recognizing "-*." part of the tar command and that was the whole issue. When I typed the full path of the tar file it was able to run successfully.... odd.
I just finished upgrading with the commands you provided, and it all works great. thanks for your assistance.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
awesome! if you update the nginx config I got pretty URLs enabled in OC9
 

Michael Sparks

Explorer
Joined
Apr 23, 2014
Messages
56
I only added lines 13, 16, 17

nginx: [emerg] invalid number of arguments in "fastcgi_param" directive in /usr/local/etc/nginx/nginx.conf:41
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed


Code:
worker_processes 4;

events {
    worker_connections  1024;
}

http {
    include      mime.types;
    default_type  application/octet-stream;
    sendfile        off;
    keepalive_timeout  65;
    gzip off;
    add_header strict-transport-security max-age=15768000;

    server {
      ssl_certificate /usr/local/etc/nginx/server.crt;
      ssl_certificate_key /usr/local/etc/nginx/server.key;
        root /usr/local/www;
        location = /robots.txt { allow all; access_log off; log_not_found off; }
        location = /favicon.ico { access_log off; log_not_found off; }
        location ^~ /owncloud {
            client_max_body_size 512M;
            error_page 403 /owncloud/core/templates/403.php;
            error_page 404 /owncloud/core/templates/404.php;
            location /owncloud {
                rewrite ^ /owncloud/index.php$uri;
            }
            location ~ ^/owncloud/(?:build|tests|config|lib|3rdparty|templates|data)/ {
                deny all;
            }
            location ~ ^/owncloud/(?:\.|autotest|occ|issue|indie|db_|console) {
                deny all;
            }
            location ~ ^/owncloud/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-pro
                include fastcgi_params;
                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;
                fastcgi_param front_controller_active true
                fastcgi_intercept_errors on;
            }
            location ~* \.(?:css|js)$ {
                try_files $uri /owncloud/index.php$uri$is_args$args;
                add_header Cache-Control "public, max-age=7200";
            }
            location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ {
                try_files $uri /owncloud/index.php$uri$is_args$args;
            }

        }
    }
}
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I missed a semi-colon in the front_controller line, I'll fix it in the post
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
can you try this out and see if it works?

Code:
mv /usr/local/www/owncloud /usr/local/www/owncloud-bak
fetch "http://download.owncloud.org/community/owncloud-9.0.0.tar.bz2"
tar jxf owncloud-*.tar.bz2 -C /usr/local/www
rm owncloud-*.tar.bz2
cp /usr/local/www/owncloud-bak/config/config.php /usr/local/www/owncloud/config
chown -R www:www /usr/local/www/owncloud

chsh -s /bin/sh www
su www
php /usr/local/www/owncloud/occ upgrade

Thanks! This worked perfectly for me, exactly as above.
 
Top