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

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
create the file /usr/local/www/owncloud/updater/phpinfo.php with...
Code:
<?php
phpinfo();
?>

browser jail_IP/owncloud/updater/phpinfo.php and check if APCu is enabled/available.

the services should be enabled. so after you restart the jail, can you confirm the output of 'service nginx status'
 

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
create the file /usr/local/www/owncloud/updater/phpinfo.php with...
Code:
<?php
phpinfo();
?>

browser jail_IP/owncloud/updater/phpinfo.php and check if APCu is enabled/available.

the services should be enabled. so after you restart the jail, can you confirm the output of 'service nginx status'
hmmmm.... dont work. I have made a file phpinfo.php in the specified directory including
Code:
<?php
phpinfo();
?>


when i do
Code:
https://192.168.1.10/nextcloud/updater/phpinfo.php


i get
Code:
No input file specified.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
No, it also don't work. I am on my freenas local server and i have a folder named nextcloud.
you didn't answer if you are using a webroot. the install I document uses /owncloud
 

Joshua Parker Ruehlig

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

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
do you see the issue with the URL I have you then =P
I did a new install. This solved my problem with the cron.php. But I still get this error when i try to activate memcache
Code:
Memcache \OC\Memcache\APCu not available for local cache Is the matching PHP module installed and enabled?

Also I tryed to do
Code:
 browser jail_IP/owncloud/updater/phpinfo.php

still without succecc.

I have installed owncloud according to your how-to and then switch over to nextcloud (only renamed the nextcloud folder in to ownlcoud)

I have done the installation in a freebsd vm, because of issues with the jails (cant do pkg update. Always get this message:

Code:
Unable to update repository FreeBSD 


Because of this, I can install any other pkg.

For now nextcloud is running (without memcache). This shit fuc...ed my whole day :/
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
@ArgaWoW
I thought you would have realized it should be https://jail_IP/updater/phpinfo.php

A VM? I would never do that. You probably just need check DNS is working in the jail, or delete any package server settings in the jail (I think "rm /etc/pkg.conf").

Wow, that sucks. I can get through these steps in under 15 mins when I test them.
 

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
@ArgaWoW
I thought you would have realized it should be https://jail_IP/updater/phpinfo.php

A VM? I would never do that. You probably just need check DNS is working in the jail, or delete any package server settings in the jail (I think "rm /etc/pkg.conf").

Wow, that sucks. I can get through these steps in under 15 mins when I test them.
Now i got the php-page. Please find attached the APCu column. I guess it looks good.

My DNS in the jail seems to work. eg. I am able to do "portsnap fetch update". The file /etc/pkg.conf don't exist in the jail. Also a "ping freebsd.org" works. Any Idea?
Find attached a picture of the output

I found the problem.I have edit the file /usr/local/etc/pkg/repos/FreeBSD.conf and changed from :
Code:

#FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest",
  mirror_type: "srv",
  enabled: yes
}

into
Code:

#FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/freebsd:11:x86:64/latest",
  mirror_type: "srv",
  enabled: yes
}



Why only I have this issue? I can't find anything about it here in the forum....

btw... you right... that sucks very hard :(
 

Attachments

  • apcu.jpg
    apcu.jpg
    121.2 KB · Views: 469
  • pkg-update.jpg
    pkg-update.jpg
    63.7 KB · Views: 480
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Now i got the php-page. Please find attached the APCu column. I guess it looks good.

My DNS in the jail seems to work. eg. I am able to do "portsnap fetch update". The file /etc/pkg.conf don't exist in the jail. Also a "ping freebsd.org" works. Any Idea?
Find attached a picture of the output

I found the problem.I have edit the file /usr/local/etc/pkg/repos/FreeBSD.conf and changed from :
Code:

#FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest",
  mirror_type: "srv",
  enabled: yes
}

into
Code:

#FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/freebsd:11:x86:64/latest",
  mirror_type: "srv",
  enabled: yes
}



Why only I have this issue? I can't find anything about it here in the forum....

btw... you right... that sucks very hard :(
hmm maybe you need to add "apc.enable_cli=1"
to your php.ini (then restart php-fpm)
if that works I can add it to the guide

I have seen the repo issue on this forum before. when I hit it I just delete the pkg.conf and keep going.
 

ArgaWoW

Patron
Joined
Jul 4, 2015
Messages
444
hmm maybe you need to add "apc.enable_cli=1"
to your php.ini (then restart php-fpm)
if that works I can add it to the guide

I have seen the repo issue on this forum before. when I hit it I just delete the pkg.conf and keep going.
Thats it. Now it works. You can add it to the guide :)

Thanks for you help!

edit:
I have to do
Code:
portsnap fetch extract

before I am able to do:
Code:
make config-recursive install -C /usr/ports/databases/pecl-redis
make config-recursive install -C /usr/ports/devel/pecl-APCu


Perhaps you should this also add to your how-to.
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Thats it. Now it works. You can add it to the guide :)

Thanks for you help!

edit:
I have to do
Code:
portsnap fetch extract

before I am able to do:
Code:
make config-recursive install -C /usr/ports/databases/pecl-redis
make config-recursive install -C /usr/ports/devel/pecl-APCu


Perhaps you should this also add to you how-to.
awesome, thanks for testing that. I'll get that note in. And yes, I'll add the portsnap notes, but just make the caches an optional thing.
 

Elo

Contributor
Joined
Mar 11, 2012
Messages
122
Strange Error updating to 9.1.5

Hi I upgraded to 9.1.5 using the following commands:

# service nginx stop
# cd /tmp
# fetch http://download.owncloud.org/community/owncloud-9.1.5.tar.bz2
# tar jxvf owncloud-*.tar.bz2 -C /usr/local/www
# rm owncloud-*.tar.bz2
# chown -R www:www /usr/local/www/owncloud
# service nginx start

Update seemed normal with no error messages. I can log on to the server and it seems that syncking works ok but at a closer look new files is not written up to the server.
There is an error message on the client saying (translated from Norwegian):
Continued blacklisting: Error transfering https://{server-ip}/remote.php/webdav/{name of file} - server replied: Forbidden

However when i acces the server through the web interface as administrator and try to download a file I get the following error message:

ownCloud

Service Unavailable

Technical details
  • Remote Address: 192.168.111.1
  • Request ID: wAfxhuT5rShovN+nARgR
There is nothing in the log and I am runing php 5.6.14 which according to the owncload adm manual should be OK.

I do not know how to debug further and need to help.

Best Regards
Ole
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Strange Error updating to 9.1.5

Hi I upgraded to 9.1.5 using the following commands:

# service nginx stop
# cd /tmp
# fetch http://download.owncloud.org/community/owncloud-9.1.5.tar.bz2
# tar jxvf owncloud-*.tar.bz2 -C /usr/local/www
# rm owncloud-*.tar.bz2
# chown -R www:www /usr/local/www/owncloud
# service nginx start

Update seemed normal with no error messages. I can log on to the server and it seems that syncking works ok but at a closer look new files is not written up to the server.
There is an error message on the client saying (translated from Norwegian):
Continued blacklisting: Error transfering https://{server-ip}/remote.php/webdav/{name of file} - server replied: Forbidden

However when i acces the server through the web interface as administrator and try to download a file I get the following error message:

ownCloud

Service Unavailable

Technical details
  • Remote Address: 192.168.111.1
  • Request ID: wAfxhuT5rShovN+nARgR
There is nothing in the log and I am runing php 5.6.14 which according to the owncload adm manual should be OK.

I do not know how to debug further and need to help.

Best Regards
Ole
I personally would not have just overwritten you current directory, and instead would have...
moved your old directory
extract the new files
copy over your old config
You then also need to update your database with 'occ upgrade'

I think running these steps again may work for you
Code:
mv /usr/local/www/owncloud /usr/local/www/owncloud-bak
fetch "http://download.owncloud.org/community/owncloud-9.1.5.tar.bz2"
tar jxf owncloud-*.tar.bz2 -C /usr/local/www
cp /usr/local/www/owncloud-bak/config/config.php /usr/local/www/owncloud/config
chown -R www:www /usr/local/www/owncloud
su -m www -c 'php /usr/local/www/owncloud/occ upgrade'
rm -r owncloud-*.tar.bz2 /usr/local/www/owncloud-bak
 

Elo

Contributor
Joined
Mar 11, 2012
Messages
122
Hi Joshua, thanks for quick answer

All good until:

su -m www -c 'php /usr/local/www/owncloud/occ upgrade'
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Data directory (/usr/local/www/owncloud/data) is invalid
Please check that the data directory contains a file ".ocdata" in its root.

An unhandled exception has been thrown:
exception 'Exception' with message 'Environment not properly prepared.' in /usr/local/www/owncloud-bak2/lib/private/Console/Application.php:120
Stack trace:
#0 /usr/local/www/owncloud/console.php(101): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/owncloud/occ(11): require_once('/usr/local/www/...')
#2 {main}root@owncloudjail:/usr/local/www/owncloud # p /usr/local/www/owncloud-bak2/data/.ocdata /usr/local/www/owncloud/data/.ocdata


Then I copied over the old .ocdata andtried again:

su -m www -c 'php /usr/local/www/owncloud/occ upgrade'
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
ownCloud is already latest version

The problem is still there I am afraid..

Error:
PDF.js v1.1.469 (build: f06aa6a)
Message: Unexpected server response (503) while retrieving PDF "https://192.168.111.16/remote.php/webdav/Arbeidsfolder/IF Tilbud 6.5.16.PDF".
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Joshua, thanks for quick answer

All good until:

su -m www -c 'php /usr/local/www/owncloud/occ upgrade'
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Data directory (/usr/local/www/owncloud/data) is invalid
Please check that the data directory contains a file ".ocdata" in its root.

An unhandled exception has been thrown:
exception 'Exception' with message 'Environment not properly prepared.' in /usr/local/www/owncloud-bak2/lib/private/Console/Application.php:120
Stack trace:
#0 /usr/local/www/owncloud/console.php(101): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /usr/local/www/owncloud/occ(11): require_once('/usr/local/www/...')
#2 {main}root@owncloudjail:/usr/local/www/owncloud # p /usr/local/www/owncloud-bak2/data/.ocdata /usr/local/www/owncloud/data/.ocdata


Then I copied over the old .ocdata andtried again:

su -m www -c 'php /usr/local/www/owncloud/occ upgrade'
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
ownCloud is already latest version

The problem is still there I am afraid..

Error:
PDF.js v1.1.469 (build: f06aa6a)
Message: Unexpected server response (503) while retrieving PDF "https://192.168.111.16/remote.php/webdav/Arbeidsfolder/IF Tilbud 6.5.16.PDF".
If you followed this guide your data should be in '/mnt/files' not in 'data'.
 

Elo

Contributor
Joined
Mar 11, 2012
Messages
122
I did not follow the guide to the letter and my data (the users data) is inside the jail only and resides in /usr/local/www/owncloud/data/............ and that is probably the problem since all the data was moved and is no longer there (I have backup of everything). I did not allocate space outside the jail in the normal way and I guess following your steps will then not work. I did this for security reasons as I use the system not only for private stuff but also for work and I did think it would be better to have the data reside only inside the Jail and not on the mopre general FreeNaS main system. I did this a long time ago and forgot to think about it when I did the upgrade ... STUPID

What if I move the data back inside? and get it to work (hopefully). Can I then add storage the normal way after that?
 
Last edited:

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I did not follow the guide to the letter and my data (the users data) is inside the jail only and resides in /usr/local/www/owncloud/data/............ and that is probably the porblem since all the data was moved and is no longer there (I have backup of everything). I did not allocate space outside the jail in the normal way and I guess following your steps will then not work.

What if I move the data back inside? and get it to work (hopefully). Can I then add storage the normal way after that?
you can move it back and try running 'occ upgrade'. that should hopefully get you a working upgraded instance.

As for adding storage after. yeah, you could do that as well. If you want it somewhere different you'll need to edit config/config.php
I really don't like have my data-directory directly where my application files are because of situations like this. the data could accidently deleted very easily. also, it's good to have it on a dataset you snapshot regularly.
 

Elo

Contributor
Joined
Mar 11, 2012
Messages
122
I did not allocate space outside the jail in the normal way and I guess following your steps will then not work. I did this for security reasons as I use the system not only for private stuff but also for work and I did think it would be better to have the data reside only inside the Jail and not on the mopre general FreeNaS main system. I did this a long time ago and forgot to think about it when I did the upgrade ... STUPID In hinsight I think your way is better.

Perhaps the system is already working as errors have to be expected when I try to download a file from the web interfacethat that is not there ...

I will try to do as you suggest. I will take some time as there is a lot of data.

I do not understand the error messages and how they link to the lack of data though?

Perhaps I will reinstal everything from scratch..
 
Top