How to install Nextcloud 13 in FreeNAS with all checks passed updated to use iocage

peter_cd.cn

Dabbler
Joined
Feb 9, 2018
Messages
39
Hi @wbali, or anyone else who have a solution for this. I am seeing a similar error.

I installed PHP 7.2, not 7.0 or 7.1. I just follow the post step by step and did not realized I am on 7.2, so I preformed the following four commands intend for 7.0 or 7.1. But I am getting errors for the last two about Redis host and port.

Out of the four commands I run.
Code:
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"'
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set redis host --value="/tmp/redis.sock"'
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set redis port --value=0 --type=integer'

Code:
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set redis host --value="/tmp/redis.sock"'
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set redis port --value=0 --type=integer'

Gives me error like:
Code:
#0 /usr/local/www/apache24/data/nextcloud/lib/private/RedisFactory.php(84): Redis->connect('127.0.0.1', 6379, 0)

#1 /usr/local/www/apache24/data/nextcloud/lib/private/RedisFactory.php(100): OC\RedisFactory->create()

#2 /usr/local/www/apache24/data/nextcloud/lib/private/Memcache/Redis.php(42): OC\RedisFactory->getInstance()

#3 /usr/local/www/apache24/data/nextcloud/lib/private/Memcache/Factory.php(136): OC\Memcache\Redis->__construct('4133df3a4e4f42e...')

#4 /usr/local/www/apache24/data/nextcloud/lib/private/Server.php(849): OC\Memcache\Factory->createLocking('lock')

#5 /usr/local/www/apache24/data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))

#6 /usr/local/www/apache24/data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')

#7 /usr/local/www/apache24/data/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...')

#8 /usr/local/www/apache24/data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(165): OC\ServerContainer->query('OCP\\Lock\\ILocki...')

#9 /usr/local/www/apache24/data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))

#10 /usr/local/www/apache24/data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('LockingProvider')

#11 /usr/local/www/apache24/data/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('LockingProvider')

#12 /usr/local/www/apache24/data/nextcloud/lib/private/Server.php(1784): OC\ServerContainer->query('LockingProvider')

#13 /usr/local/www/apache24/data/nextcloud/lib/private/Files/View.php(115): OC\Server->getLockingProvider()

#14 /usr/local/www/apache24/data/nextcloud/lib/private/Server.php(214): OC\Files\View->__construct()

#15 /usr/local/www/apache24/data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))

#16 /usr/local/www/apache24/data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('EncryptionManag...')

#17 /usr/local/www/apache24/data/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('EncryptionManag...')

#18 /usr/local/www/apache24/data/nextcloud/lib/private/Server.php(1257): OC\ServerContainer->query('EncryptionManag...')

#19 /usr/local/www/apache24/data/nextcloud/lib/base.php(845): OC\Server->getEncryptionManager()

#20 /usr/local/www/apache24/data/nextcloud/lib/base.php(730): OC::registerEncryptionWrapper()

#21 /usr/local/www/apache24/data/nextcloud/lib/base.php(1068): OC::init()

#22 /usr/local/www/apache24/data/nextcloud/console.php(46): require_once('/usr/local/www/...')

#23 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')

#24 {main}root@nextcloud:/ #



Wbali said he "restarted the third time" and the command worked. I wonder what did you restart? The jail? Redis services? Or reload the nextcloud website?

Someone with knowledge please help...

If I am running PHP 7.2, do I really need to do the things listed for 7.0 or 7.1? If not, how do I reset
Code:
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"'
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set memcache.locking --value="\OC\Memcache\Redis"'


Not really sure what this two commands does.

Thanks,
-Peter
Okay, the redis factory exception error has resolved. I saw danb's another post about doing all this in a script, in one of the reply's, danb explained he casue. Basically you need to run
Code:
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set redis host --value="/tmp/redis.sock"'
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set redis port --value=0 --type=integer'

first before setting the memecache file and locking file. If you already run the first commend first, go back to the config.php and manually edit it back to APC for memecahe locking. Run above two command first will fix the redisFactory error.
 

peter_cd.cn

Dabbler
Joined
Feb 9, 2018
Messages
39
I basically finished all things in the guide. Thanks for @dureal99d who produce this. In my research to try to solve some issues while following this, I discovered there is a script doing all this in another thread. If you want to do all this step by step and understand, use this thread.

Otherwise, you can choose to use a script. Look here. Someone reported that script only took 25 minutes to complete the whole thing. Doing this all by hands helps me understand many things, which is part of the learning. Doing by hands took me easily 10+ hours. (I am still not done, don't know how to access my cloud outside my LAN.)
 

ric

Contributor
Joined
Dec 22, 2013
Messages
180
mysql.sock file is missing in the feedback list after following all the command below. Please help.

Now lets Configure REDIS
The purpose is to update redis.conf to run on local socket

Execute command:
Code:
nano /usr/local/etc/redis.conf

In the redis.conf file find the value
Code:
"port" and change it from its default value to 0

uncomment by removing the ; symbol from in front of the below values and edit to match
Code:
unixsocket /tmp/redis.sock
unixsocketperm 777

Add REDIS to rc.conf
$
Code:
sysrc redis_enable=yes

Start REDIS
$
Code:
service redis start

To run redis on a local socket,
Run
ls -al /tmp
you should see redis.sock and mysql.sock in the feedback list.

If you see those two, you're ALMOST DONE!!
 

irnerd

Cadet
Joined
Jun 24, 2018
Messages
5
'memcache.local' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'redis' => array ( 'host' => '/tmp/redis.sock', 'port' => 0, 'timeout' => 0.0, ),

Thank you - my persistence in hacking this weekend forced me to take this jail up and down a great deal this weekend. This single feedback line would have saved a fortune in time if it was in the original article

Good work all round though - after a borked oc v 9 meltdown I am back to gether
 

MurrayS

Dabbler
Joined
Jan 17, 2016
Messages
20
Thanks dureal99d for these clear instructions.
After running the following command, I get an error and can't access nextcloud any longer.
su -m www -c 'php /usr/local/www/apache24/data/nextcloud/occ config:system:set redis host --value="/tmp/redis.sock"'
Saving and restoring the contents of /usr/local/etc didn't fix the situation. I've reinstalled everything all over once and ideally don't want to repeat the process.
When accessing the nextcloud page, I see an incorrect ip address for the jail. 1.135 is not where I'm running this jail!
The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.
Technical details
Remote Address: 192.168.1.135
Request ID: xG1SXsE0MyEnZBZPCd4f

Any ideas on what the issue might be?
I've included the error block.
An unhandled exception has been thrown:
RedisException: Connection refused in /usr/local/www/apache24/data/nextcloud/lib/private/RedisFactory.php:84
Stack trace:
#0 /usr/local/www/apache24/data/nextcloud/lib/private/RedisFactory.php(84): Redis->connect('127.0.0.1', 6379, 0)
#1 /usr/local/www/apache24/data/nextcloud/lib/private/RedisFactory.php(100): OC\RedisFactory->create()
#2 /usr/local/www/apache24/data/nextcloud/lib/private/Memcache/Redis.php(42): OC\RedisFactory->getInstance()
#3 /usr/local/www/apache24/data/nextcloud/lib/private/Memcache/Factory.php(136): OC\Memcache\Redis->__construct('74ce2ccd5c0de9a...')
#4 /usr/local/www/apache24/data/nextcloud/lib/private/Server.php(860): OC\Memcache\Factory->createLocking('lock')
#5 /usr/local/www/apache24/data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#6 /usr/local/www/apache24/data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#7 /usr/local/www/apache24/data/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...')
#8 /usr/local/www/apache24/data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(165): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#9 /usr/local/www/apache24/data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#10 /usr/local/www/apache24/data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('LockingProvider')
#11 /usr/local/www/apache24/data/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('LockingProvider')
#12 /usr/local/www/apache24/data/nextcloud/lib/private/Server.php(1803): OC\ServerContainer->query('LockingProvider')
#13 /usr/local/www/apache24/data/nextcloud/lib/private/Files/View.php(115): OC\Server->getLockingProvider()
#14 /usr/local/www/apache24/data/nextcloud/lib/private/Server.php(221): OC\Files\View->__construct()
#15 /usr/local/www/apache24/data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server->OC\{closure}(Object(OC\Server))
#16 /usr/local/www/apache24/data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('OCP\\Encryption\\...')
#17 /usr/local/www/apache24/data/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Encryption\\...')
#18 /usr/local/www/apache24/data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(165): OC\ServerContainer->query('OCP\\Encryption\\...')
#19 /usr/local/www/apache24/data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
#20 /usr/local/www/apache24/data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container->offsetGet('EncryptionManag...')
#21 /usr/local/www/apache24/data/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer->query('EncryptionManag...')
#22 /usr/local/www/apache24/data/nextcloud/lib/private/Server.php(1276): OC\ServerContainer->query('EncryptionManag...')
#23 /usr/local/www/apache24/data/nextcloud/lib/base.php(845): OC\Server->getEncryptionManager()
#24 /usr/local/www/apache24/data/nextcloud/lib/base.php(730): OC::registerEncryptionWrapper()
#25 /usr/local/www/apache24/data/nextcloud/lib/base.php(1068): OC::init()
#26 /usr/local/www/apache24/data/nextcloud/console.php(46): require_once('/usr/local/www/...')
#27 /usr/local/www/apache24/data/nextcloud/occ(11): require_once('/usr/local/www/...')
 

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
Thanks dureal99d for these clear instructions.
After running the following command, I get an error and can't access nextcloud any longer.

Saving and restoring the contents of /usr/local/etc didn't fix the situation. I've reinstalled everything all over once and ideally don't want to repeat the process.
When accessing the nextcloud page, I see an incorrect IP address for the jail. 1.135 is not where I'm running this jail!


Any ideas on what the issue might be?
I've included the error block.
yes that no longer works with the newest version of nextcloud

Command: nano /usr/local/www/apache24/data/nextcloud/config/config.php

remove:
'memcache.local' => '\\OC\\Memcache\\APCu',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => '/tmp/redis.sock',

the simply add:
'memcache.local' => '\\OC\\Memcache\\APCu',

Im working on an updated version of the tutorial bt it takes me a lil long as i have other responsibilties
 
Last edited:
Joined
Aug 22, 2019
Messages
6
THANK YOU!!!! @dureal99d . That error has been kicking me in the head for so long! I could get around it by running redis-server from the jail shell (as root obviously), but it meant that every time the jail got restarted, I had to be physically in the house to restart NextCloud (I haven't gotten around to setting up VPN yet). Plus I really didn't want anything running using root privileges when it shouldn't be necessary. Once I commented out the 'memcache.locking' => '\\OC\\Memcache\\Redis', line from my config file, it starts up perfectly even after a full server re-boot (which shouldn't happen often, but I wanted to be sure).
 

dureal99d

Contributor
Joined
Aug 3, 2017
Messages
156
THANK YOU!!!! @dureal99d . That error has been kicking me in the head for so long! I could get around it by running redis-server from the jail shell (as root obviously), but it meant that every time the jail got restarted, I had to be physically in the house to restart NextCloud (I haven't gotten around to setting up VPN yet). Plus I really didn't want anything running using root privileges when it shouldn't be necessary. Once I commented out the 'memcache.locking' => '\\OC\\Memcache\\Redis', line from my config file, it starts up perfectly even after a full server re-boot (which shouldn't happen often, but I wanted to be sure).
you are welcome i havent been on here in a while as i have been crazy busy, but i shall return soon to receive and give information on this great ware
 

twsps

Contributor
Joined
Jul 10, 2018
Messages
113
Hello, I realized that nextcloud is creating files and directories with wrong permission on external local storage which users accessing via SMB cannot edit the file that nextcloud has created. I have created a thread but also did a post here as I do not know how to add "umask 002" command to apache24 www user based on this guide's setup on apache. Does anyone have ideas on how to resolve this permission issue?

Thanks!
 
Top