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

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
You're asking a question about Nextcloud, with little detail, in a thread about ownCloud so shouldn't be surprised at the lack of response!

I'd open a new thread and ask the specific question in there with relevant details about your system and what you mean by 'restore default settings'
 

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
I asked a question in a owncloud thread because the process is identical, by restoring default settings i meant the option to restore factory default in Freenas. I’ll open a new thread, i was hoping someone with more knowledge could point me in the right direction. I apologize if it sounded “wrong”. I followed this guide (as many others) to install nextcloud with nginx instead of apache. Cheers
 

Jacopx

Patron
Joined
Feb 19, 2016
Messages
367

PrincePaul

Patron
Joined
Feb 26, 2012
Messages
225
@Joshua Parker Ruehlig: Thanks for this detailed how to. If I remember right I used that years ago to setup my owncloud - still runs perfectly ;)
Now that I´m upgrading to a whole new system the question came up if you`ll update or adapt this how to to fit the new iocage jails?

Someone asked one page before if anybody tired it, but I guess the answer was more on FreeNAS 11.1 than on iocage. As 11.1 has both jail types on board. Old ui = warden jail and in the new ui created jails = iocage.
 

ZodiacUHD

Patron
Joined
Aug 28, 2015
Messages
226
@Joshua Parker Ruehlig: Thanks for this detailed how to. If I remember right I used that years ago to setup my owncloud - still runs perfectly ;)
Now that I´m upgrading to a whole new system the question came up if you`ll update or adapt this how to to fit the new iocage jails?

Someone asked one page before if anybody tired it, but I guess the answer was more on FreeNAS 11.1 than on iocage. As 11.1 has both jail types on board. Old ui = warden jail and in the new ui created jails = iocage.

I was able to get it running in Iocage quite easily. The process is pretty much the same. You create the jail using Iocage, you iocage console nameofyourjail and you just type in the same commands you would type for warden. Easy as that :)
 

PrincePaul

Patron
Joined
Feb 26, 2012
Messages
225
Perfect. I was only playing around with iocage and plex in a VM as I don`t have my new mainboard yet.

But that sounds promising - thanks :D

Edit: To combine this with letsencrypt/Certbot and nginx would be the cherry on the cake ;)
 
Last edited:

oldkat

Dabbler
Joined
Jan 23, 2018
Messages
10
Interesting and detailed installation instructions, but you still assume much about the level of experience of your audience.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,975
Interesting and detailed installation instructions, but you still assume much about the level of experience of your audience.
How so? The directions are step by step so anyone can do it.
 

wxlsxn

Dabbler
Joined
May 19, 2017
Messages
29
Just install certbot pkg install py27-certbot and set it up according to the docs.
I have not been able to get certbot working for the life of me. When I run the command you listed, I get "pkg: repository FreeBSD contains packages for the wrong OS version..."
And if I do the port command and make clean etc, anytime I run certbot commands, it states there's missing python scripts. It's all a mess and I have no idea why.
 
Last edited:

oldkat

Dabbler
Joined
Jan 23, 2018
Messages
10
Anyone with a working knowledge of console operations within Linux or BSD. Anyone with a little experience with Linux and scripting languages. Anyone who understands where to find the scripting modules and how to place your beautiful code within them. Yes. I have spent the last 40 years working in the computer field, know several scripting languages, have managed everything from military mainframe computer facilities to banking computer facilities, to development and maintenance of websites and construction and development of networks and computers for individuals and businesses, and I struggle to follow exactly what you are trying to teach. In my experience, one must be able to step back from one's knowledge and experience, and try to follow the stream of instruction from an uneducated point of view. The world is full of "dummies" who want greatly to be able to learn and accomplish those things you who are educated take for granted.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
I was able to get it running in Iocage quite easily. The process is pretty much the same. You create the jail using Iocage, you iocage console nameofyourjail and you just type in the same commands you would type for warden. Easy as that :)
After creating an iocage jail that shows up in my
Code:
iocage list
then running the console command above and trying to install a pkg I get the error
"The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: "
After typing Y
Code:
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly, please wait...
pkg: Error fetching http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly/Latest/pkg.txz: Operation timed out
A pre-built version of pkg could not be found for your system.
Consider changing PACKAGESITE or installing it from ports: 'ports-mgmt/pkg'.

What am I doing wrong that it just doesn't work like a fresh warden jail?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,975
What am I doing wrong that it just doesn't work like a fresh warden jail?
Because FreeBSD 11 is no longer supported. Build a jail based on 11.1 and it will work.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Because FreeBSD 11 is no longer supported. Build a jail based on 11.1 and it will work.
I guess that is why I can
Code:
pkg install nano
in a jail that I create with the iocage create -n "wordpress" -p /tmp/pkg.json -r 11.1-RELEASE ip4_addr="vnet0|192.168.5.74/24" defaultrouter="192.168.5.1" vnet="on" allow_raw_sockets="1" boot="on"
Works, Thanks.

Trying to install wordpress into iocage jail as a simple thing to try before tackling nextcloud
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Don't know how it happened but my /var/run/php-fpm.sock is missing.
Code:
php-fpm status
php_fpm is running as pid 55255.
 

NasKar

Guru
Joined
Jan 8, 2016
Messages
739
Don't know how it happened but my /var/run/php-fpm.sock is missing.
Code:
php-fpm status
php_fpm is running as pid 55255.
I did
pkg install php70-bz2 php70-ctype php70-curl php70-dom php70-exif php70-fileinfo php70-filter php70-gd php70-hash php70-iconv php70-intl php70-json php70-mbstring php70-mcrypt php70-pdo_mysql php70-openssl php70-posix php70-session php70-simplexml php70-xml php70-xmlreader php70-xmlwriter php70-xsl php70-wddx php70-zip php70-zlib php70-opcache

and
Code:
service nginx restart && service php-fpm restart && service mysql-server restart && service redis restart

Now php-fpm.sock is back
Code:
 ls -l
total 18
-rw-r--r--  1 root   wheel	  0 Mar 13 18:43 clean_var
-rw-------  1 root   wheel	  5 Mar 13 18:43 cron.pid
drwxr-xr-x  3 root   wheel	  3 Feb  6 18:44 cups
drwxr-xr-x  2 root   wheel	  2 Feb  6 18:44 dbus
-r--r--r--  1 root   wheel	304 Mar 13 18:43 ld-elf.so.hints
-r--r--r--  1 root   wheel	139 Mar 13 18:43 ld-elf32.so.hints
srw-rw-rw-  1 root   wheel	  0 Mar 13 18:43 log
srw-------  1 root   wheel	  0 Mar 13 18:43 logpriv
-rw-r--r--  1 root   wheel	  6 Mar 13 18:59 nginx.pid
-rw-r--r--  1 root   wheel	  5 Mar 13 18:59 php-fpm.pid
srw-rw----  1 www	www		0 Mar 13 18:59 php-fpm.sock
drwxrwx---  2 root   network	2 Jul 20  2017 ppp
drwxr-xr-x  2 redis  redis	  3 Mar 13 18:43 redis
drwx--x--x  2 root   wheel	  2 Jan  1 20:24 sudo
-rw-------  1 root   wheel	  5 Mar 13 18:43 syslog.pid
-rw-r--r--  1 root   wheel	  0 Mar 13 18:43 syslogd.sockets
drwx------  2 _tss   _tss	   2 Jan  1 21:00 tpm
-rw-r--r--  1 root   wheel	394 Mar 13 18:43 utx.active
drwxr-xr-x  2 root   wheel	  2 Jul 20  2017 wpa_supplicant

but when run the mynextcloudIP/nextcloud I get
Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
Here is my nginx error.log
Code:
2018/03/13 00:13:17 [error] 43793#103741: *414 directory index of "/usr/local/www/" is forbidden, client: 103.53.208.109, server: 192.168.5.81, request: "GET / HTTP/1.1", host: "my.outside.ip"
2018/03/13 00:36:08 [error] 43791#100876: *415 open() "/usr/local/www/admin/config.php" failed (2: No such file or directory), client: 120.234.128.5, server: 192.168.5.81, request: "GET /admin/config.php HTTP/1.1", host: "my.outside.ip"
2018/03/13 03:29:21 [error] 43791#100876: *420 directory index of "/usr/local/www/" is forbidden, client: 54.224.57.103, server: 192.168.5.81, request: "HEAD / HTTP/1.1", host: "my.outside.ip"
2018/03/13 03:29:21 [error] 43790#101340: *421 open() "/usr/local/www/clientaccesspolicy.xml" failed (2: No such file or directory), client: 54.224.57.103, server: 192.168.5.81, request: "GET /clientaccesspolicy.xml HTTP/1.1", host: "96.234.1$
2018/03/13 04:06:04 [error] 43794#103883: *422 open() "/usr/local/www/SiteViews/Simplified/Index/Images/Home/f2.png" failed (2: No such file or directory), client: 159.65.135.137, server: 192.168.5.81, request: "HEAD /SiteViews/Simplified/Ind$
2018/03/13 07:23:50 [crit] 43793#103741: *423 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.158, server: 192.168.5.81, request: "GET /nextcloud/ HTTP/1.1", upstre$
2018/03/13 09:33:54 [error] 43794#103883: *425 directory index of "/usr/local/www/" is forbidden, client: 216.218.206.66, server: 192.168.5.81, request: "GET / HTTP/1.1", host: "my.outside.ip"
2018/03/13 09:43:55 [error] 43791#100876: *430 open() "/usr/local/www/wp-includes/SimplePie/ogi.exe" failed (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/SimplePie/ogi.exe HTTP/1.1",$
2018/03/13 09:43:56 [error] 43791#100876: *428 open() "/usr/local/www/wp-includes/js/nri.exe" failed (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/js/nri.exe HTTP/1.1", host: "96.234$
2018/03/13 09:43:57 [error] 43791#100876: *429 "/usr/local/www/wp-includes/index.html" is not found (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/ HTTP/1.1", host: "my.outside.ip:443"
2018/03/13 10:48:50 [error] 43794#103883: *431 directory index of "/usr/local/www/" is forbidden, client: 38.142.119.106, server: 192.168.5.81, request: "GET / HTTP/1.1", host: "my.ddns"
2018/03/13 12:11:15 [error] 43793#103741: *432 "/usr/local/www/a2billing/index.html" is not found (2: No such file or directory), client: 46.161.55.106, server: 192.168.5.81, request: "GET /a2billing/ HTTP/1.1", host: "my.outside.ip"
2018/03/13 12:35:30 [error] 43793#103741: *433 directory index of "/usr/local/www/" is forbidden, client: 38.140.143.226, server: 192.168.5.81, request: "GET / HTTP/1.1", host: "my.ddns"
2018/03/13 15:30:22 [error] 43790#101340: *435 directory index of "/usr/local/www/" is forbidden, client: 216.244.83.210, server: 192.168.5.81, request: "GET / HTTP/1.0"
2018/03/13 17:14:48 [error] 43790#101340: *438 open() "/usr/local/www/wp-includes/SimplePie/ogi.exe" failed (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/SimplePie/ogi.exe HTTP/1.1",$
2018/03/13 17:14:48 [error] 43793#103741: *436 "/usr/local/www/wp-includes/index.html" is not found (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/ HTTP/1.1", host: "my.outside.ip:80"
2018/03/13 17:14:48 [error] 43790#101340: *437 open() "/usr/local/www/wp-includes/js/nri.exe" failed (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/js/nri.exe HTTP/1.1", host: "96.234$
2018/03/13 18:14:11 [error] 43793#103741: *439 directory index of "/usr/local/www/" is forbidden, client: 178.73.215.171, server: 192.168.5.81, request: "GET / HTTP/1.0"
2018/03/13 18:25:12 [crit] 43794#103883: *440 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.158, server: 192.168.5.81, request: "GET /nextcloud/apps/files/?dir=/&$
2018/03/13 18:28:35 [crit] 43793#103741: *442 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.30, server: 192.168.5.81, request: "GET /nextcloud/status.php HTTP/1.1$
2018/03/13 18:28:35 [crit] 43793#103741: *444 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.30, server: 192.168.5.81, request: "GET /nextcloud/status.php HTTP/1.1$
2018/03/13 18:29:07 [crit] 43794#103883: *446 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.30, server: 192.168.5.81, request: "GET /nextcloud/status.php HTTP/1.1$
 

555NASE

Patron
Joined
Mar 3, 2017
Messages
202
I did
pkg install php70-bz2 php70-ctype php70-curl php70-dom php70-exif php70-fileinfo php70-filter php70-gd php70-hash php70-iconv php70-intl php70-json php70-mbstring php70-mcrypt php70-pdo_mysql php70-openssl php70-posix php70-session php70-simplexml php70-xml php70-xmlreader php70-xmlwriter php70-xsl php70-wddx php70-zip php70-zlib php70-opcache

and
Code:
service nginx restart && service php-fpm restart && service mysql-server restart && service redis restart

Now php-fpm.sock is back
Code:
 ls -l
total 18
-rw-r--r--  1 root   wheel	  0 Mar 13 18:43 clean_var
-rw-------  1 root   wheel	  5 Mar 13 18:43 cron.pid
drwxr-xr-x  3 root   wheel	  3 Feb  6 18:44 cups
drwxr-xr-x  2 root   wheel	  2 Feb  6 18:44 dbus
-r--r--r--  1 root   wheel	304 Mar 13 18:43 ld-elf.so.hints
-r--r--r--  1 root   wheel	139 Mar 13 18:43 ld-elf32.so.hints
srw-rw-rw-  1 root   wheel	  0 Mar 13 18:43 log
srw-------  1 root   wheel	  0 Mar 13 18:43 logpriv
-rw-r--r--  1 root   wheel	  6 Mar 13 18:59 nginx.pid
-rw-r--r--  1 root   wheel	  5 Mar 13 18:59 php-fpm.pid
srw-rw----  1 www	www		0 Mar 13 18:59 php-fpm.sock
drwxrwx---  2 root   network	2 Jul 20  2017 ppp
drwxr-xr-x  2 redis  redis	  3 Mar 13 18:43 redis
drwx--x--x  2 root   wheel	  2 Jan  1 20:24 sudo
-rw-------  1 root   wheel	  5 Mar 13 18:43 syslog.pid
-rw-r--r--  1 root   wheel	  0 Mar 13 18:43 syslogd.sockets
drwx------  2 _tss   _tss	   2 Jan  1 21:00 tpm
-rw-r--r--  1 root   wheel	394 Mar 13 18:43 utx.active
drwxr-xr-x  2 root   wheel	  2 Jul 20  2017 wpa_supplicant

but when run the mynextcloudIP/nextcloud I get
Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
Here is my nginx error.log
Code:
2018/03/13 00:13:17 [error] 43793#103741: *414 directory index of "/usr/local/www/" is forbidden, client: 103.53.208.109, server: 192.168.5.81, request: "GET / HTTP/1.1", host: "my.outside.IP"
2018/03/13 00:36:08 [error] 43791#100876: *415 open() "/usr/local/www/admin/config.php" failed (2: No such file or directory), client: 120.234.128.5, server: 192.168.5.81, request: "GET /admin/config.php HTTP/1.1", host: "my.outside.IP"
2018/03/13 03:29:21 [error] 43791#100876: *420 directory index of "/usr/local/www/" is forbidden, client: 54.224.57.103, server: 192.168.5.81, request: "HEAD / HTTP/1.1", host: "my.outside.IP"
2018/03/13 03:29:21 [error] 43790#101340: *421 open() "/usr/local/www/clientaccesspolicy.xml" failed (2: No such file or directory), client: 54.224.57.103, server: 192.168.5.81, request: "GET /clientaccesspolicy.xml HTTP/1.1", host: "96.234.1$
2018/03/13 04:06:04 [error] 43794#103883: *422 open() "/usr/local/www/SiteViews/Simplified/Index/Images/Home/f2.png" failed (2: No such file or directory), client: 159.65.135.137, server: 192.168.5.81, request: "HEAD /SiteViews/Simplified/Ind$
2018/03/13 07:23:50 [crit] 43793#103741: *423 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.158, server: 192.168.5.81, request: "GET /nextcloud/ HTTP/1.1", upstre$
2018/03/13 09:33:54 [error] 43794#103883: *425 directory index of "/usr/local/www/" is forbidden, client: 216.218.206.66, server: 192.168.5.81, request: "GET / HTTP/1.1", host: "my.outside.IP"
2018/03/13 09:43:55 [error] 43791#100876: *430 open() "/usr/local/www/wp-includes/SimplePie/ogi.exe" failed (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/SimplePie/ogi.exe HTTP/1.1",$
2018/03/13 09:43:56 [error] 43791#100876: *428 open() "/usr/local/www/wp-includes/js/nri.exe" failed (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/js/nri.exe HTTP/1.1", host: "96.234$
2018/03/13 09:43:57 [error] 43791#100876: *429 "/usr/local/www/wp-includes/index.html" is not found (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/ HTTP/1.1", host: "my.outside.IP:443"
2018/03/13 10:48:50 [error] 43794#103883: *431 directory index of "/usr/local/www/" is forbidden, client: 38.142.119.106, server: 192.168.5.81, request: "GET / HTTP/1.1", host: "my.ddns"
2018/03/13 12:11:15 [error] 43793#103741: *432 "/usr/local/www/a2billing/index.html" is not found (2: No such file or directory), client: 46.161.55.106, server: 192.168.5.81, request: "GET /a2billing/ HTTP/1.1", host: "my.outside.IP"
2018/03/13 12:35:30 [error] 43793#103741: *433 directory index of "/usr/local/www/" is forbidden, client: 38.140.143.226, server: 192.168.5.81, request: "GET / HTTP/1.1", host: "my.ddns"
2018/03/13 15:30:22 [error] 43790#101340: *435 directory index of "/usr/local/www/" is forbidden, client: 216.244.83.210, server: 192.168.5.81, request: "GET / HTTP/1.0"
2018/03/13 17:14:48 [error] 43790#101340: *438 open() "/usr/local/www/wp-includes/SimplePie/ogi.exe" failed (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/SimplePie/ogi.exe HTTP/1.1",$
2018/03/13 17:14:48 [error] 43793#103741: *436 "/usr/local/www/wp-includes/index.html" is not found (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/ HTTP/1.1", host: "my.outside.IP:80"
2018/03/13 17:14:48 [error] 43790#101340: *437 open() "/usr/local/www/wp-includes/js/nri.exe" failed (2: No such file or directory), client: 183.129.160.229, server: 192.168.5.81, request: "GET /wp-includes/js/nri.exe HTTP/1.1", host: "96.234$
2018/03/13 18:14:11 [error] 43793#103741: *439 directory index of "/usr/local/www/" is forbidden, client: 178.73.215.171, server: 192.168.5.81, request: "GET / HTTP/1.0"
2018/03/13 18:25:12 [crit] 43794#103883: *440 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.158, server: 192.168.5.81, request: "GET /nextcloud/apps/files/?dir=/&$
2018/03/13 18:28:35 [crit] 43793#103741: *442 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.30, server: 192.168.5.81, request: "GET /nextcloud/status.php HTTP/1.1$
2018/03/13 18:28:35 [crit] 43793#103741: *444 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.30, server: 192.168.5.81, request: "GET /nextcloud/status.php HTTP/1.1$
2018/03/13 18:29:07 [crit] 43794#103883: *446 connect() to unix:/var/run/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.5.30, server: 192.168.5.81, request: "GET /nextcloud/status.php HTTP/1.1$
I have the Same problem as NasKar. Who can I find the Log of nginx.

Gesendet von meinem GT-N5100 mit Tapatalk
 

stillka

Explorer
Joined
Nov 15, 2014
Messages
55
Hi,
today I updated Owncloud to latest version 10.0.8.5 and I have issue with integrity check, anybody have same issue?

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- core
- INVALID_HASH
- updater/vendor/autoload.php
- updater/vendor/composer/autoload_real.php
- updater/vendor/composer/autoload_static.php
 

Dat LE

Cadet
Joined
May 11, 2018
Messages
3
portsnap fetch extract
make config-recursive install -C /usr/ports/databases/pecl-redis
make config-recursive install -C /usr/ports/devel/pecl-APCu
sysrc 'nginx_enable=YES' 'php_fpm_enable=YES' 'mysql_enable=YES' 'redis_enable=YES'
I got an error Code 1
make config-recursive install -C /usr/ports/databases/pecl-redis
make config-recursive install -C /usr/ports/devel/pecl-APCu
 
Top