NextCloud Setup Instructions

Status
Not open for further replies.

Zofoor

Patron
Joined
Aug 16, 2016
Messages
219
You can either compile it yourself from ports...
Code:
cd /usr/ports/devel/php70-APCu && make config-recursive install clean
or change the local caching method to Redis...
Code:
su -m www -c 'php /usr/local/www/owncloud/occ config:system:set memcache.local --value="\OC\Memcache\Redis"'
If you want to have php-70-APCu you need first to run
Code:
 portsnap extract

and
Code:
 portsnap fetch update

in that way the code in ports is updated and you'll find the missing folder
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I followed the excellent owncloud tutorial by @Joshua Parker Ruehlig replacing the code with nextcloud

fetch "https://download.nextcloud.com/server/releases/nextcloud-11.0.0.tar.bz2"
tar jxf nextcloud-*.tar.bz2 -C /usr/local/www
rm nextcloud-*.tar.bz2
chown -R www:www /usr/local/www/nextcloud /mnt/files
*/15 * * * * /usr/local/bin/php -f /usr/local/www/nextcloud/cron.php

ln -s /usr/local/www/nextcloud/robots.txt /usr/local/www

the server worked and I was able to enter access the files that are included in nextcloud.
When I entered su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"' I get this error in the jail and the web interface is just a blank page.
An unhandled exception has been thrown:
Error: Class '\NC\Memcache\APCu' not found in /usr/local/www/nextcloud/lib/private/Memcache/Factory.php:86
Stack trace:
#0 /usr/local/www/nextcloud/lib/private/Server.php(383): OC\Memcache\Factory->__construct('f231d3da2f95adc...', Object(OC\Log), '\\NC\\Memcache\\AP...', '\\NC\\Memcache\\AP...', NULL)
#1 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#2 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet('MemCacheFactory')
#3 /usr/local/www/nextcloud/lib/private/ServerContainer.php(89): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
#4 /usr/local/www/nextcloud/lib/private/Server.php(1098): OC\ServerContainer->query('MemCacheFactory')
#5 /usr/local/www/nextcloud/lib/base.php(932): OC\Server->getMemCacheFactory()
#6 /usr/local/www/nextcloud/lib/base.php(657): OC::registerAutoloaderCache()
#7 /usr/local/www/nextcloud/lib/base.php(1092): OC::init()
#8 /usr/local/www/nextcloud/console.php(48): require_once('/usr/local/www/...')
#9 /usr/local/www/nextcloud/occ(11): require_once('/usr/local/www/...')
#10 {main}root@nextcloud:/usr/local/www/nextcloud/lib/private/Memcache #

I then compiled the APCu

portsnap fetch
portsnap extract
portsnap fetch update
cd /usr/ports/devel/php70-APCu && make config-recursive install clean

but still same error.
Any ideas on what the problem is? Happy New Year to all.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I followed the excellent owncloud tutorial by @Joshua Parker Ruehlig replacing the code with nextcloud

fetch "https://download.nextcloud.com/server/releases/nextcloud-11.0.0.tar.bz2"
tar jxf nextcloud-*.tar.bz2 -C /usr/local/www
rm nextcloud-*.tar.bz2
chown -R www:www /usr/local/www/nextcloud /mnt/files
*/15 * * * * /usr/local/bin/php -f /usr/local/www/nextcloud/cron.php

ln -s /usr/local/www/nextcloud/robots.txt /usr/local/www

the server worked and I was able to enter access the files that are included in nextcloud.
When I entered su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"' I get this error in the jail and the web interface is just a blank page.
An unhandled exception has been thrown:
Error: Class '\NC\Memcache\APCu' not found in /usr/local/www/nextcloud/lib/private/Memcache/Factory.php:86
Stack trace:
#0 /usr/local/www/nextcloud/lib/private/Server.php(383): OC\Memcache\Factory->__construct('f231d3da2f95adc...', Object(OC\Log), '\\NC\\Memcache\\AP...', '\\NC\\Memcache\\AP...', NULL)
#1 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#2 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet('MemCacheFactory')
#3 /usr/local/www/nextcloud/lib/private/ServerContainer.php(89): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
#4 /usr/local/www/nextcloud/lib/private/Server.php(1098): OC\ServerContainer->query('MemCacheFactory')
#5 /usr/local/www/nextcloud/lib/base.php(932): OC\Server->getMemCacheFactory()
#6 /usr/local/www/nextcloud/lib/base.php(657): OC::registerAutoloaderCache()
#7 /usr/local/www/nextcloud/lib/base.php(1092): OC::init()
#8 /usr/local/www/nextcloud/console.php(48): require_once('/usr/local/www/...')
#9 /usr/local/www/nextcloud/occ(11): require_once('/usr/local/www/...')
#10 {main}root@nextcloud:/usr/local/www/nextcloud/lib/private/Memcache #

I then compiled the APCu

portsnap fetch
portsnap extract
portsnap fetch update
cd /usr/ports/devel/php70-APCu && make config-recursive install clean

but still same error.
Any ideas on what the problem is? Happy New Year to all.
Maybe you should try restarting php-fpm in case APCu is for some reason not loaded? Or you can create a phpinfo page to verify it is loaded.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Maybe you should try restarting php-fpm in case APCu is for some reason not loaded? Or you can create a phpinfo page to verify it is loaded.
restarting php-fpm gives
Code:
service php-fpm restart
Performing sanity check on php-fpm configuration:
[02-Jan-2017 21:44:32] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Stopping php_fpm.
Waiting for PIDS: 67769.
Performing sanity check on php-fpm configuration:
[02-Jan-2017 21:44:32] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Starting php_fpm.



I added the file test.php
Code:
<?php
phpinfo();
?>

to the /usr/local/www/nextcloud/ directory
http://myjail for nextcloud IP/nextcloud/test.php
and still get a blank page
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
restarting php-fpm gives
Code:
service php-fpm restart
Performing sanity check on php-fpm configuration:
[02-Jan-2017 21:44:32] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Stopping php_fpm.
Waiting for PIDS: 67769.
Performing sanity check on php-fpm configuration:
[02-Jan-2017 21:44:32] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Starting php_fpm.



I added the file test.php
Code:
<?php
phpinfo();
?>

to the /usr/local/www/nextcloud/ directory
http://myjail for nextcloud IP/nextcloud/test.php
and still get a blank page
If even that file gives you a blank page it not a problem with nextcloud or likely APCu. It sounds like your nginx config isn't correct.

As for the APCu error you got with occ, I'm not sure why that does not work on your system. I just dounle checked the command and it worked on my system. Maybe you should update to the latest nextcloud
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I reinstalled the jail from scratch and got to the user interface with the sample files. After
Code:
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.local --value="\NC\Memcache\APCu"'
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
System config value memcache.local set to string \NC\Memcache\APCu
root@nextcloud:/usr/local/etc # su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.locking --value="\NC\Memcache\Redis"'
An unhandled exception has been thrown:
Error: Class '\NC\Memcache\APCu' not found in /usr/local/www/nextcloud/lib/private/Memcache/Factory.php:86
Stack trace:
#0 /usr/local/www/nextcloud/lib/private/Server.php(383): OC\Memcache\Factory->__construct('3effa523056a7c4...', Object(OC\Log), '\\NC\\Memcache\\AP...', '\\NC\\Memcache\\AP...', NULL)
#1 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#2 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet('MemCacheFactory')
#3 /usr/local/www/nextcloud/lib/private/ServerContainer.php(89): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
#4 /usr/local/www/nextcloud/lib/private/Server.php(1098): OC\ServerContainer->query('MemCacheFactory')
#5 /usr/local/www/nextcloud/lib/base.php(932): OC\Server->getMemCacheFactory()
#6 /usr/local/www/nextcloud/lib/base.php(657): OC::registerAutoloaderCache()
#7 /usr/local/www/nextcloud/lib/base.php(1092): OC::init()
#8 /usr/local/www/nextcloud/console.php(48): require_once('/usr/local/www/...')
#9 /usr/local/www/nextcloud/occ(11): require_once('/usr/local/www/...')
#10 {main}root@nextcloud:/usr/local/etc # cd ../www

The nexcloud web page now is completely blank. I copied the test.php file as discussed above and the page is still blank. Am I correct in assuming if there was a problem with the nginx.conf I wouldn't have gotten to the the web interface for nextcloud prior to entering the commands?

su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I reinstalled the jail from scratch and got to the user interface with the sample files. After
Code:
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.local --value="\NC\Memcache\APCu"'
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
System config value memcache.local set to string \NC\Memcache\APCu
root@nextcloud:/usr/local/etc # su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.locking --value="\NC\Memcache\Redis"'
An unhandled exception has been thrown:
Error: Class '\NC\Memcache\APCu' not found in /usr/local/www/nextcloud/lib/private/Memcache/Factory.php:86
Stack trace:
#0 /usr/local/www/nextcloud/lib/private/Server.php(383): OC\Memcache\Factory->__construct('3effa523056a7c4...', Object(OC\Log), '\\NC\\Memcache\\AP...', '\\NC\\Memcache\\AP...', NULL)
#1 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(113): OC\Server->OC\{closure}(Object(OC\Server))
#2 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(115): Pimple\Container->offsetGet('MemCacheFactory')
#3 /usr/local/www/nextcloud/lib/private/ServerContainer.php(89): OC\AppFramework\Utility\SimpleContainer->query('MemCacheFactory')
#4 /usr/local/www/nextcloud/lib/private/Server.php(1098): OC\ServerContainer->query('MemCacheFactory')
#5 /usr/local/www/nextcloud/lib/base.php(932): OC\Server->getMemCacheFactory()
#6 /usr/local/www/nextcloud/lib/base.php(657): OC::registerAutoloaderCache()
#7 /usr/local/www/nextcloud/lib/base.php(1092): OC::init()
#8 /usr/local/www/nextcloud/console.php(48): require_once('/usr/local/www/...')
#9 /usr/local/www/nextcloud/occ(11): require_once('/usr/local/www/...')
#10 {main}root@nextcloud:/usr/local/etc # cd ../www

The nexcloud web page now is completely blank. I copied the test.php file as discussed above and the page is still blank. Am I correct in assuming if there was a problem with the nginx.conf I wouldn't have gotten to the the web interface for nextcloud prior to entering the commands?

su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'
yeah, if you accessed the webpage the nginx.conf should be fine.

I don't think you should be using \NC\Memcache\APCu, I'm pretty sure nextcloud never renamed the class from "OC".

If you want to look at the test.php, I think it would work in the "updater" folder
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
yeah, if you accessed the webpage the nginx.conf should be fine.

I don't think you should be using \NC\Memcache\APCu, I'm pretty sure nextcloud never renamed the class from "OC".

If you want to look at the test.php, I think it would work in the "updater" folder

the test.php page does display in the updater directory but I don't know what to look for. Should I reinstall from scratch and skip the lines that refer to APCu and just do these?

su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis host --value="/tmp/redis.sock"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis port --value=0 --type=integer'
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
the test.php page does display in the updater directory but I don't know what to look for. Should I reinstall from scratch and skip the lines that refer to APCu and just do these?

su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis host --value="/tmp/redis.sock"'
su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis port --value=0 --type=integer'
You can just edit /usr/local/www/nextcloud/config/config.php
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739

Havock2

Dabbler
Joined
Apr 15, 2016
Messages
25
I'm trying to follow these instructions, but both redis and APCu have been removed from the ports and the repo. Can I just comment out any lines that deal with these and ignore the commands?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm trying to follow these instructions, but both redis and APCu have been removed from the ports and the repo. Can I just comment out any lines that deal with these and ignore the commands?
pecl-APCu is still available, the redis port was renamed to pecl-redis

yes you can comment out or delete the lines if don't want those caches activated.
 
Status
Not open for further replies.
Top