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

Joined
Dec 2, 2015
Messages
730
Joshua - Thanks for this guide. I used it to get OC 8.2 working some time ago. I suspect the info I need to get a working update to owncloud 9 is probably hidden in the last few pages of this thread, but so far I have not succeeded to squeeze it out. I've restored my snapshots to roll back to OC 8 for now, while I lick my wounds, waiting for the next quiet period when I dare to once again attempt to upgrade to OC 9.

I would be extremely appreciative if you could make a new guide for OC 9. You provide so much assistance on various plugins/jails - I'd be happy to donate a few $$ if you have a PayPal account, or some other way for users to show their appreciation.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Yeah, I made sure to add /owncloud to the end of the jail ip. ok ill remove the other jail then, and add both datasets to the same jail. any other ideas? could it be that the jail didnt have both datasets?
not sure, but since you created 2 jails you obviously made some mistakes. The main place to look is the nginx.conf
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Joshua - Thanks for this guide. I used it to get OC 8.2 working some time ago. I suspect the info I need to get a working update to owncloud 9 is probably hidden in the last few pages of this thread, but so far I have not succeeded to squeeze it out. I've restored my snapshots to roll back to OC 8 for now, while I lick my wounds, waiting for the next quiet period when I dare to once again attempt to upgrade to OC 9.

I would be extremely appreciative if you could make a new guide for OC 9. You provide so much assistance on various plugins/jails - I'd be happy to donate a few $$ if you have a PayPal account, or some other way for users to show their appreciation.
Weclome! If you want to try to upgrade these steps should work. I'd replace 9.0.0 with 9.0.1 though. Tell me if that doesn't work for you.
https://forums.freenas.org/index.ph...x-php-fpm-and-mysql.17786/page-51#post-274763

And if you update your nginx.conf from the first few post of this thread you can get "Pretty URLs" working.

Here's a link to my paypal in case you wanted to make a contribution
https://www.paypal.com/cgi-bin/webs...lig@gmail.com&item_name=JRuehlig Technologies
 

rodofrn

Contributor
Joined
Apr 13, 2016
Messages
180
Hi again, thanks for the quick reply, I redid the whole thing, using only 1 jail with both directories. And now it says

502 Bad Gateway
nginx/1.8.1

when i log into the owncloud. I have no idea what is going on, I followed all the steps and still nothing. Please help, I really want this feature in my FreeNAS server.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi again, thanks for the quick reply, I redid the whole thing, using only 1 jail with both directories. And now it says

502 Bad Gateway
nginx/1.8.1

when i log into the owncloud. I have no idea what is going on, I followed all the steps and still nothing. Please help, I really want this feature in my FreeNAS server.
can you post a screenshot of your nginx.conf

also what happens when you browse to the url?
http://JAIL_IP/owncloud/core/img/appstore.svg
 

Bruce Wilfong

Explorer
Joined
Mar 25, 2016
Messages
85
Hello all, again. Just started having issue, when I go to http://jail_ip/owncloud I am getting a message;
Internal Server Error

"The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log."

I have jacked something somewhere, where can I find the server log file to get the information? I am figuring it is probably a permission error as I have tried everything short of blowing away the jail and re-installing.

Thanks
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hello all, again. Just started having issue, when I go to http://jail_ip/owncloud I am getting a message;
Internal Server Error

"The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log."

I have jacked something somewhere, where can I find the server log file to get the information? I am figuring it is probably a permission error as I have tried everything short of blowing away the jail and re-installing.

Thanks
that's probably not a permission issue, likely a nginx config issue

please do what I asked here.
https://forums.freenas.org/index.ph...x-php-fpm-and-mysql.17786/page-53#post-279323
 

Bruce Wilfong

Explorer
Joined
Mar 25, 2016
Messages
85
nginx file: When I goto http://192.168.1.14/owncloud/core/img/appstore.svg I get the "download on the AppStore" icon.

#user nobody;
worker_processes 2;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;
sendfile off;
keepalive_timeout 65;
gzip off;

server {
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 1024M;
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|d
deny all;
}
location ~ ^/owncloud/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location ~ ^/owncloud/(?:index|remote|public|cron|core/ajax/update|s
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;
}

}
}
}
 

rodofrn

Contributor
Joined
Apr 13, 2016
Messages
180
Hello, this are the screenshots.
 

Attachments

  • Untitled2.png
    Untitled2.png
    82.2 KB · Views: 381
  • Untitled.png
    Untitled.png
    125.4 KB · Views: 362

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hello, this are the screenshots.
your nginx config has some errors. looks like some lines got wrapped when you pasted them into putty.

Then, once you fix the config reload nginx.
Code:
service nginx reload
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
nginx file: When I goto http://192.168.1.14/owncloud/core/img/appstore.svg I get the "download on the AppStore" icon.

#user nobody;
worker_processes 2;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;
sendfile off;
keepalive_timeout 65;
gzip off;

server {
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 1024M;
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|d
deny all;
}
location ~ ^/owncloud/(?:\.|autotest|occ|issue|indie|db_|console) {
deny all;
}
location ~ ^/owncloud/(?:index|remote|public|cron|core/ajax/update|s
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;
}

}
}
}
I specifically wanted a screenshot, not just paste the same thing I had pasted.

the icon showing means your nginx config is at least partly working. what's the output of 'sockstat'
 

rodofrn

Contributor
Joined
Apr 13, 2016
Messages
180
Nothing mate. I restarted the service and the jail. Here are the screenshots of the nginx fixed...
 

Attachments

  • Untitled3.png
    Untitled3.png
    175.6 KB · Views: 396

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Nothing mate. I restarted the service and the jail. Here are the screenshots of the nginx fixed...
Output of 'sockstat' command?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Sorry, here it is...
No worries, lol I didn't ask you for it yet.
Hmm, and what about?
Code:
ls -l /var/run/php-fpm.sock
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
:) here...
double check your /usr/local/etc/php-fpm.conf
looks like you didn't uncomment the user 'listen.owner'

then restart php-fpm
service php-fpm restart
 
Top