How to manually install Nextcloud on FreeNAS in an iocage jail with hardened security

How to manually install Nextcloud on FreeNAS in an iocage jail with hardened security v2.0.1

RueGorE

Dabbler
Joined
Dec 10, 2018
Messages
18
Hi samuel-emrys. I'm trying to follow your guide to install NextCloud 15 in FreeNAS 11.1-U6 using php72. When I got to the part about running the OCC command, the command fails as it seems OCC is missing from /usr/local/www/nextcloud/ and I have no idea how to proceed.

I accidentally installed php71-pecl-redis but later installed php72-pecl-redis which removed php71-pecl-redis so I thought I was still good to go. Output from terminal:


root@nextcloud:/usr/local/etc/apache24/Includes # pkg install php72-pecl-redis
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
php72-pecl-redis: 4.2.0
php72-session: 7.2.13
php72: 7.2.13

Number of packages to be installed: 3

The process will require 25 MiB more space.
131 KiB to be downloaded.

Proceed with this action? [y/N]: y
[nextcloud] [1/1] Fetching php72-pecl-redis-4.2.0.txz: 100% 131 KiB 134.1kB/s 00:01
Checking integrity... done (3 conflicting)
- php72-pecl-redis-4.2.0 conflicts with php71-pecl-redis-4.2.0 on /usr/local/include/php/ext/redis/redis_commands.h
- php72-session-7.2.13 conflicts with php71-session-7.1.25 on /usr/local/include/php/ext/session/php_session.h
- php72-7.2.13 conflicts with php71-7.1.25 on /usr/local/bin/php
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 7 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
php71-pecl-APCu-5.1.16
php71-7.1.25
php71-session-7.1.25
php71-pecl-redis-4.2.0

New packages to be INSTALLED:
php72: 7.2.13
php72-session: 7.2.13
php72-pecl-redis: 4.2.0

Number of packages to be removed: 4
Number of packages to be installed: 3

The process will require 1 MiB more space.

Proceed with this action? [y/N]: y
[nextcloud] [1/7] Deinstalling php71-pecl-redis-4.2.0...
[nextcloud] [1/7] Deleting files for php71-pecl-redis-4.2.0: 100%
[nextcloud] [2/7] Deinstalling php71-pecl-APCu-5.1.16...
[nextcloud] [2/7] Deleting files for php71-pecl-APCu-5.1.16: 100%
[nextcloud] [3/7] Deinstalling php71-session-7.1.25...
[nextcloud] [3/7] Deleting files for php71-session-7.1.25: 100%
[nextcloud] [4/7] Deinstalling php71-7.1.25...
[nextcloud] [4/7] Deleting files for php71-7.1.25: 100%
[nextcloud] [5/7] Installing php72-7.2.13...
[nextcloud] [5/7] Extracting php72-7.2.13: 100%
[nextcloud] [6/7] Installing php72-session-7.2.13...
[nextcloud] [6/7] Extracting php72-session-7.2.13: 100%
[nextcloud] [7/7] Installing php72-pecl-redis-4.2.0...
[nextcloud] [7/7] Extracting php72-pecl-redis-4.2.0: 100%
root@nextcloud:/usr/local/etc/apache24/Includes # pkg install php72-pecl-APCu
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
php72-pecl-APCu: 5.1.16

Number of packages to be installed: 1

Proceed with this action? [y/N]: y
[nextcloud] [1/1] Installing php72-pecl-APCu-5.1.16...
[nextcloud] [1/1] Extracting php72-pecl-APCu-5.1.16: 100%
root@nextcloud:/usr/local/etc/apache24/Includes # su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis host --value="/tmp/redis.sock"'
Could not open input file: /usr/local/www/nextcloud/occ
root@nextcloud:/usr/local/etc/apache24/Includes # ls /usr/local/www/nextcloud/occ
ls: /usr/local/www/nextcloud/occ: No such file or directory
root@nextcloud:/usr/local/etc/apache24/Includes # cd /usr/local/www/nextcloud/
root@nextcloud:/usr/local/www/nextcloud # ls -la
total 11
drwxr-xr-x 5 www www 6 Dec 31 23:46 .
drwxr-xr-x 4 root wheel 4 Dec 31 21:53 ..
-rw-r--r-- 1 www www 2928 Dec 31 23:22 .htaccess
drwxr-xr-x 2 www www 3 Dec 31 23:46 config
drwxr-xr-x 2 www www 4 Dec 31 23:21 data
drwxr-xr-x 2 www www 2 Dec 31 23:46 themes

root@nextcloud:/usr/local/www/nextcloud # locate occ
/usr/bin/proccontrol
/usr/include/sys/ioccom.h
/usr/include/sys/procctl.h
/usr/local/lib/perl5/site_perl/mach/5.28/sys/ioccom.ph
/usr/local/lib/perl5/site_perl/mach/5.28/sys/procctl.ph
/usr/sbin/procctl
/usr/share/man/man2/procctl.2.gz
/usr/share/man/man3/sysdecode_procctl_cmd.3.gz
/usr/share/man/man8/procctl.8.gz
/usr/src/lib/libc/sys/procctl.2
/usr/src/sys/kern/kern_procctl.c
/usr/src/sys/sys/ioccom.h
/usr/src/sys/sys/procctl.h
/usr/src/usr.bin/proccontrol
/usr/src/usr.bin/proccontrol/Makefile
/usr/src/usr.bin/proccontrol/Makefile.depend
/usr/src/usr.bin/proccontrol/proccontrol.c
/usr/src/usr.sbin/procctl
/usr/src/usr.sbin/procctl/Makefile
/usr/src/usr.sbin/procctl/Makefile.depend
/usr/src/usr.sbin/procctl/procctl.8
/usr/src/usr.sbin/procctl/procctl.c
root@nextcloud:/usr/local/www/nextcloud #


Any idea what I did wrong? I'm going to try starting over again later but if this can be figured out I'd rather do that.
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
Hi samuel-emrys. I'm trying to follow your guide to install NextCloud 15 in FreeNAS 11.1-U6 using php72. When I got to the part about running the OCC command, the command fails as it seems OCC is missing from /usr/local/www/nextcloud/ and I have no idea how to proceed.

I accidentally installed php71-pecl-redis but later installed php72-pecl-redis which removed php71-pecl-redis so I thought I was still good to go. Output from terminal:


root@nextcloud:/usr/local/etc/apache24/Includes # pkg install php72-pecl-redis
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
php72-pecl-redis: 4.2.0
php72-session: 7.2.13
php72: 7.2.13

Number of packages to be installed: 3

The process will require 25 MiB more space.
131 KiB to be downloaded.

Proceed with this action? [y/N]: y
[nextcloud] [1/1] Fetching php72-pecl-redis-4.2.0.txz: 100% 131 KiB 134.1kB/s 00:01
Checking integrity... done (3 conflicting)
- php72-pecl-redis-4.2.0 conflicts with php71-pecl-redis-4.2.0 on /usr/local/include/php/ext/redis/redis_commands.h
- php72-session-7.2.13 conflicts with php71-session-7.1.25 on /usr/local/include/php/ext/session/php_session.h
- php72-7.2.13 conflicts with php71-7.1.25 on /usr/local/bin/php
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 7 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
php71-pecl-APCu-5.1.16
php71-7.1.25
php71-session-7.1.25
php71-pecl-redis-4.2.0

New packages to be INSTALLED:
php72: 7.2.13
php72-session: 7.2.13
php72-pecl-redis: 4.2.0

Number of packages to be removed: 4
Number of packages to be installed: 3

The process will require 1 MiB more space.

Proceed with this action? [y/N]: y
[nextcloud] [1/7] Deinstalling php71-pecl-redis-4.2.0...
[nextcloud] [1/7] Deleting files for php71-pecl-redis-4.2.0: 100%
[nextcloud] [2/7] Deinstalling php71-pecl-APCu-5.1.16...
[nextcloud] [2/7] Deleting files for php71-pecl-APCu-5.1.16: 100%
[nextcloud] [3/7] Deinstalling php71-session-7.1.25...
[nextcloud] [3/7] Deleting files for php71-session-7.1.25: 100%
[nextcloud] [4/7] Deinstalling php71-7.1.25...
[nextcloud] [4/7] Deleting files for php71-7.1.25: 100%
[nextcloud] [5/7] Installing php72-7.2.13...
[nextcloud] [5/7] Extracting php72-7.2.13: 100%
[nextcloud] [6/7] Installing php72-session-7.2.13...
[nextcloud] [6/7] Extracting php72-session-7.2.13: 100%
[nextcloud] [7/7] Installing php72-pecl-redis-4.2.0...
[nextcloud] [7/7] Extracting php72-pecl-redis-4.2.0: 100%
root@nextcloud:/usr/local/etc/apache24/Includes # pkg install php72-pecl-APCu
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
php72-pecl-APCu: 5.1.16

Number of packages to be installed: 1

Proceed with this action? [y/N]: y
[nextcloud] [1/1] Installing php72-pecl-APCu-5.1.16...
[nextcloud] [1/1] Extracting php72-pecl-APCu-5.1.16: 100%
root@nextcloud:/usr/local/etc/apache24/Includes # su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set redis host --value="/tmp/redis.sock"'
Could not open input file: /usr/local/www/nextcloud/occ
root@nextcloud:/usr/local/etc/apache24/Includes # ls /usr/local/www/nextcloud/occ
ls: /usr/local/www/nextcloud/occ: No such file or directory
root@nextcloud:/usr/local/etc/apache24/Includes # cd /usr/local/www/nextcloud/
root@nextcloud:/usr/local/www/nextcloud # ls -la
total 11
drwxr-xr-x 5 www www 6 Dec 31 23:46 .
drwxr-xr-x 4 root wheel 4 Dec 31 21:53 ..
-rw-r--r-- 1 www www 2928 Dec 31 23:22 .htaccess
drwxr-xr-x 2 www www 3 Dec 31 23:46 config
drwxr-xr-x 2 www www 4 Dec 31 23:21 data
drwxr-xr-x 2 www www 2 Dec 31 23:46 themes

root@nextcloud:/usr/local/www/nextcloud # locate occ
/usr/bin/proccontrol
/usr/include/sys/ioccom.h
/usr/include/sys/procctl.h
/usr/local/lib/perl5/site_perl/mach/5.28/sys/ioccom.ph
/usr/local/lib/perl5/site_perl/mach/5.28/sys/procctl.ph
/usr/sbin/procctl
/usr/share/man/man2/procctl.2.gz
/usr/share/man/man3/sysdecode_procctl_cmd.3.gz
/usr/share/man/man8/procctl.8.gz
/usr/src/lib/libc/sys/procctl.2
/usr/src/sys/kern/kern_procctl.c
/usr/src/sys/sys/ioccom.h
/usr/src/sys/sys/procctl.h
/usr/src/usr.bin/proccontrol
/usr/src/usr.bin/proccontrol/Makefile
/usr/src/usr.bin/proccontrol/Makefile.depend
/usr/src/usr.bin/proccontrol/proccontrol.c
/usr/src/usr.sbin/procctl
/usr/src/usr.sbin/procctl/Makefile
/usr/src/usr.sbin/procctl/Makefile.depend
/usr/src/usr.sbin/procctl/procctl.8
/usr/src/usr.sbin/procctl/procctl.c
root@nextcloud:/usr/local/www/nextcloud #


Any idea what I did wrong? I'm going to try starting over again later but if this can be figured out I'd rather do that.
This is an interesting one. I spun up a clean jail and installed nextcloud-php72 to make sure occ is present at the beginning of the installation, which it was. Based on the output of the listing of /usr/local/www/nextcloud/, it doesn't seem like you have nextcloud installed. The only folders you have present are the ones mounted via fstab. For reference, this is what the web root contents should look like:

Code:
root@nextcloud:/usr/local/www/nextcloud # ls -al
total 151
drwxr-xr-x  16 root  wheel     30 Jan  1 23:52 .
drwxr-xr-x   3 root  wheel      3 Jan  1 23:52 ..
-rw-r--r--   1 root  www     2836 Dec 10 21:21 .htaccess
-rw-rw-r--   1 www   www      163 Dec 10 21:21 .user.ini
drwxr-xr-x  32 root  wheel     40 Jan  1 23:52 3rdparty
drwxr-xr-x   2 www   www        2 Dec 25 12:10 apps
drwxr-xr-x  39 root  wheel     39 Jan  1 23:52 apps-pkg
-rw-r--r--   1 root  wheel  12063 Dec 10 21:21 AUTHORS
drwxr-xr-x   2 www   www        6 Jan  1 23:52 config
-rw-r--r--   1 root  wheel   3650 Dec 10 21:21 console.php
-rw-r--r--   1 root  wheel  34520 Dec 10 21:21 COPYING
drwxr-xr-x  18 root  wheel     24 Jan  1 23:52 core
-rw-r--r--   1 root  wheel   4979 Dec 10 21:21 cron.php
drwxr-xr-x   2 www   www        2 Dec 25 12:10 data
-rw-r--r--   1 root  wheel    156 Dec 10 21:21 index.html
-rw-r--r--   1 root  wheel   3172 Dec 10 21:21 index.php
drwxr-xr-x   6 root  wheel      9 Jan  1 23:52 lib
-rw-r--r--   1 root  wheel    283 Dec 10 21:21 occ
drwxr-xr-x   2 root  wheel      3 Jan  1 23:52 ocm-provider
drwxr-xr-x   2 root  wheel      5 Jan  1 23:52 ocs
drwxr-xr-x   2 root  wheel      3 Jan  1 23:52 ocs-provider
-rw-r--r--   1 root  wheel   2969 Dec 10 21:21 public.php
-rw-r--r--   1 root  wheel   5139 Dec 10 21:21 remote.php
drwxr-xr-x   4 root  wheel      7 Jan  1 23:52 resources
-rw-r--r--   1 root  wheel     26 Dec 10 21:21 robots.txt
drwxr-xr-x  12 root  wheel     17 Jan  1 23:52 settings
-rw-r--r--   1 root  wheel   2232 Dec 10 21:21 status.php
drwxr-xr-x   3 root  wheel      4 Jan  1 23:52 themes
drwxr-xr-x   2 root  wheel      3 Jan  1 23:52 updater
-rw-r--r--   1 root  wheel    363 Dec 10 21:25 version.php


You could try reinstalling nextcloud, pkg install nextcloud-php72, or starting from scratch again. This point in the guide comes after configuring the nextcloud admin user and database details; did you do this? If so, it would appear that at some stage since then nextcloud has been uninstalled. Note, if you start from scratch again and you've configured the database in the web ui, you might need to recreate your db dataset. You could probably get it working with the same database (see the restoring from backup documentation), but it might be more trouble than just deleting it and starting again fresh, especially as it won't contain anything critical yet
 

T_T

Explorer
Joined
Jul 24, 2018
Messages
64
Bearing in mind that I have zero experience configuring postfix for yahoo, my guess would be that you haven't configured the yahoo smtp server correctly. My advice would be to set up a new gmail account specifically for server notifications and follow the guide exactly, as I can confirm this works. However, if you're intent on using yahoo you'll have to do your own research to work out what configuration you need.

Looking at the log you posted, it seems to be throwing errors because you've put the wrong smtp server domain in. This Yahoo SMTP guide provides a walkthrough for SMTP for yahoo. Noteably, you have used:
smtp.yahoo.com:587
This needs to be
smtp.mail.yahoo.com:587

Another hurdle you might have with yahoo is configuration of the mailbox is to allow "Less Secure Apps" to use the mailbox; this is relatively well documented for gmail, but you'd have to research if this is something that can be configured (or if it even needs to be configured) for yahoo.

Edit: Derp, a discussion of "Less Secure Apps" is covered in the guide I linked, just had to read down a little bit

So I did change the whole thing to gmail but I think I'm still getting the same error the log file are below.
Jan 1 00:00:11 nextcloud newsyslog[36371]: logfile turned over
Jan 1 00:37:05 nextcloud postfix/qmgr[94717]: 850B121C60: from=<root@nextcloud.localdomain>, size=352, nrcpt=1 (queue active)
Jan 1 00:37:35 nextcloud postfix/smtp[38035]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 00:38:05 nextcloud postfix/smtp[38035]: connect to smtp.yahoo.com[216.145.54.171]:587: Operation timed out
Jan 1 00:38:35 nextcloud postfix/smtp[38035]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 00:39:05 nextcloud postfix/smtp[38035]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 00:39:35 nextcloud postfix/smtp[38035]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 00:39:35 nextcloud postfix/smtp[38035]: 850B121C60: to=<athy_nguyen@yahoo.com>, relay=none, delay=46378, delays=46228/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out)
Jan 1 00:52:05 nextcloud postfix/qmgr[94717]: 394AD21C72: from=<root@nextcloud.localdomain>, size=45602, nrcpt=1 (queue active)
Jan 1 00:52:35 nextcloud postfix/smtp[38582]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 00:53:05 nextcloud postfix/smtp[38582]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 00:53:35 nextcloud postfix/smtp[38582]: connect to smtp.yahoo.com[216.145.54.155]:587: Operation timed out
Jan 1 00:54:05 nextcloud postfix/smtp[38582]: connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out
Jan 1 00:54:35 nextcloud postfix/smtp[38582]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 00:54:35 nextcloud postfix/smtp[38582]: 394AD21C72: to=<athy_nguyen@yahoo.com>, relay=none, delay=46424, delays=46274/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out)
Jan 1 01:06:21 nextcloud postfix/pickup[39053]: 86B7121D06: uid=0 from=<root>
Jan 1 01:06:21 nextcloud postfix/cleanup[39530]: 86B7121D06: message-id=<20190101070621.86B7121D06@nextcloud.localdomain>
Jan 1 01:06:21 nextcloud postfix/qmgr[94717]: 86B7121D06: from=<root@nextcloud.localdomain>, size=2998, nrcpt=1 (queue active)
Jan 1 01:06:51 nextcloud postfix/smtp[39532]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 01:07:21 nextcloud postfix/smtp[39532]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 01:07:51 nextcloud postfix/smtp[39532]: connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out
Jan 1 01:08:21 nextcloud postfix/smtp[39532]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 01:08:51 nextcloud postfix/smtp[39532]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 01:08:51 nextcloud postfix/smtp[39532]: 86B7121D06: to=<athy_nguyen@yahoo.com>, relay=none, delay=150, delays=0.08/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out)
Jan 1 01:17:05 nextcloud postfix/qmgr[94717]: 86B7121D06: from=<root@nextcloud.localdomain>, size=2998, nrcpt=1 (queue active)
Jan 1 01:17:35 nextcloud postfix/smtp[39983]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 01:18:05 nextcloud postfix/smtp[39983]: connect to smtp.yahoo.com[216.145.54.155]:587: Operation timed out
Jan 1 01:18:35 nextcloud postfix/smtp[39983]: connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out
Jan 1 01:19:05 nextcloud postfix/smtp[39983]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 01:19:35 nextcloud postfix/smtp[39983]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 01:19:35 nextcloud postfix/smtp[39983]: 86B7121D06: to=<athy_nguyen@yahoo.com>, relay=none, delay=794, delays=644/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out)
Jan 1 01:37:06 nextcloud postfix/qmgr[94717]: 86B7121D06: from=<root@nextcloud.localdomain>, size=2998, nrcpt=1 (queue active)
Jan 1 01:37:36 nextcloud postfix/smtp[40840]: connect to smtp.yahoo.com[216.145.54.171]:587: Operation timed out
Jan 1 01:38:06 nextcloud postfix/smtp[40840]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 01:38:36 nextcloud postfix/smtp[40840]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 01:39:06 nextcloud postfix/smtp[40840]: connect to smtp.yahoo.com[216.145.54.155]:587: Operation timed out
Jan 1 01:39:36 nextcloud postfix/smtp[40840]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 01:39:36 nextcloud postfix/smtp[40840]: 86B7121D06: to=<athy_nguyen@yahoo.com>, relay=none, delay=1995, delays=1845/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out)
Jan 1 01:47:06 nextcloud postfix/qmgr[94717]: 850B121C60: from=<root@nextcloud.localdomain>, size=352, nrcpt=1 (queue active)
Jan 1 01:47:37 nextcloud postfix/smtp[41271]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 01:48:07 nextcloud postfix/smtp[41271]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 01:48:37 nextcloud postfix/smtp[41271]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 01:49:07 nextcloud postfix/smtp[41271]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 01:49:37 nextcloud postfix/smtp[41271]: connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out
Jan 1 01:49:37 nextcloud postfix/smtp[41271]: 850B121C60: to=<athy_nguyen@yahoo.com>, relay=none, delay=50580, delays=50429/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out)
Jan 1 02:02:06 nextcloud postfix/qmgr[94717]: 394AD21C72: from=<root@nextcloud.localdomain>, size=45602, nrcpt=1 (queue active)
Jan 1 02:02:36 nextcloud postfix/smtp[42221]: connect to smtp.yahoo.com[216.145.54.171]:587: Operation timed out
Jan 1 02:03:06 nextcloud postfix/smtp[42221]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 02:03:36 nextcloud postfix/smtp[42221]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 02:04:06 nextcloud postfix/smtp[42221]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 02:04:36 nextcloud postfix/smtp[42221]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 02:04:36 nextcloud postfix/smtp[42221]: 394AD21C72: to=<athy_nguyen@yahoo.com>, relay=none, delay=50625, delays=50475/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out)
Jan 1 02:17:06 nextcloud postfix/qmgr[94717]: 86B7121D06: from=<root@nextcloud.localdomain>, size=2998, nrcpt=1 (queue active)
Jan 1 02:17:36 nextcloud postfix/smtp[42774]: connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out
Jan 1 02:18:06 nextcloud postfix/smtp[42774]: connect to smtp.yahoo.com[216.145.54.155]:587: Operation timed out
Jan 1 02:18:36 nextcloud postfix/smtp[42774]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 02:19:06 nextcloud postfix/smtp[42774]: connect to smtp.yahoo.com[216.145.54.171]:587: Operation timed out
Jan 1 02:19:36 nextcloud postfix/smtp[42774]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out

Like I said. I have already change everything to gmail but I don't know why it's still trying to connect to yahoo. Is there anyway to undo all the step and start again from the SECURITY part?

Also, I didn't get any email when do the test and when I enter:
/bin/sh /scripts/aide/chkaide.sh
it did not give me anything, what wast suppose to happen here if it's all correct and running ?
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
So I did change the whole thing to gmail but I think I'm still getting the same error the log file are below.
Jan 1 00:00:11 nextcloud newsyslog[36371]: logfile turned over
Jan 1 00:37:05 nextcloud postfix/qmgr[94717]: 850B121C60: from=<root@nextcloud.localdomain>, size=352, nrcpt=1 (queue active)
Jan 1 00:37:35 nextcloud postfix/smtp[38035]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 00:38:05 nextcloud postfix/smtp[38035]: connect to smtp.yahoo.com[216.145.54.171]:587: Operation timed out
Jan 1 00:38:35 nextcloud postfix/smtp[38035]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 00:39:05 nextcloud postfix/smtp[38035]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 00:39:35 nextcloud postfix/smtp[38035]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 00:39:35 nextcloud postfix/smtp[38035]: 850B121C60: to=<athy_nguyen@yahoo.com>, relay=none, delay=46378, delays=46228/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out)
Jan 1 00:52:05 nextcloud postfix/qmgr[94717]: 394AD21C72: from=<root@nextcloud.localdomain>, size=45602, nrcpt=1 (queue active)
Jan 1 00:52:35 nextcloud postfix/smtp[38582]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 00:53:05 nextcloud postfix/smtp[38582]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 00:53:35 nextcloud postfix/smtp[38582]: connect to smtp.yahoo.com[216.145.54.155]:587: Operation timed out
Jan 1 00:54:05 nextcloud postfix/smtp[38582]: connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out
Jan 1 00:54:35 nextcloud postfix/smtp[38582]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 00:54:35 nextcloud postfix/smtp[38582]: 394AD21C72: to=<athy_nguyen@yahoo.com>, relay=none, delay=46424, delays=46274/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out)
Jan 1 01:06:21 nextcloud postfix/pickup[39053]: 86B7121D06: uid=0 from=<root>
Jan 1 01:06:21 nextcloud postfix/cleanup[39530]: 86B7121D06: message-id=<20190101070621.86B7121D06@nextcloud.localdomain>
Jan 1 01:06:21 nextcloud postfix/qmgr[94717]: 86B7121D06: from=<root@nextcloud.localdomain>, size=2998, nrcpt=1 (queue active)
Jan 1 01:06:51 nextcloud postfix/smtp[39532]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 01:07:21 nextcloud postfix/smtp[39532]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 01:07:51 nextcloud postfix/smtp[39532]: connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out
Jan 1 01:08:21 nextcloud postfix/smtp[39532]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 01:08:51 nextcloud postfix/smtp[39532]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 01:08:51 nextcloud postfix/smtp[39532]: 86B7121D06: to=<athy_nguyen@yahoo.com>, relay=none, delay=150, delays=0.08/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out)
Jan 1 01:17:05 nextcloud postfix/qmgr[94717]: 86B7121D06: from=<root@nextcloud.localdomain>, size=2998, nrcpt=1 (queue active)
Jan 1 01:17:35 nextcloud postfix/smtp[39983]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 01:18:05 nextcloud postfix/smtp[39983]: connect to smtp.yahoo.com[216.145.54.155]:587: Operation timed out
Jan 1 01:18:35 nextcloud postfix/smtp[39983]: connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out
Jan 1 01:19:05 nextcloud postfix/smtp[39983]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 01:19:35 nextcloud postfix/smtp[39983]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 01:19:35 nextcloud postfix/smtp[39983]: 86B7121D06: to=<athy_nguyen@yahoo.com>, relay=none, delay=794, delays=644/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out)
Jan 1 01:37:06 nextcloud postfix/qmgr[94717]: 86B7121D06: from=<root@nextcloud.localdomain>, size=2998, nrcpt=1 (queue active)
Jan 1 01:37:36 nextcloud postfix/smtp[40840]: connect to smtp.yahoo.com[216.145.54.171]:587: Operation timed out
Jan 1 01:38:06 nextcloud postfix/smtp[40840]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 01:38:36 nextcloud postfix/smtp[40840]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 01:39:06 nextcloud postfix/smtp[40840]: connect to smtp.yahoo.com[216.145.54.155]:587: Operation timed out
Jan 1 01:39:36 nextcloud postfix/smtp[40840]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 01:39:36 nextcloud postfix/smtp[40840]: 86B7121D06: to=<athy_nguyen@yahoo.com>, relay=none, delay=1995, delays=1845/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out)
Jan 1 01:47:06 nextcloud postfix/qmgr[94717]: 850B121C60: from=<root@nextcloud.localdomain>, size=352, nrcpt=1 (queue active)
Jan 1 01:47:37 nextcloud postfix/smtp[41271]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 01:48:07 nextcloud postfix/smtp[41271]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 01:48:37 nextcloud postfix/smtp[41271]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 01:49:07 nextcloud postfix/smtp[41271]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 01:49:37 nextcloud postfix/smtp[41271]: connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out
Jan 1 01:49:37 nextcloud postfix/smtp[41271]: 850B121C60: to=<athy_nguyen@yahoo.com>, relay=none, delay=50580, delays=50429/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out)
Jan 1 02:02:06 nextcloud postfix/qmgr[94717]: 394AD21C72: from=<root@nextcloud.localdomain>, size=45602, nrcpt=1 (queue active)
Jan 1 02:02:36 nextcloud postfix/smtp[42221]: connect to smtp.yahoo.com[216.145.54.171]:587: Operation timed out
Jan 1 02:03:06 nextcloud postfix/smtp[42221]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 02:03:36 nextcloud postfix/smtp[42221]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out
Jan 1 02:04:06 nextcloud postfix/smtp[42221]: connect to smtp.yahoo.com[216.145.54.154]:587: Operation timed out
Jan 1 02:04:36 nextcloud postfix/smtp[42221]: connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out
Jan 1 02:04:36 nextcloud postfix/smtp[42221]: 394AD21C72: to=<athy_nguyen@yahoo.com>, relay=none, delay=50625, delays=50475/0.01/150/0, dsn=4.4.1, status=deferred (connect to smtp.yahoo.com[216.145.54.173]:587: Operation timed out)
Jan 1 02:17:06 nextcloud postfix/qmgr[94717]: 86B7121D06: from=<root@nextcloud.localdomain>, size=2998, nrcpt=1 (queue active)
Jan 1 02:17:36 nextcloud postfix/smtp[42774]: connect to smtp.yahoo.com[216.145.54.172]:587: Operation timed out
Jan 1 02:18:06 nextcloud postfix/smtp[42774]: connect to smtp.yahoo.com[216.145.54.155]:587: Operation timed out
Jan 1 02:18:36 nextcloud postfix/smtp[42774]: connect to smtp.yahoo.com[98.139.253.104]:587: Operation timed out
Jan 1 02:19:06 nextcloud postfix/smtp[42774]: connect to smtp.yahoo.com[216.145.54.171]:587: Operation timed out
Jan 1 02:19:36 nextcloud postfix/smtp[42774]: connect to smtp.yahoo.com[98.139.253.105]:587: Operation timed out

Like I said. I have already change everything to gmail but I don't know why it's still trying to connect to yahoo. Is there anyway to undo all the step and start again from the SECURITY part?

Also, I didn't get any email when do the test and when I enter:
/bin/sh /scripts/aide/chkaide.sh
it did not give me anything, what wast suppose to happen here if it's all correct and running ?

So, the chkaide script does what I described in the guide; it replaces the change log database every day with a new one, and emails the contents of the old one to you. The reason you're not receiving the emails, is because you haven't configured postfix correctly. As you can see in the logs, postfix is still trying to connect to the Yahoo SMTP server. This is (1) the wrong server for yahoo, and (2) even if it was the right server for yahoo, obviously not the right server for gmail.

The configuration of the MTA is entirely in text files, so restarting the process is as simple as going back to the start of the MTA section in the guide and ensuring you make the appropriate configuration changes again. To be explicit though, to change the smtp server you will need to ensure you have:
  • relayhost = [smtp.gmail.com]:587 at the bottom of /usr/local/etc/postfix/main.cf
  • The correct authentication details, I.e. smtp.gmail.com <username>:<password> in /usr/local/etc/postfix/sasl_passwd
You'll then need to rehash the sasl_passwd file: postmap /usr/local/etc/postfix/sasl_passwd. Note that you'll need to replace <username> with your gmail account name, i.e. "athy_nguyen@gmail.com", and <password> with the password for this account. You'll also need to make sure you have Less Secure Apps enabled for your gmail account.

And just to make sure, what you could do is open up all of the configuration files specified in this section, and do a search (Ctrl + W in nano) for the phrase "yahoo", and replace it with gmail. That would be one way to track your configuration problems down.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,449
With Nextcloud 14 and 15, the email is handled by Nextcloud itself and this would be located under Admin account => Settings.
 

RueGorE

Dabbler
Joined
Dec 10, 2018
Messages
18
This is an interesting one. I spun up a clean jail and installed nextcloud-php72 to make sure occ is present at the beginning of the installation, which it was. Based on the output of the listing of /usr/local/www/nextcloud/, it doesn't seem like you have nextcloud installed. The only folders you have present are the ones mounted via fstab. For reference, this is what the web root contents should look like:

Code:
root@nextcloud:/usr/local/www/nextcloud # ls -al
total 151
drwxr-xr-x  16 root  wheel     30 Jan  1 23:52 .
drwxr-xr-x   3 root  wheel      3 Jan  1 23:52 ..
-rw-r--r--   1 root  www     2836 Dec 10 21:21 .htaccess
-rw-rw-r--   1 www   www      163 Dec 10 21:21 .user.ini
drwxr-xr-x  32 root  wheel     40 Jan  1 23:52 3rdparty
drwxr-xr-x   2 www   www        2 Dec 25 12:10 apps
drwxr-xr-x  39 root  wheel     39 Jan  1 23:52 apps-pkg
-rw-r--r--   1 root  wheel  12063 Dec 10 21:21 AUTHORS
drwxr-xr-x   2 www   www        6 Jan  1 23:52 config
-rw-r--r--   1 root  wheel   3650 Dec 10 21:21 console.php
-rw-r--r--   1 root  wheel  34520 Dec 10 21:21 COPYING
drwxr-xr-x  18 root  wheel     24 Jan  1 23:52 core
-rw-r--r--   1 root  wheel   4979 Dec 10 21:21 cron.php
drwxr-xr-x   2 www   www        2 Dec 25 12:10 data
-rw-r--r--   1 root  wheel    156 Dec 10 21:21 index.html
-rw-r--r--   1 root  wheel   3172 Dec 10 21:21 index.php
drwxr-xr-x   6 root  wheel      9 Jan  1 23:52 lib
-rw-r--r--   1 root  wheel    283 Dec 10 21:21 occ
drwxr-xr-x   2 root  wheel      3 Jan  1 23:52 ocm-provider
drwxr-xr-x   2 root  wheel      5 Jan  1 23:52 ocs
drwxr-xr-x   2 root  wheel      3 Jan  1 23:52 ocs-provider
-rw-r--r--   1 root  wheel   2969 Dec 10 21:21 public.php
-rw-r--r--   1 root  wheel   5139 Dec 10 21:21 remote.php
drwxr-xr-x   4 root  wheel      7 Jan  1 23:52 resources
-rw-r--r--   1 root  wheel     26 Dec 10 21:21 robots.txt
drwxr-xr-x  12 root  wheel     17 Jan  1 23:52 settings
-rw-r--r--   1 root  wheel   2232 Dec 10 21:21 status.php
drwxr-xr-x   3 root  wheel      4 Jan  1 23:52 themes
drwxr-xr-x   2 root  wheel      3 Jan  1 23:52 updater
-rw-r--r--   1 root  wheel    363 Dec 10 21:25 version.php


You could try reinstalling nextcloud, pkg install nextcloud-php72, or starting from scratch again. This point in the guide comes after configuring the nextcloud admin user and database details; did you do this? If so, it would appear that at some stage since then nextcloud has been uninstalled. Note, if you start from scratch again and you've configured the database in the web ui, you might need to recreate your db dataset. You could probably get it working with the same database (see the restoring from backup documentation), but it might be more trouble than just deleting it and starting again fresh, especially as it won't contain anything critical yet


You were totally right. Since I was using nextcloud-php72, installing php71-pecl-redis on accident uninstalled nextcloud. It didn't help I was trying to do this late last night so I completely glossed over that installing php71-pecl-redis showed it was going to uninstall nextcloud. I started from scratch and got better results.

Although now after I ran $ su -m www -c 'php /usr/local/www/nextcloud/occ config:system:set memcache.local --value="\OC\Memcache\APCu"' it returned:
$: Command not found.

So again, I'm running PHP7.2 and NextCloud 15. The sentence above the command states:
Otherwise, if you’re using PHP 7.1 or higher and Nextcloud 15 or PHP 7.2 or higher and Nextcloud 14, execute this command

Does PHP7.1 or higher not include 7.2? Do I just ignore and move on?
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
With Nextcloud 14 and 15, the email is handled by Nextcloud itself and this would be located under Admin account => Settings.
My guide uses the configuration of postfix to handle tamper detection notifications. When researching how to tie this in with Nextcloud's email services, there didn't appear to be an immediately obvious solution as it would need to be scripted, so I went with postfix.
 

RueGorE

Dabbler
Joined
Dec 10, 2018
Messages
18
I didn't type $. I was simply showing what terminal returned.
Edit: Never mind.... -____-

Thank you danb35
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
Does PHP7.1 or higher not include 7.2? Do I just ignore and move on?
Sure does include PHP7.2 (don't ignore and move on). If you're using PHP7.2 and NC 15 you need to execute that command. The reason I included this was that for example, the quarterly branch still shipped with 14.0.1 (when I last checked). If you installed PHP 7.1 and NC 14, there's a different command.
 

RueGorE

Dabbler
Joined
Dec 10, 2018
Messages
18
Looks like now I'm missing libdl.so.1. I'm not sure how to fix this, and doing a search online yields this is also required by many other programs. Reading through various results, it's not clear to me what I should do. Help please?


root@nextcloud:/var/db/aide # service sendmail stop
Cannot 'stop' sendmail. Set sendmail_enable to YES in /etc/rc.conf or use 'onestop' instead of 'stop'.
Cannot 'stop' sendmail_msp_queue. Set sendmail_msp_queue_enable to YES in /etc/rc.conf or use 'onestop' instead of 'stop'.
root@nextcloud:/var/db/aide # service postfix start
Shared object "libdl.so.1" not found, required by "libsasl2.so.3"
root@nextcloud:/var/db/aide # service postfix status
postfix is not running.
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
Looks like now I'm missing libdl.so.1. I'm not sure how to fix this, and doing a search online yields this is also required by many other programs. Reading through various results, it's not clear to me what I should do. Help please?


root@nextcloud:/var/db/aide # service sendmail stop
Cannot 'stop' sendmail. Set sendmail_enable to YES in /etc/rc.conf or use 'onestop' instead of 'stop'.
Cannot 'stop' sendmail_msp_queue. Set sendmail_msp_queue_enable to YES in /etc/rc.conf or use 'onestop' instead of 'stop'.
root@nextcloud:/var/db/aide # service postfix start
Shared object "libdl.so.1" not found, required by "libsasl2.so.3"
root@nextcloud:/var/db/aide # service postfix status
postfix is not running.
This is an issue with FN 11.1, in that FreeBSD 11.1 is now EOL and the pkg repo no longer delivers this file for some reason. Upgrading FreeNAS and your FreeBSD jail to 11.2 resolves this. A discussion of the issue and some potential solutions is in this thread. Essentially, you have 4 options:
  1. You can copy the file from another jail or your FreeNAS host - it should be located in /usr/lib/libdl.so.1 (and should be copied to this location within your Nextcloud jail)
  2. Change your package repo from latest to release_2, and reinstall postfix. This should grab the file, but may have other effects on other packages (not sure I haven't tried this recently)
  3. Create a symbolic link to the file: ln -sf /lib/libc.so.7 /usr/lib/libdl.so.1
  4. Upgrade your FreeNAS host to 11.2-RELEASE, then upgrade your jail to 11.2-RELEASE
    • After upgrading your FreeNAS host, this can be achieved by running iocage upgrade nextcloud -r 11.2-RELEASE from the shell (assuming your jail name is "nextcloud")
    • then, in your nextcloud jail run pkg update -f && pkg upgrade -f postfix-sasl
I'll emphasise that the first three should be considered temporary solutions, you really want to move to 11.2. I've resolved this successfully in the past with options 1,2 and 4. I have no experience with option 3.
 
Last edited:

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
I have already upgrade the whole thing to 11.2 before I start with your guide. However, this would probably all the files that are left when I was messing around when I'm still on 11.1 U-6. But I have scrubs all the volumes and start pretty much fresh. Any Idea as to what I should do next ?
This wasn't a reply to something you said; what's the issue you're having?
 

T_T

Explorer
Joined
Jul 24, 2018
Messages
64
So, the chkaide script does what I described in the guide; it replaces the change log database every day with a new one, and emails the contents of the old one to you. The reason you're not receiving the emails, is because you haven't configured postfix correctly. As you can see in the logs, postfix is still trying to connect to the Yahoo SMTP server. This is (1) the wrong server for yahoo, and (2) even if it was the right server for yahoo, obviously not the right server for gmail.

The configuration of the MTA is entirely in text files, so restarting the process is as simple as going back to the start of the MTA section in the guide and ensuring you make the appropriate configuration changes again. To be explicit though, to change the smtp server you will need to ensure you have:
  • relayhost = [smtp.gmail.com]:587 at the bottom of /usr/local/etc/postfix/main.cf
  • The correct authentication details, I.e. smtp.gmail.com <username>:<password> in /usr/local/etc/postfix/sasl_passwd
You'll then need to rehash the sasl_passwd file: postmap /usr/local/etc/postfix/sasl_passwd. Note that you'll need to replace <username> with your gmail account name, i.e. "athy_nguyen@gmail.com", and <password> with the password for this account. You'll also need to make sure you have Less Secure Apps enabled for your gmail account.

And just to make sure, what you could do is open up all of the configuration files specified in this section, and do a search (Ctrl + W in nano) for the phrase "yahoo", and replace it with gmail. That would be one way to track your configuration problems down.

I did went back and change everything to gmail but still giving that problem I'll try and figure out what I missed
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
I did went back and change everything to gmail but still giving that problem I'll try and figure out what I missed
I was able to replicate your issue by changing the relayhost directive in /usr/local/etc/postfix/main.cf. Changing it back resolved the issue dynamically without any need for a service restart, but perhaps it will help you: service postfix restart. Create a paste of this file if you like and I'll have a look over it (use https://pastebin.com or similar)
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
@samuel-emrys
Hi thanks for this great guide, but unfortunately I stucked at the following point to edit the file "nano /usr/local/etc/apache24/httpd.conf".
Code:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so


I am not able to find these two lines.

Tanks for your help
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
@samuel-emrys
Hi thanks for this great guide, but unfortunately I stucked at the following point to edit the file "nano /usr/local/etc/apache24/httpd.conf".
Code:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so


I am not able to find these two lines.

Tanks for your help
This is a bit puzzling; they should be there by default. Did you search for the phrases "proxy_module" and "proxy_fcgi_module"? (Ctrl + W in nano). Can you post the output of pkg info apache24? The immediate solution appears to be just add those lines, and you could do that to see how you go. My concern is that if those are missing, what else is missing from your apache config. It might cause you issues down the line.

Cheers.
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
@samuel-emrys
Here ist the output:
Code:
root@nextcloud:~ # pkg info apache24
apache24-2.4.37
Name           : apache24
Version        : 2.4.37
Installed on   : Thu Jan  3 20:10:31 2019 CET
Origin         : www/apache24
Architecture   : FreeBSD:11:amd64
Prefix         : /usr/local
Categories     : ipv6 www
Licenses       : APACHE20
Maintainer     : apache@FreeBSD.org
WWW            : https://httpd.apache.org/
Comment        : Version 2.4.x of Apache web server
Options        :
    ACCESS_COMPAT  : on
    ACTIONS        : on
    ALIAS          : on
    ALLOWMETHODS   : on
    ASIS           : on
    AUTHNZ_FCGI    : on
    AUTHNZ_LDAP    : off
    AUTHN_ANON     : on
    AUTHN_CORE     : on
    AUTHN_DBD      : on
    AUTHN_DBM      : on
    AUTHN_FILE     : on
    AUTHN_SOCACHE  : on
    AUTHZ_CORE     : on
    AUTHZ_DBD      : on
    AUTHZ_DBM      : on
    AUTHZ_GROUPFILE: on
    AUTHZ_HOST     : on
    AUTHZ_OWNER    : on
    AUTHZ_USER     : on
    AUTH_BASIC     : on
    AUTH_DIGEST    : on
    AUTH_FORM      : on
    AUTOINDEX      : on
    BROTLI         : off
    BUCKETEER      : off
    BUFFER         : on
    CACHE          : on
    CACHE_DISK     : on
    CACHE_SOCACHE  : on
    CASE_FILTER    : off
    CASE_FILTER_IN : off
    CERN_META      : on
    CGI            : on
    CGID           : on
    CHARSET_LITE   : on
    DATA           : on
    DAV            : on
    DAV_FS         : on
    DAV_LOCK       : on
    DBD            : on
    DEFLATE        : on
    DIALUP         : on
    DIR            : on
    DOCS           : on
    DUMPIO         : on
    ECHO           : off
    ENV            : on
    EXAMPLE_HOOKS  : off
    EXAMPLE_IPC    : off
    EXPIRES        : on
    EXT_FILTER     : on
    FILE_CACHE     : on
    FILTER         : on
    HEADERS        : on
    HEARTBEAT      : on
    HEARTMONITOR   : on
    HTTP2          : on
    IDENT          : off
    IMAGEMAP       : on
    INCLUDE        : on
    INFO           : on
    IPV4_MAPPED    : off
    LBMETHOD_BYBUSYNESS: on
    LBMETHOD_BYREQUESTS: on
    LBMETHOD_BYTRAFFIC: on
    LBMETHOD_HEARTBEAT: on
    LDAP           : off
    LOGIO          : on
    LOG_DEBUG      : on
    LOG_FORENSIC   : on
    LUA            : off
    LUAJIT         : off
    MACRO          : on
    MD             : off
    MIME           : on
    MIME_MAGIC     : on
    MPM_EVENT      : off
    MPM_PREFORK    : on
    MPM_SHARED     : on
    MPM_WORKER     : off
    NEGOTIATION    : on
    OPTIONAL_FN_EXPORT: off
    OPTIONAL_FN_IMPORT: off
    OPTIONAL_HOOK_EXPORT: off
    OPTIONAL_HOOK_IMPORT: off
    PROXY          : on
    PROXY_AJP      : on
    PROXY_BALANCER : on
    PROXY_CONNECT  : on
    PROXY_EXPRESS  : on
    PROXY_FCGI     : on
    PROXY_FDPASS   : on
    PROXY_FTP      : on
    PROXY_HCHECK   : on
    PROXY_HTML     : on
    PROXY_HTTP     : on
    PROXY_HTTP2    : on
    PROXY_SCGI     : on
    PROXY_UWSGI    : on
    PROXY_WSTUNNEL : on
    RATELIMIT      : on
    REFLECTOR      : on
    REMOTEIP       : on
    REQTIMEOUT     : on
    REQUEST        : on
    REWRITE        : on
    SED            : on
    SESSION        : on
    SESSION_COOKIE : on
    SESSION_CRYPTO : on
    SESSION_DBD    : on
    SETENVIF       : on
    SLOTMEM_PLAIN  : on
    SLOTMEM_SHM    : on
    SOCACHE_DBM    : on
    SOCACHE_DC     : off
    SOCACHE_MEMCACHE: on
    SOCACHE_SHMCB  : on
    SPELING        : on
    SSL            : on
    STATUS         : on
    SUBSTITUTE     : on
    SUEXEC         : off
    UNIQUE_ID      : on
    USERDIR        : on
    USERTRACK      : on
    VERSION        : on
    VHOST_ALIAS    : on
    WATCHDOG       : on
    XML2ENC        : on
Shared Libs required:
    libexpat.so.1
    libpcre.so.1
    libnghttp2.so.14
    libgdbm.so.6
    libaprutil-1.so.0
    libapr-1.so.0
    libdb-5.3.so.0
    libxml2.so.2
Annotations    :
    FreeBSD_version: 1102000
    cpe            : cpe:2.3:a:apache:http_server:2.4.37:::::freebsd11:x64d server
    repo_type      : binary
    repository     : FreeBSD
Flat size      : 26.4MiB
Description    :
The Apache HTTP Server Project is an effort to develop and maintain an
open-source HTTP server for various modern desktop and server operating
systems, such as UNIX and Windows NT. The goal of this project is to
provide a secure, efficient and extensible server which provides HTTP
services in sync with the current HTTP standards.
The 2.x branch of Apache Web Server includes several improvements like
threading, use of APR, native IPv6 and SSL support, and many more.

WWW: https://httpd.apache.org/


I followed now your suggestion and added the two lines to the "httpd.conf" file, but get the following error:
Code:
root@nextcloud:~ # apachectl graceful
Performing sanity check on apache24 configuration:
httpd: Syntax error on line 66 of /usr/local/etc/apache24/httpd.conf: Cannot load modules/mod_proxy.so into server: Cannot open "/usr/local/modules/mod_proxy.so"
Performing a graceful restart
httpd: Syntax error on line 66 of /usr/local/etc/apache24/httpd.conf: Cannot load modules/mod_proxy.so into server: Cannot open "/usr/local/modules/mod_proxy.so"
root@nextcloud:~ # 


UPDATE:
Even with the Error I followed your instruction till the chapter "TEST YOUR CONFIGURATION".
If I type into the browser the IP Adress of the Nextcloud Server I receive only
Code:
It works!
on the screen but not the setup screen from Nextcloud.
 
Last edited:

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
@samuel-emrys
Here ist the output:
Code:
root@nextcloud:~ # pkg info apache24
apache24-2.4.37
Name           : apache24
Version        : 2.4.37
Installed on   : Thu Jan  3 20:10:31 2019 CET
Origin         : www/apache24
Architecture   : FreeBSD:11:amd64
Prefix         : /usr/local
Categories     : ipv6 www
Licenses       : APACHE20
Maintainer     : apache@FreeBSD.org
WWW            : https://httpd.apache.org/
Comment        : Version 2.4.x of Apache web server
Options        :
    ACCESS_COMPAT  : on
    ACTIONS        : on
    ALIAS          : on
    ALLOWMETHODS   : on
    ASIS           : on
    AUTHNZ_FCGI    : on
    AUTHNZ_LDAP    : off
    AUTHN_ANON     : on
    AUTHN_CORE     : on
    AUTHN_DBD      : on
    AUTHN_DBM      : on
    AUTHN_FILE     : on
    AUTHN_SOCACHE  : on
    AUTHZ_CORE     : on
    AUTHZ_DBD      : on
    AUTHZ_DBM      : on
    AUTHZ_GROUPFILE: on
    AUTHZ_HOST     : on
    AUTHZ_OWNER    : on
    AUTHZ_USER     : on
    AUTH_BASIC     : on
    AUTH_DIGEST    : on
    AUTH_FORM      : on
    AUTOINDEX      : on
    BROTLI         : off
    BUCKETEER      : off
    BUFFER         : on
    CACHE          : on
    CACHE_DISK     : on
    CACHE_SOCACHE  : on
    CASE_FILTER    : off
    CASE_FILTER_IN : off
    CERN_META      : on
    CGI            : on
    CGID           : on
    CHARSET_LITE   : on
    DATA           : on
    DAV            : on
    DAV_FS         : on
    DAV_LOCK       : on
    DBD            : on
    DEFLATE        : on
    DIALUP         : on
    DIR            : on
    DOCS           : on
    DUMPIO         : on
    ECHO           : off
    ENV            : on
    EXAMPLE_HOOKS  : off
    EXAMPLE_IPC    : off
    EXPIRES        : on
    EXT_FILTER     : on
    FILE_CACHE     : on
    FILTER         : on
    HEADERS        : on
    HEARTBEAT      : on
    HEARTMONITOR   : on
    HTTP2          : on
    IDENT          : off
    IMAGEMAP       : on
    INCLUDE        : on
    INFO           : on
    IPV4_MAPPED    : off
    LBMETHOD_BYBUSYNESS: on
    LBMETHOD_BYREQUESTS: on
    LBMETHOD_BYTRAFFIC: on
    LBMETHOD_HEARTBEAT: on
    LDAP           : off
    LOGIO          : on
    LOG_DEBUG      : on
    LOG_FORENSIC   : on
    LUA            : off
    LUAJIT         : off
    MACRO          : on
    MD             : off
    MIME           : on
    MIME_MAGIC     : on
    MPM_EVENT      : off
    MPM_PREFORK    : on
    MPM_SHARED     : on
    MPM_WORKER     : off
    NEGOTIATION    : on
    OPTIONAL_FN_EXPORT: off
    OPTIONAL_FN_IMPORT: off
    OPTIONAL_HOOK_EXPORT: off
    OPTIONAL_HOOK_IMPORT: off
    PROXY          : on
    PROXY_AJP      : on
    PROXY_BALANCER : on
    PROXY_CONNECT  : on
    PROXY_EXPRESS  : on
    PROXY_FCGI     : on
    PROXY_FDPASS   : on
    PROXY_FTP      : on
    PROXY_HCHECK   : on
    PROXY_HTML     : on
    PROXY_HTTP     : on
    PROXY_HTTP2    : on
    PROXY_SCGI     : on
    PROXY_UWSGI    : on
    PROXY_WSTUNNEL : on
    RATELIMIT      : on
    REFLECTOR      : on
    REMOTEIP       : on
    REQTIMEOUT     : on
    REQUEST        : on
    REWRITE        : on
    SED            : on
    SESSION        : on
    SESSION_COOKIE : on
    SESSION_CRYPTO : on
    SESSION_DBD    : on
    SETENVIF       : on
    SLOTMEM_PLAIN  : on
    SLOTMEM_SHM    : on
    SOCACHE_DBM    : on
    SOCACHE_DC     : off
    SOCACHE_MEMCACHE: on
    SOCACHE_SHMCB  : on
    SPELING        : on
    SSL            : on
    STATUS         : on
    SUBSTITUTE     : on
    SUEXEC         : off
    UNIQUE_ID      : on
    USERDIR        : on
    USERTRACK      : on
    VERSION        : on
    VHOST_ALIAS    : on
    WATCHDOG       : on
    XML2ENC        : on
Shared Libs required:
    libexpat.so.1
    libpcre.so.1
    libnghttp2.so.14
    libgdbm.so.6
    libaprutil-1.so.0
    libapr-1.so.0
    libdb-5.3.so.0
    libxml2.so.2
Annotations    :
    FreeBSD_version: 1102000
    cpe            : cpe:2.3:a:apache:http_server:2.4.37:::::freebsd11:x64d server
    repo_type      : binary
    repository     : FreeBSD
Flat size      : 26.4MiB
Description    :
The Apache HTTP Server Project is an effort to develop and maintain an
open-source HTTP server for various modern desktop and server operating
systems, such as UNIX and Windows NT. The goal of this project is to
provide a secure, efficient and extensible server which provides HTTP
services in sync with the current HTTP standards.
The 2.x branch of Apache Web Server includes several improvements like
threading, use of APR, native IPv6 and SSL support, and many more.

WWW: https://httpd.apache.org/


I followed now your suggestion and added the two lines to the "httpd.conf" file, but get the following error:
Code:
root@nextcloud:~ # apachectl graceful
Performing sanity check on apache24 configuration:
httpd: Syntax error on line 66 of /usr/local/etc/apache24/httpd.conf: Cannot load modules/mod_proxy.so into server: Cannot open "/usr/local/modules/mod_proxy.so"
Performing a graceful restart
httpd: Syntax error on line 66 of /usr/local/etc/apache24/httpd.conf: Cannot load modules/mod_proxy.so into server: Cannot open "/usr/local/modules/mod_proxy.so"
root@nextcloud:~ # 




Okay I've looked into this a bit further and it looks like there was an error in my guide. Can you find the following lines?
Code:
    LoadModule proxy_module libexec/apache24/mod_proxy.so
    LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so


If so, these are the ones you want to uncomment. I'm not sure where I got modules/* from, but this is what appears in my httpd.conf file. I'll update the guide accordingly.

UPDATE:
Even with the Error I followed your instruction till the chapter "TEST YOUR CONFIGURATION".
If I type into the browser the IP address of the Nextcloud Server I receive only
Code:
It works!
on the screen but not the setup screen from Nextcloud.
This means that your DocumentRoot is still set to /usr/local/www/apache24/data, which is where apache is reading from. The index.html file here is what displays It works!. Change this path to /usr/local/www/nextcloud in httpd.conf as per the instructions in the guide. Note that if you haven't deleted /usr/local/www/apache24/Includes/test.conf as instructed this may interfere with any change you have made.
 
Last edited:

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
Okay I've looked into this a bit further and it looks like there was an error in my guide. Can you find the following lines?
I will have a look into the file will give you feedback.

This means that your DocumentRoot is still set to /usr/local/www/apache24/data, which is where apache is reading from. The index.html file here is what displays It works!. Change this path to /usr/local/www/nextcloud in httpd.conf as per the instructions in the guide. Note that if you haven't deleted /usr/local/www/apache24/Includes/test.conf as instructed this may interfere with any change you have made.
I thought I had already changed this, but will have a further look into the file.

UPDATE:
It works.
I am now through with your guid and after your corrections and help it was absolutely no problem.

Thanks for this good instruction.
 
Last edited:
Top