Устанавливаем Nextcloud на Raspberry PI 4 в FreeBSD

Print Friendly, PDF & Email

Задача:

Установить Nextcloud на Raspberry PI 4 в операционной системе FreeBSD

---------------------------------------------------------------

Конечно можно воспользоваться nextcloudpi, это готовый вариант nextcloud для raspberry pi, цель же протестировать работу в системе Freebsd на архитектуре ARM.

root@generic:/home/freebsd # uname -a
FreeBSD generic 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 06:06:55 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC  arm64
root@generic:/home/freebsd #

Другие статьи стоящие внимания перед установкой:

И так установка. Первым делом обновляем сервер до последней версии

root@generic:/home/freebsd # pkg update
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
root@generic:/home/freebsd # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (1 candidates): 100%
Processing candidates (1 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
root@generic:/home/freebsd #

Добавляем нового пользователя с паролем “nextcloud” в системе

freebsd@generic:/home/freebsd # pw useradd ncloud -G wheel
freebsd@generic:/home/freebsd # passwd ncloud
Changing local password for ncloud
New Password:
Retype New Password:
freebsd@generic:/home/freebsd #

Команда su позволяет от имени другого пользователя, не завершая текущий сеанс, выполнять команды

freebsd@generic:/home/freebsd # su ncloud
$ whoami
ncloud
$ su
Password:
root@generic:/home/freebsd #

Проверяем время и временную зону

root@generic:/home/freebsd # date
Fri Apr  9 09:23:15 UTC 2021
root@generic:/home/freebsd #

Также можно использовать параметры, где формат %Z отобразит часовой пояс в буквенном виде, а %z отобразит в числовом:

root@generic:/home/freebsd # date +"%Z %z"
UTC +0000
root@generic:/home/freebsd #

Устанавливаем временную зону. В нашем случае необходимо установить “Берлин”.

root@generic:/home/freebsd # cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime
root@generic:/home/freebsd # date +"%Z %z"
CEST +0200
root@generic:/home/freebsd # date
Fri Apr  9 11:27:38 CEST 2021
root@generic:/home/freebsd #

Синхронизируем время на сервере FreeBSD с сервером точного времени в интернете

root@generic:/home/freebsd # /usr/sbin/ntpdate de.pool.ntp.org
25 Oct 20:55:26 ntpdate[1463]: adjust time server 193.30.121.7 offset -0.001848 sec
root@generic:/home/freebsd # date
Mon Oct 25 20:55:31 CEST 2021
root@generic:/home/freebsd #

Изменяем rc.conf, чтобы время синхронизировалось после перезагрузки сервера

root@generic:/home/freebsd # cat <<EOT >> /etc/rc.conf
? # ntpdate 2021-10-25
? ntpdate_enable="YES"
? ntpdate_program="/usr/sbin/ntpdate"
? ntpdate_flags="-u 1.pool.ntp.org 2.pool.ntp.org"
? EOT
root@generic:/home/freebsd # cat /etc/rc.conf
hostname="generic"
ifconfig_DEFAULT="DHCP"
sshd_enable="YES"
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
growfs_enable="YES"
# ntpdate 2021-10-25
ntpdate_enable="YES"
ntpdate_program="/usr/sbin/ntpdate"
ntpdate_flags="-u 1.pool.ntp.org 2.pool.ntp.org"
root@generic:/home/freebsd #

Конечно можно установить ntpd демон, который будет постоянно использовать ресурсы. Я же решил обойтись CRON с периодическим запуском синхронизации. Можно воспользоваться командой “crontab -e” или выполнить

root@generic:/home/freebsd # echo "# 2021-10-25" >> /etc/crontab
root@generic:/home/freebsd # echo "* */12 * * *     /usr/sbin/ntpdate 1.pool.ntp.org" >> /etc/crontab
root@generic:/home/freebsd # cat /etc/crontab
# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD$
#
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
#
#minute hour    mday    month   wday    who     command
#
# Save some entropy so that /dev/random can re-seed on boot.
*/11    *       *       *       *       operator /usr/libexec/save-entropy
#
# Rotate log files every hour, if necessary.
0       *       *       *       *       root    newsyslog
#
# Perform daily/weekly/monthly maintenance.
1       3       *       *       *       root    periodic daily
15      4       *       *       6       root    periodic weekly
30      5       1       *       *       root    periodic monthly
#
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time.  See adjkerntz(8) for details.
1,31    0-5     *       *       *       root    adjkerntz -a
# 2021-10-25 
* */12 * * *     /usr/sbin/ntpdate 1.pool.ntp.org
root@generic:/home/freebsd #

Так сервер будет каждые три часа синхронизировать время.

Необходимо установить пакеты zip и unzin. Они нам пригодятся в дальнейшем, при распаковке nexcloud

root@generic:/home/freebsd # pkg install zip unzip
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        unzip: 6.0_8
        zip: 3.0_1

Number of packages to be installed: 2

337 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching zip-3.0_1.pkg: 100%  210 KiB 214.9kB/s    00:01
[2/2] Fetching unzip-6.0_8.pkg: 100%  127 KiB 130.1kB/s    00:01
Checking integrity... done (0 conflicting)
[1/2] Installing zip-3.0_1...
[1/2] Extracting zip-3.0_1: 100%
[2/2] Installing unzip-6.0_8...
[2/2] Extracting unzip-6.0_8: 100%
root@generic:/home/freebsd # 

Устанавливаем веб-сервер NGINX

Смотрин доступные пакеты для установки

root@generic:/home/freebsd # pkg search nginx
nginx-1.20.1_3,2               Robust and small WWW server
nginx-devel-1.21.3_2           Robust and small WWW server
nginx-lite-1.20.1_3,2          Robust and small WWW server (lite package)
nginx-naxsi-1.20.1_3,2         Robust and small WWW server (plus NAXSI)
nginx-prometheus-exporter-0.8.0 Prometheus exporter for NGINX and NGINX Plus stats
nginx-ultimate-bad-bot-blocker-4.2020.03.2005_1 Nginx bad bot and other things blocker
nginx-vts-exporter-0.10.7      Server that scraps NGINX vts stats and export them via HTTP
p5-Nginx-ReadBody-0.07_1       Nginx embeded perl module to read and evaluate a request body
p5-Nginx-Simple-0.07_1         Perl 5 module for easy to use interface for Nginx Perl Module
p5-Test-Nginx-0.29             Testing modules for Nginx C module development
py38-certbot-nginx-1.18.0      NGINX plugin for Certbot
rubygem-passenger-nginx-6.0.11 Modules for running Ruby on Rails and Rack applications
root@generic:/home/freebsd #

Устанавливать буду “nginx-naxsi” (NGINX ANTI XSS & SQL INJECTION) – это файрвол веб-приложений (WAF) для NGINX, помогающий в защите от XSS, SQL-инъекций, CSRF, Local & Remote file inclusions. В дальнейшем планирую использовать именно его. Пока не понятно как он поведется себя по нагрузке с разберри, необходимо тестировать.

root@generic:/home/freebsd # pkg install nginx-naxsi
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        nginx-naxsi: 1.20.1_3,2
        pcre: 8.45

Number of packages to be installed: 2

The process will require 7 MiB more space.
1 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching nginx-naxsi-1.20.1_3,2.pkg: 100%  476 KiB 487.9kB/s    00:01
[2/2] Fetching pcre-8.45.pkg: 100%  974 KiB 997.4kB/s    00:01
Checking integrity... done (0 conflicting)
[1/2] Installing pcre-8.45...
[1/2] Extracting pcre-8.45: 100%
[2/2] Installing nginx-naxsi-1.20.1_3,2...
===> Creating groups.
Using existing group 'www'.
===> Creating users
Using existing user 'www'.
[2/2] Extracting nginx-naxsi-1.20.1_3,2: 100%
=====
Message from nginx-naxsi-1.20.1_3,2:

--
Recent version of the NGINX introduces dynamic modules support.  In
FreeBSD ports tree this feature was enabled by default with the DSO
knob.  Several vendor's and third-party modules have been converted
to dynamic modules.  Unset the DSO knob builds an NGINX without
dynamic modules support.

To load a module at runtime, include the new `load_module'
directive in the main context, specifying the path to the shared
object file for the module, enclosed in quotation marks.  When you
reload the configuration or restart NGINX, the module is loaded in.
It is possible to specify a path relative to the source directory,
or a full path, please see
https://www.nginx.com/blog/dynamic-modules-nginx-1-9-11/ and
http://nginx.org/en/docs/ngx_core_module.html#load_module for
details.

Default path for the NGINX dynamic modules is

/usr/local/libexec/nginx.
root@generic:/home/freebsd #

Добавляем nginx в автозагрузку и запускаем

root@generic:/home/freebsd # echo '# nginx 2021-10-25' >> /etc/rc.conf
root@generic:/home/freebsd # echo 'nginx_enable="YES"' >> /etc/rc.conf
root@generic:/home/freebsd # service nginx start
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@generic:/home/freebsd #

Узнаем адрес сервера (конечно мы его уже знаем 😉 ) и проверяем работу nginx

root@generic:/home/freebsd # ifconfig
genet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=68000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        ether e4:5f:01:29:37:0e
        inet 192.168.17.133 netmask 0xffffff00 broadcast 192.168.17.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
root@generic:/home/freebsd #

переходим к установки базы данных

Устанавливаем базу данных MariaDB

Проверяем какие пакеты доступны

root@generic:/home/freebsd # pkg search mariadb
mariadb-connector-c-3.1.10     MariaDB database connector for C
mariadb-connector-odbc-3.1.11  MariaDB database connector for odbc
mariadb103-client-10.3.31_1    Multithreaded SQL database (client)
mariadb103-server-10.3.31_1    Multithreaded SQL database (server)
mariadb104-client-10.4.21_1    Multithreaded SQL database (client)
mariadb104-server-10.4.21_1    Multithreaded SQL database (server)
mariadb105-client-10.5.12_1    Multithreaded SQL database (client)
mariadb105-server-10.5.12_1    Multithreaded SQL database (server)
p5-DBD-MariaDB-1.21            MariaDB driver for the Perl5 Database Interface (DBI)
rubygem-azure_mgmt_mariadb-0.17.4 Microsoft Azure Microsoft Azure MariaDB Library for Ruby Client Library for Ruby
root@generic:/home/freebsd #

Устанавливаем mariadb105-server

root@generic:/home/freebsd # pkg install mariadb105-server
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 18 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        bash: 5.1.8
        boost-libs: 1.72.0_5
        galera26: 26.4.9
        gettext-runtime: 0.21
        icu: 69.1,1
        indexinfo: 0.3.1
        libedit: 3.1.20210216,1
        libiconv: 1.16
        liblz4: 1.9.3,1
        libxml2: 2.9.12
        mariadb105-client: 10.5.12_1
        mariadb105-server: 10.5.12_1
        pcre2: 10.37
        readline: 8.1.1
        rsync: 3.2.3_1
        unixODBC: 2.3.9
        xxhash: 0.8.0
        zstd: 1.5.0

Number of packages to be installed: 18

The process will require 479 MiB more space.
55 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/18] Fetching mariadb105-server-10.5.12_1.pkg: 100%   25 MiB   6.5MB/s    00:04
[2/18] Fetching libxml2-2.9.12.pkg: 100%  750 KiB 767.7kB/s    00:01
[3/18] Fetching bash-5.1.8.pkg: 100%    1 MiB   1.5MB/s    00:01
[4/18] Fetching indexinfo-0.3.1.pkg: 100%    5 KiB   5.4kB/s    00:01
[5/18] Fetching readline-8.1.1.pkg: 100%  336 KiB 343.6kB/s    00:01
[6/18] Fetching gettext-runtime-0.21.pkg: 100%  158 KiB 161.6kB/s    00:01
[7/18] Fetching rsync-3.2.3_1.pkg: 100%  334 KiB 341.7kB/s    00:01
[8/18] Fetching xxhash-0.8.0.pkg: 100%   70 KiB  71.9kB/s    00:01
[9/18] Fetching libiconv-1.16.pkg: 100%  591 KiB 605.1kB/s    00:01
[10/18] Fetching zstd-1.5.0.pkg: 100%  429 KiB 439.3kB/s    00:01
[11/18] Fetching liblz4-1.9.3,1.pkg: 100%  112 KiB 114.4kB/s    00:01
[12/18] Fetching pcre2-10.37.pkg: 100%    1 MiB   1.1MB/s    00:01
[13/18] Fetching libedit-3.1.20210216,1.pkg: 100%  116 KiB 119.3kB/s    00:01
[14/18] Fetching unixODBC-2.3.9.pkg: 100%  396 KiB 405.2kB/s    00:01
[15/18] Fetching mariadb105-client-10.5.12_1.pkg: 100%    2 MiB   1.6MB/s    00:01
[16/18] Fetching galera26-26.4.9.pkg: 100%  706 KiB 722.5kB/s    00:01
[17/18] Fetching boost-libs-1.72.0_5.pkg: 100%   12 MiB   6.4MB/s    00:02
[18/18] Fetching icu-69.1,1.pkg: 100%   10 MiB   5.2MB/s    00:02
Checking integrity... done (0 conflicting)
[1/18] Installing indexinfo-0.3.1...
[1/18] Extracting indexinfo-0.3.1: 100%
[2/18] Installing liblz4-1.9.3,1...
[2/18] Extracting liblz4-1.9.3,1: 100%
[3/18] Installing icu-69.1,1...
[3/18] Extracting icu-69.1,1: 100%
[4/18] Installing readline-8.1.1...
[4/18] Extracting readline-8.1.1: 100%
[5/18] Installing gettext-runtime-0.21...
[5/18] Extracting gettext-runtime-0.21: 100%
[6/18] Installing xxhash-0.8.0...
[6/18] Extracting xxhash-0.8.0: 100%
[7/18] Installing libiconv-1.16...
[7/18] Extracting libiconv-1.16: 100%
[8/18] Installing zstd-1.5.0...
[8/18] Extracting zstd-1.5.0: 100%
[9/18] Installing pcre2-10.37...
[9/18] Extracting pcre2-10.37: 100%
[10/18] Installing libedit-3.1.20210216,1...
[10/18] Extracting libedit-3.1.20210216,1: 100%
[11/18] Installing boost-libs-1.72.0_5...
[11/18] Extracting boost-libs-1.72.0_5: 100%
[12/18] Installing libxml2-2.9.12...
[12/18] Extracting libxml2-2.9.12: 100%
[13/18] Installing bash-5.1.8...
[13/18] Extracting bash-5.1.8: 100%
[14/18] Installing rsync-3.2.3_1...
[14/18] Extracting rsync-3.2.3_1: 100%
[15/18] Installing unixODBC-2.3.9...
[15/18] Extracting unixODBC-2.3.9: 100%
[16/18] Installing mariadb105-client-10.5.12_1...
===> Creating groups.
Creating group 'mysql' with gid '88'.
===> Creating users
Creating user 'mysql' with uid '88'.
===> Creating homedir(s)
[16/18] Extracting mariadb105-client-10.5.12_1: 100%
[17/18] Installing galera26-26.4.9...
[17/18] Extracting galera26-26.4.9: 100%
[18/18] Installing mariadb105-server-10.5.12_1...
===> Creating groups.
Using existing group 'mysql'.
===> Creating users
Using existing user 'mysql'.
===> Creating homedir(s)
[18/18] Extracting mariadb105-server-10.5.12_1: 100%
=====
Message from boost-libs-1.72.0_5:

--
You have built the Boost library with thread support.

Don't forget to add -pthread to your linker options when
linking your code.
=====
Message from mariadb105-client-10.5.12_1:

--
MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
my.cnf. Please move existing my.cnf files from those paths to
/usr/local/etc/mysql or /usr/local/etc. Sample
configuration files are provided in /usr/local/etc/mysql
and /usr/local/etc/mysql/conf.d.
The rc(8) script no longer uses /var/db/mysql/my.cnf for configuration
nor /var/db/mysql for logs and PID-file.

This port does NOT include the mytop perl script, this is included in
the MariaDB tarball but the most recent version can be found in the
databases/mytop port
=====
Message from galera26-26.4.9:

--
Find the Galera Cluster documentation at
http://galeracluster.com/documentation-webpages/
=====
Message from mariadb105-server-10.5.12_1:

--
MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for
my.cnf. Please move existing my.cnf files from those paths to
/usr/local/etc/mysql or /usr/local/etc. Sample
configuration files are provided in /usr/local/etc/mysql
and /usr/local/etc/mysql/conf.d.
The rc(8) script no longer uses /var/db/mysql/my.cnf for configuration
nor /var/db/mysql for logs and PID-file.

This port does NOT include the mytop perl script, this is included in
the MariaDB tarball but the most recent version can be found in the
databases/mytop port
root@generic:/home/freebsd #

Добавляем mariadb в автозагрузку и делаем доступной только с локальной машины

root@generic:/home/freebsd # echo '# mariadb 2021-10-25' >> /etc/rc.conf
root@generic:/home/freebsd # echo 'mysql_enable="YES"' >> /etc/rc.conf
root@generic:/home/freebsd # echo 'mysql_args="--bind-address=127.0.0.1"' >> /etc/rc.conf
root@generic:/home/freebsd # cat /etc/rc.conf
hostname="generic"
ifconfig_DEFAULT="DHCP"
sshd_enable="YES"
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
growfs_enable="YES"
# ntpdate 2021-10-25
ntpdate_enable="YES"
ntpdate_program="/usr/sbin/ntpdate"
ntpdate_flags="-u 1.pool.ntp.org 2.pool.ntp.org"
# nginx 2021-10-25
nginx_enable="YES"
# mariadb 2021-10-25
mysql_enable="YES"
mysql_args="--bind-address=127.0.0.1"
root@generic:/home/freebsd #

запускаем mariadb сервер

root@generic:/home/freebsd # service mysql-server start
Installing MariaDB/MySQL system tables in '/var/db/mysql' ...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is mysql@localhost, it has no password either, but
you need to be the system 'mysql' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo

See the MariaDB Knowledgebase at https://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '/usr/local' ; /usr/local/bin/mysqld_safe --datadir='/var/db/mysql'

You can test the MariaDB daemon with mysql-test-run.pl
cd '/usr/local/mysql-test' ; perl mysql-test-run.pl

Please report any problems at https://mariadb.org/jira

The latest information about MariaDB is available at https://mariadb.org/.
You can find additional information about the MySQL part at:
https://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
Get Involved
Starting mysql. root@generic:/home/freebsd #

Запускаем предварительные настройки (буду использовать пароль: nextcloud)

root@generic:/home/freebsd # mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n]
Enabled successfully!
Reloading privilege tables..
 ... Success!


You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
root@generic:/home/freebsd #

Подключаемся к серверу и создаём базу

CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'nextcloud';
CREATE DATABASE IF NOT EXISTS nextcloud;
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost' IDENTIFIED BY 'nextcloud';
FLUSH privileges;
quit

Должно получиться:

root@generic:/home/freebsd # mysql -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.5.12-MariaDB FreeBSD Ports

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

root@localhost [(none)]> CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'nextcloud';
Query OK, 0 rows affected (0.004 sec)

root@localhost [(none)]> CREATE DATABASE IF NOT EXISTS nextcloud;
Query OK, 1 row affected (0.001 sec)

root@localhost [(none)]> GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost' IDENTIFIED BY 'nextcloud';
Query OK, 0 rows affected (0.006 sec)

root@localhost [(none)]> FLUSH privileges;
Query OK, 0 rows affected (0.002 sec)

root@localhost [(none)]> quit
Bye
root@generic:/home/freebsd #

Устанавливаем PHP версии 8.0

root@generic:/home/freebsd # pkg install php80
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        libargon2: 20190702
        php80: 8.0.11

Number of packages to be installed: 2

The process will require 28 MiB more space.
4 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/2] Fetching php80-8.0.11.pkg: 100%    4 MiB   4.0MB/s    00:01
[2/2] Fetching libargon2-20190702.pkg: 100%   60 KiB  61.6kB/s    00:01
Checking integrity... done (0 conflicting)
[1/2] Installing libargon2-20190702...
[1/2] Extracting libargon2-20190702: 100%
[2/2] Installing php80-8.0.11...
[2/2] Extracting php80-8.0.11: 100%
root@generic:/home/freebsd #

устанавливаем php80-extensions

root@generic:/home/freebsd # pkg install php80-extensions
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 18 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        php80-ctype: 8.0.11
        php80-dom: 8.0.11
        php80-extensions: 1.0
        php80-filter: 8.0.11
        php80-iconv: 8.0.11
        php80-opcache: 8.0.11
        php80-pdo: 8.0.11
        php80-pdo_sqlite: 8.0.11
        php80-phar: 8.0.11
        php80-posix: 8.0.11
        php80-session: 8.0.11
        php80-simplexml: 8.0.11
        php80-sqlite3: 8.0.11
        php80-tokenizer: 8.0.11
        php80-xml: 8.0.11
        php80-xmlreader: 8.0.11
        php80-xmlwriter: 8.0.11
        sqlite3: 3.35.5_3,1

Number of packages to be installed: 18

The process will require 6 MiB more space.
1 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/18] Fetching php80-extensions-1.0.pkg: 100%    1 KiB   1.0kB/s    00:01
[2/18] Fetching php80-session-8.0.11.pkg: 100%   33 KiB  33.8kB/s    00:01
[3/18] Fetching php80-opcache-8.0.11.pkg: 100%  174 KiB 178.5kB/s    00:01
[4/18] Fetching php80-xmlwriter-8.0.11.pkg: 100%   14 KiB  14.0kB/s    00:01
[5/18] Fetching php80-xmlreader-8.0.11.pkg: 100%   13 KiB  12.8kB/s    00:01
[6/18] Fetching php80-dom-8.0.11.pkg: 100%   50 KiB  50.8kB/s    00:01
[7/18] Fetching php80-xml-8.0.11.pkg: 100%   19 KiB  19.6kB/s    00:01
[8/18] Fetching php80-simplexml-8.0.11.pkg: 100%   21 KiB  21.6kB/s    00:01
[9/18] Fetching php80-ctype-8.0.11.pkg: 100%    6 KiB   6.3kB/s    00:01
[10/18] Fetching php80-posix-8.0.11.pkg: 100%   12 KiB  12.6kB/s    00:01
[11/18] Fetching php80-filter-8.0.11.pkg: 100%   19 KiB  19.7kB/s    00:01
[12/18] Fetching php80-tokenizer-8.0.11.pkg: 100%   12 KiB  12.2kB/s    00:01
[13/18] Fetching php80-sqlite3-8.0.11.pkg: 100%   21 KiB  21.0kB/s    00:01
[14/18] Fetching sqlite3-3.35.5_3,1.pkg: 100%  942 KiB 964.8kB/s    00:01
[15/18] Fetching php80-pdo_sqlite-8.0.11.pkg: 100%   12 KiB  12.8kB/s    00:01
[16/18] Fetching php80-pdo-8.0.11.pkg: 100%   44 KiB  45.0kB/s    00:01
[17/18] Fetching php80-iconv-8.0.11.pkg: 100%   17 KiB  17.0kB/s    00:01
[18/18] Fetching php80-phar-8.0.11.pkg: 100%   94 KiB  96.3kB/s    00:01
Checking integrity... done (0 conflicting)
[1/18] Installing php80-dom-8.0.11...
[1/18] Extracting php80-dom-8.0.11: 100%
[2/18] Installing sqlite3-3.35.5_3,1...
[2/18] Extracting sqlite3-3.35.5_3,1: 100%
[3/18] Installing php80-pdo-8.0.11...
[3/18] Extracting php80-pdo-8.0.11: 100%
[4/18] Installing php80-session-8.0.11...
[4/18] Extracting php80-session-8.0.11: 100%
[5/18] Installing php80-opcache-8.0.11...
[5/18] Extracting php80-opcache-8.0.11: 100%
[6/18] Installing php80-xmlwriter-8.0.11...
[6/18] Extracting php80-xmlwriter-8.0.11: 100%
[7/18] Installing php80-xmlreader-8.0.11...
[7/18] Extracting php80-xmlreader-8.0.11: 100%
[8/18] Installing php80-xml-8.0.11...
[8/18] Extracting php80-xml-8.0.11: 100%
[9/18] Installing php80-simplexml-8.0.11...
[9/18] Extracting php80-simplexml-8.0.11: 100%
[10/18] Installing php80-ctype-8.0.11...
[10/18] Extracting php80-ctype-8.0.11: 100%
[11/18] Installing php80-posix-8.0.11...
[11/18] Extracting php80-posix-8.0.11: 100%
[12/18] Installing php80-filter-8.0.11...
[12/18] Extracting php80-filter-8.0.11: 100%
[13/18] Installing php80-tokenizer-8.0.11...
[13/18] Extracting php80-tokenizer-8.0.11: 100%
[14/18] Installing php80-sqlite3-8.0.11...
[14/18] Extracting php80-sqlite3-8.0.11: 100%
[15/18] Installing php80-pdo_sqlite-8.0.11...
[15/18] Extracting php80-pdo_sqlite-8.0.11: 100%
[16/18] Installing php80-iconv-8.0.11...
[16/18] Extracting php80-iconv-8.0.11: 100%
[17/18] Installing php80-phar-8.0.11...
[17/18] Extracting php80-phar-8.0.11: 100%
[18/18] Installing php80-extensions-1.0...
=====
Message from php80-dom-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-dom.ini
=====
Message from php80-pdo-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-pdo.ini
=====
Message from php80-session-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-18-session.ini
=====
Message from php80-opcache-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-10-opcache.ini
=====
Message from php80-xmlwriter-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-xmlwriter.ini
=====
Message from php80-xmlreader-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-30-xmlreader.ini
=====
Message from php80-xml-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-xml.ini
=====
Message from php80-simplexml-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-simplexml.ini
=====
Message from php80-ctype-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-ctype.ini
=====
Message from php80-posix-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-posix.ini
=====
Message from php80-filter-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-filter.ini
=====
Message from php80-tokenizer-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-tokenizer.ini
=====
Message from php80-sqlite3-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-sqlite3.ini
=====
Message from php80-pdo_sqlite-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-30-pdo_sqlite.ini
=====
Message from php80-iconv-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-iconv.ini
=====
Message from php80-phar-8.0.11:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-phar.ini
root@generic:/home/freebsd #

На официальном сайте nextcloud можно найти необходимый минимум для работы

проверить установленные можно командой

root@generic:/home/freebsd # php -m
[PHP Modules]
Core
ctype
date
dom
filter
hash
iconv
json
libxml
mysqlnd
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
Zend OPcache

[Zend Modules]
Zend OPcache

root@generic:/home/freebsd #

Проверяем недостающие и устанавливаем. На примере curl

root@generic:/home/freebsd # pkg search curl
R-cran-RCurl-1.98.1.5          General network client interface for R
R-cran-curl-4.3.2              Modern and Flexible Web Client for R
curl-7.79.1                    Command line tool and library for transferring data with URLs
curlie-1.6.2                   Frontend to cURL that adds the ease of use of HTTPie
curlpp-0.8.1_4                 C++ wrapper for libcurl
flickcurl-1.26_1               C library for the Flickr API
fusefs-curlftpfs-0.9.2_5       Mount remote FTP directories
grpcurl-1.8.2                  Command-line tool that lets you interact with gRPC servers
gstreamer1-plugins-curl-1.16.2 GStreamer curl based output plugin
p5-Net-Curl-0.44               Perl interface for libcurl
p5-WWW-Curl-4.17_4             Perl extension interface for libcurl
php73-curl-7.3.32              The curl shared extension for php
php74-curl-7.4.25              The curl shared extension for php
php80-curl-8.0.12              The curl shared extension for php
py38-pycurl-7.44.1             Python interface to libcurl
rexx-curl-2.1.0                External function package providing an interface to the cURL package
root@generic:/home/freebsd # pkg install php80-curl-8.0.12
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 5 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        ca_root_nss: 3.69_1
        curl: 7.79.1
        libnghttp2: 1.44.0
        libssh2: 1.9.0_3,3
        php80-curl: 8.0.12

Number of packages to be installed: 5

The process will require 6 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/5] Fetching php80-curl-8.0.12.pkg: 100%   33 KiB  33.5kB/s    00:01
[2/5] Fetching curl-7.79.1.pkg: 100%    1 MiB   1.4MB/s    00:01
[3/5] Fetching libnghttp2-1.44.0.pkg: 100%  103 KiB 105.5kB/s    00:01
[4/5] Fetching libssh2-1.9.0_3,3.pkg: 100%  221 KiB 226.0kB/s    00:01
[5/5] Fetching ca_root_nss-3.69_1.pkg: 100%  249 KiB 254.9kB/s    00:01
Checking integrity... done (0 conflicting)
[1/5] Installing libnghttp2-1.44.0...
[1/5] Extracting libnghttp2-1.44.0: 100%
[2/5] Installing libssh2-1.9.0_3,3...
[2/5] Extracting libssh2-1.9.0_3,3: 100%
[3/5] Installing ca_root_nss-3.69_1...
[3/5] Extracting ca_root_nss-3.69_1: 100%
[4/5] Installing curl-7.79.1...
[4/5] Extracting curl-7.79.1: 100%
[5/5] Installing php80-curl-8.0.12...
[5/5] Extracting php80-curl-8.0.12: 100%
=====
Message from ca_root_nss-3.69_1:

--
FreeBSD does not, and can not warrant that the certification authorities
whose certificates are included in this package have in any way been
audited for trustworthiness or RFC 3647 compliance.

Assessment and verification of trust is the complete responsibility of the
system administrator.


This package installs symlinks to support root certificates discovery by
default for software that uses OpenSSL.

This enables SSL Certificate Verification by client software without manual
intervention.

If you prefer to do this manually, replace the following symlinks with
either an empty file or your site-local certificate bundle.

  * /etc/ssl/cert.pem
  * /usr/local/etc/ssl/cert.pem
  * /usr/local/openssl/cert.pem
=====
Message from php80-curl-8.0.12:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-curl.ini
root@generic:/home/freebsd # php -m | grep curl
curl
root@generic:/home/freebsd #

устанавливаем остальные

root@generic:/home/freebsd # pkg install php80-dom php80-filter php80-gd php80-iconv php80-mbstring php80-openssl php80-zip php80-zlib

Настраиваем PHP-FPM

редактируем конфиг php-fpm

root@generic:/home/freebsd # ee /usr/local/etc/php-fpm.d/www.conf

нас интересуют параметры

  • listen = /tmp/php-fpm.sock – указываем что будет работать через сокет
  • listen.owner = www – указываем разрешения
  • listen.group = www – владелец и группа могут быть указаны либо по имени, либо по их числовым идентификаторам.
  • listen.mode = 0660 – владелец и группа имеют права на чтение и запись, остальные не имеют никаких прав

В итоге получаем следующий конфиг

root@generic:/home/freebsd # cat /usr/local/etc/php-fpm.d/www.conf | grep -v '^#' | grep -v '^$' | grep -v '^;'
[www]
user = www
group = www
listen = /tmp/php-fpm.sock
listen.owner = www
listen.group = www
listen.mode = 0660
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
root@generic:/home/freebsd #

проверяем настройки

root@generic:/home/freebsd # php-fpm -t
[25-Oct-2021 22:53:12] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

root@generic:/home/freebsd #

добавляем php-fpm в автозагрузку и запускаем

root@generic:/home/freebsd # sysrc php_fpm_enable=YES
php_fpm_enable:  -> YES
root@generic:/home/freebsd # service php-fpm start
Performing sanity check on php-fpm configuration:
[25-Oct-2021 22:54:14] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Starting php_fpm.
root@generic:/home/freebsd #

Проверяем работу

root@generic:/home/freebsd # sockstat | grep php-fpm
www      php-fpm    1978  6  stream /tmp/php-fpm.sock
www      php-fpm    1977  6  stream /tmp/php-fpm.sock
root     php-fpm    1976  5  stream -> ??
root     php-fpm    1976  7  stream -> ??
root     php-fpm    1976  8  stream /tmp/php-fpm.sock
root@generic:/home/freebsd #

Копируем конфиг php и редактируем

root@generic:/home/freebsd # cp -v /usr/local/etc/php.ini-production /usr/local/etc/php.ini
/usr/local/etc/php.ini-production -> /usr/local/etc/php.ini
root@generic:/home/freebsd # ee /usr/local/etc/php.ini
root@generic:/home/freebsd # 

необходимо изменить

  • memory_limit = 2G
  • upload_max_filesize = 8G

получаем

root@generic:/home/freebsd # cat /usr/local/etc/php.ini | grep -v '^#' | grep -v '^$' | grep -v '^;'
[PHP]
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = -1
disable_functions =
disable_classes =
zend.enable_gc = On
zend.exception_ignore_args = On
zend.exception_string_param_max_len = 0
expose_php = On
max_execution_time = 30
max_input_time = 60
memory_limit = 2G
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 8G
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[CLI Server]
cli_server.color = On
[Date]
[filter]
[iconv]
[imap]
[intl]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.default_socket=
[Phar]
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.cookie_samesite =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 5
[Assertion]
zend.assertions = -1
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[dba]
[opcache]
[curl]
[openssl]
[ffi]
root@generic:/home/freebsd #

Делаем бекап конфига nginx

root@generic:/home/freebsd # cp /usr/local/etc/nginx/nginx.conf /usr/local/etc/nginx/nginx.conf_backup
root@generic:/home/freebsd #

Редактируем /usr/local/etc/nginx/nginx.conf

root@generic:/home/freebsd #
root@generic:/home/freebsd # ee /usr/local/etc/nginx/nginx.conf

содержимое конфига:

worker_processes  1;
events { worker_connections  1024;}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    upstream backend-test {server unix:/tmp/php-fpm.sock;}
    server {
        listen       80;
        server_name  localhost;
        location / {
            root   /usr/local/www/nginx;
            index  index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/local/www/nginx-dist;
        }
      	location ~ \.php$ {
            root   /usr/local/www/nginx-dist;        
 	    fastcgi_pass backend-test;
	    fastcgi_param SCRIPT_FILENAME  /usr/local/www/nginx-dist$fastcgi_script_name;
	    fastcgi_index  index.php;
            include        fastcgi_params;
        }
    }
}

перезапускаем php-fpm и nginx

root@generic:/home/freebsd # service nginx restart
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 10573.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@generic:/home/freebsd # service php-fpm restart
Performing sanity check on php-fpm configuration:
[18-Nov-2021 23:33:39] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Stopping php_fpm.
Waiting for PIDS: 10593.
Performing sanity check on php-fpm configuration:
[18-Nov-2021 23:33:39] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Starting php_fpm.
root@generic:/home/freebsd #

с официального сайта скачиваем установочный файл

root@generic:/home/freebsd # fetch https://download.nextcloud.com/server/installer/setup-nextcloud.php -o /usr/local/www/nginx/setup-nextcloud.php
/usr/local/www/nginx/setup-nextcloud.php               154 kB 1358 kBps    00s
root@generic:/home/freebsd #

открываем браузере ссылку

Ошибка на следующем шаге

Dependency check

Dependencies not found.
Can’t write to the current directory. Please fix this by giving the webserver user write access to the directory.

устанавливаем необходимые права на папку nginx

root@generic:/home/freebsd # ls -lh /usr/local/www/
total 4
lrwxr-xr-x  1 root  wheel    25B Oct 25 21:47 nginx -> /usr/local/www/nginx-dist
dr-xr-xr-x  2 root  wheel   512B Nov 18 23:27 nginx-dist
root@generic:/home/freebsd # 
root@generic:/home/freebsd # chown www /usr/local/www/nginx-dist
root@generic:/home/freebsd # ls -lh /usr/local/www/
total 4
lrwxr-xr-x  1 root  wheel    25B Oct 25 21:47 nginx -> /usr/local/www/nginx-dist
drwxrwxrwx  2 www   wheel   512B Nov 18 23:27 nginx-dist
root@generic:/home/freebsd # chmod 750 /usr/local/www/nginx-dist
root@generic:/home/freebsd # ls -lh /usr/local/www/
total 4
lrwxr-xr-x  1 root  wheel    25B Oct 25 21:47 nginx -> /usr/local/www/nginx-dist
drwxr-x---  2 www   wheel   512B Nov 18 23:27 nginx-dist
root@generic:/home/freebsd #
root@generic:/home/freebsd # fetch https://download.nextcloud.com/server/installer/setup-nextcloud.php -o /usr/local/www/nginx-dist/setup-nextcloud.php
/usr/local/www/nginx-dist/setup-nextcloud.php          154 kB 1347 kBps    00s
root@generic:/home/freebsd #

переходим к веб интерфейсу

Вместо “nextcloud” я поставил точку, чтобы установить в корневой каталог. После недолгого зависания на странице, установка завершилась ошибкой.

Error

Nextcloud is NOT installed
The selected folder seems to already contain a Nextcloud installation. – You cannot use this script to update existing installations.

Удаляем всё из папки и повторяем установку

root@generic:/home/freebsd # rm -rf /usr/local/www/nginx-dist/
root@generic:/home/freebsd # ls -lh /usr/local/www/nginx-dist/
ls: /usr/local/www/nginx-dist/: No such file or directory
root@generic:/home/freebsd #
root@generic:/home/freebsd # fetch https://download.nextcloud.com/server/installer/setup-nextcloud.php -o /usr/local/www/nginx-dist/setup-nextcloud.php
/usr/local/www/nginx-dist/setup-nextcloud.php          154 kB 1347 kBps    00s
root@generic:/home/freebsd #

Доступен только SQLite. Установите и активируйте дополнительные модули PHP для возможности выбора других типов баз данных.

root@generic:/usr/local/www/nginx-dist # pkg install php80-pdo_mysql
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        php80-pdo_mysql: 8.0.12

Number of packages to be installed: 1

16 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching php80-pdo_mysql-8.0.12.pkg: 100%   16 KiB  16.3kB/s    00:01
Checking integrity... done (0 conflicting)
[1/1] Installing php80-pdo_mysql-8.0.12...
[1/1] Extracting php80-pdo_mysql-8.0.12: 100%
=====
Message from php80-pdo_mysql-8.0.12:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-30-pdo_mysql.ini
root@generic:/usr/local/www/nginx-dist # service nginx restart
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 10685.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.
root@generic:/usr/local/www/nginx-dist # service php-fpm restart
Performing sanity check on php-fpm configuration:
[19-Nov-2021 00:23:56] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Stopping php_fpm.
Waiting for PIDS: 10646.
Performing sanity check on php-fpm configuration:
[19-Nov-2021 00:23:56] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

Starting php_fpm.
root@generic:/usr/local/www/nginx-dist #

Исправить ошибку установки, можно указав 127.0.0.1

Error while trying to create admin user: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory

Помогла статья? Есть возможность отблагодарить автора

QR Link:

QR Code

Читайте также:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *