NextCloud Setup Instructions

Status
Not open for further replies.

Thousandbuckle

Contributor
Joined
Jul 9, 2014
Messages
136
Hello all FreeNAS 9.10 and need some help with the setup instructions for NextCloud in FreeNAS. I know FreeNAS has a plugin for OwnCloud but with the bad reviews of OwnCloud and the recent split and closure of OwnCloud I wanted to go with the new fork NewCloud.

Steps I have taken so far are to create the jail and did the "Pkg update && pkg upgrade –y" then "pkg install nextcloud". I understand NextCloud runs on a web server and I am not sure if any web server was installed in the pkg install process or any other apps that need to be installed through the pkg install process.

Can someone help me understand what I need to configure in the files to get to the NextCloud administration gui through the web interface?
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
the nextcloud port doesn't include a webserver. So you could install apache24 or nginx, and configure it.
It also doesn't install a database so you'll want to install something like mysql57-server
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I was all set to point you to their installation instructions for FreeBSD, but I see they don't support FreeBSD. Your best bet may be to work your way through the manual installation instructions for Linux, tranlating into FreeBSD-speak as necessary. For example, apt-get becomes pkg install:
https://docs.nextcloud.com/server/10/admin_manual/installation/source_installation.html
Instead of using a linux guide I recommend you follow the guide I have here.
https://forums.freenas.org/index.ph...ing-nginx-php-fpm-and-mysql.17786/#post-95880

The only steps you would need to change is the block with the 'fetch' command to the below.
Code:
fetch "https://download.nextcloud.com/server/releases/nextcloud-10.0.0.tar.bz2"
tar jxf nextcloud-*.tar.bz2 -C /usr/local/www
mv /usr/local/www/nextclolud /usr/local/www/owncloud
rm nextcloud-*.tar.bz2
chown -R www:www /usr/local/www/owncloud /mnt/files
 

Zofoor

Patron
Joined
Aug 16, 2016
Messages
219
Instead of using a linux guide I recommend you follow the guide I have here.
https://forums.freenas.org/index.ph...ing-nginx-php-fpm-and-mysql.17786/#post-95880

The only steps you would need to change is the block with the 'fetch' command to the below.
Code:
fetch "https://download.nextcloud.com/server/releases/nextcloud-10.0.0.tar.bz2"
tar jxf nextcloud-*.tar.bz2 -C /usr/local/www
mv /usr/local/www/nextclolud /usr/local/www/owncloud
rm nextcloud-*.tar.bz2
chown -R www:www /usr/local/www/owncloud /mnt/files

It's exactly what I have done, and it works great.
I got only two little troubles:
- when running pkg install, I had to remove php70-APCu becouse could not find it
- at the end, instead of run

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

I had to run

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

becouse I could not install APCu.

All the rest worked without troubles.
 

Joshua Parker Ruehlig

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

Thousandbuckle

Contributor
Joined
Jul 9, 2014
Messages
136
Hi Josh, trying to follow you instructions but there are some many issues I dont know where to start. Some of the items you refer to work and some just dont seem to exist. Is it possible if you can create the steps with updated values for today along with the Next Cloud install setup?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Josh, trying to follow you instructions but there are some many issues I dont know where to start. Some of the items you refer to work and some just dont seem to exist. Is it possible if you can create the steps with updated values for today along with the Next Cloud install setup?
I don't plan on doing this any time soon. what steps fail?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Hi Josh, trying to follow you instructions but there are some many issues I dont know where to start. Some of the items you refer to work and some just dont seem to exist. Is it possible if you can create the steps with updated values for today along with the Next Cloud install setup?
I don't plan on doing this any time soon. what steps fail?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Instead of using a linux guide I recommend you follow the guide I have here.
https://forums.freenas.org/index.ph...ing-nginx-php-fpm-and-mysql.17786/#post-95880

The only steps you would need to change is the block with the 'fetch' command to the below.
Code:
fetch "https://download.nextcloud.com/server/releases/nextcloud-10.0.0.tar.bz2"
tar jxf nextcloud-*.tar.bz2 -C /usr/local/www
mv /usr/local/www/nextclolud /usr/local/www/owncloud
rm nextcloud-*.tar.bz2
chown -R www:www /usr/local/www/owncloud /mnt/files
Hey Josh. I was able to access the setup page and enter all the needed information and get to the nextcloud dashboard. Any subsequent visit now returns a 500 error and I'm not able to access the page again. Any idea what may have caused this?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'm not sure, check the log in /mnt/files
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Nothing. The log is empty.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
maybe the issue is happening with nginx
you could edit the nginx config, uncomment the log file location, create the folder (I believe)
/usr/local/etc/nginx/log
then restart nginx

can you verify if you can browse to http://JAIL_IP/owncloud/robots.txt
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Ok the nginx error log is being spammed with the following.
Code:
PHP message: PHP Fatal error:  Uncaught RedisException: Redis server went away in/usr/local/www/owncloud/lib/private/Memcache/Redis.php:52

Now, how to fix it?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Sorry, should have posted the entire error.
Code:
Stack trace:
#0 /usr/local/www/owncloud/lib/private/Memcache/Redis.php(52): Redis->get('15ac5f68517ce6c...')
#1 /usr/local/www/owncloud/lib/autoloader.php(146): OC\Memcache\Redis->get('OC_User')
#2 [internal function]: OC\Autoloader->load('OC_User')
#3 /usr/local/www/owncloud/lib/private/Log/Owncloud.php(100): spl_autoload_call('OC_User')
#4 [internal function]: OC\Log\Owncloud::write('PHP', 'RedisException:...', 3)
#5 /usr/local/www/owncloud/lib/private/Log.php(299): call_user_func(Array, 'PHP', 'RedisException:...', 3)
#6 /usr/local/www/owncloud/lib/private/Log.php(157): OC\Log->log(3, 'RedisException:...', Array)
#7 /usr/local/www/owncloud/lib/private/Log/ErrorHandler.php(81): OC\Log->critical('RedisException:...', Array)
#8 [internal function]: OC\Log\ErrorHandler::onException(Object(RedisException))
#9 {main}
  thrown in /usr/local/www/owncloud/lib/private/Memcac...
PHP message: PHP Fatal error:  Uncaught RedisException: Redis server went away in /usr/local/www/owncloud/lib/private/Memcache/Redis.php:52
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'd double check redisnis running and available at the correct place..
service redis status
sockstat

or you can disable redis in the config.php file by deleting the related lines
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
redis was running and sockstat confirmed the correct location. I removed the memcache line from the config.php and it's working now. Why that is I don't know it's way beyond me.

Thanks for your time.
 

Thousandbuckle

Contributor
Joined
Jul 9, 2014
Messages
136
Hi Josh, sorry I have been away and just now getting back to this activity.

Steps so far:
1. Created jail and did the pkg update and pkg upgrade commands - Done
2. Ran your script commands but get error on the php70-APCu pkg not found in the repository. What should I replace this pkg with?
3. Set worker processes to 2 but the nginx.conf file I have looks quite different than the one you show and I am unable to find the "client_max_body_size" field to change. Here is what my file looks like.
Code:
}     #
Code:
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

4. Updating the php.in when I ee into the file it is blank. Is that correct and that I should copy in your code with my time zone or should there already be some code in that file?
5. Updating the www.conf file I cant find where to change/update the code you have "listen = /var/run/php-fpm.sock". And it looks like the default file already has listen.owner and listen.group set to www. The code below is the first part of the file as reference.
Code:
 the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
Code:
[www]

; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or /usr/local) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool

; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
;       will be used.
user = www
group = www

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
;                            a specific port;
;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
;                            a specific port;
;   'port'                 - to listen on a TCP socket to all addresses
;                            (IPv6 and IPv4-mapped) on a specific port;
;   '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000

; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
;listen.backlog = 511

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
;                 mode is set to 0660
;listen.owner = www
;listen.group = www
;listen.mode = 0660
; When POSIX Access Control Lists are supported you can set them using
; these options, value is a comma separated list of user/group names.
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
;listen.acl_groups =

6. Editing the my.cnf file is not possible as it does not exit in the /var/db/mysql directory. If I ls the mysql directory it is empty.
7. Editing the redis.conf file I can not find any existing code that matches your informatioon to replace the relevant lines in the file.

Sorry for such a long post but this is quite a struggle for me and not sure why other dont have similar issue.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I'll address your questions with the number noted.

2) Why do you call it a "script command"? My tutorial has commands in it, but none of the code blocks contain scripts.
Yeah, I realize php70-APCu is currently not available in the FreeBSD repos. 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"'


3) You should be replacing the entire contents of the nginx.conf file, I does not matter what was in there before. That's why I don't say "Replace the relevant lines in " and just have the file name.

4) It sounds like you never ran 'cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini'

5) It sounds like you don't see or correctly understand how INI formatted configuration files work.
You should be changing the 'listen' value, which is currently equal to "127.0.0.1:9000"
'listen.owner' and 'listen.group' are actually unset by default because they are commented out.

6) you should be creating /var/db/mysql/my.cnf, that is why I don't say "Replace the relevant lines in " for this code block.

7) I found all of these when I just tested it. By default, 'port' is set "6379" (maybe search for that), and 'unixsocket'/'unixsocketperm' are commented out.
 
Status
Not open for further replies.
Top