You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am using Nextcloud on a PHP-FPM with chroot, and I am having trouble maintaining the directory configuration of Nextcloud. That is, with each update, the parameters in the config.php file get messed up.
Hello, I am using Nextcloud on a PHP-FPM with chroot, and I am having trouble maintaining the directory configuration of Nextcloud. That is, with each update, the parameters in the config.php file get messed up.
` 'tempdirectory' => ((php_sapi_name() != 'cli') ? getcwd() . '/../../../tmp/' : '/home/nextcloud.website.com/tmp/'),
'datadirectory' => ((php_sapi_name() != 'cli') ? getcwd() . '/../../../nextclouddata/' : '/home/nextcloud.website.com/nextclouddata/'),
'logfile' => ((php_sapi_name() != 'cli') ? getcwd() . '/../../../nextclouddata/nextcloud.log' : '/home/nextcloud.website.com/nextclouddata/nextcloud.log'),
`
That is, with each update, these parameters are overwritten by the values returned by the function.
My chroot environment looks like this:
`Full directory tree out of chroot: (chroot = /home/nextcloud.website.com)
/home/
├── nextcloud.website.com
│ ├── dev
│ │ ├── null
│ │ ├── random
│ │ ├── urandom
│ │ └── zero
│ ├── etc
│ │ ├── hosts
│ │ ├── resolv.conf
│ │ └── ssl
│ ├── lib
│ │ └── x86_64-linux-gnu
│ ├── nextclouddata (Nexcloud User data)
│ │ ├── appdata_oc1ip557q2ir
│ │ ├── audit.log
│ │ ├── audit.log.1
│ │ ├── User0
│ │ ├── User6
│ │ ├── files_external
│ │ ├── flow.log
│ │ ├── flow.log.1
│ │ ├── User4
│ │ ├── User1
│ │ ├── index.html
│ │ ├── User2
│ │ ├── nextcloud.log
│ │ ├── nextcloud.log.1
│ │ ├── tmp
│ │ ├── updater.log
│ │ ├── updater-oc1ip557q2ir
│ │ └── User3
│ ├── tmp
│ ├── update
│ │ ├── actualizar.sh
│ │ ├── latest.zip
│ │ ├── nextcloud -> ../../nextcloud.website.com/www/nextcloud
│ │ ├── nextcloud-28.0.6.zip.1
│ │ └── old
│ ├── usr
│ │ ├── bin
│ │ ├── lib
│ │ └── share
│ └── www
│ └── nextcloud (web root)
Full directory tree inside chroot:
/
├── dev
│ ├── null
│ ├── random
│ ├── urandom
│ └── zero
├── etc
│ ├── hosts
│ ├── resolv.conf
│ └── ssl
├── lib
│ └── x86_64-linux-gnu
├── nextclouddata (Nexcloud User data)
│ ├── appdata_oc1ip557q2ir
│ ├── audit.log
│ ├── audit.log.1
│ ├── User0
│ ├── User6
│ ├── files_external
│ ├── flow.log
│ ├── flow.log.1
│ ├── User4
│ ├── User1
│ ├── index.html
│ ├── User2
│ ├── nextcloud.log
│ ├── nextcloud.log.1
│ ├── tmp
│ ├── updater.log
│ ├── updater-oc1ip557q2ir
│ └── User3
├── tmp
├── update
│ ├── actualizar.sh
│ ├── latest.zip
│ ├── nextcloud -> ../../nextcloud.website.com/www/nextcloud
│ ├── nextcloud-28.0.6.zip.1
│ └── old
├── usr
│ ├── bin
│ ├── lib
│ └── share
└── www
└── nextcloud (web root)
`
PHP-FPM pool config:
[nextcloud.website.com]
;Privilges config
user = nextcloud.website.com
group = www-data
listen = /run/php/php-nextcloud.website.com.sock
listen.owner = nextcloud.website.com
listen.group = nextcloud.website.com
listen.mode = 0660
listen.acl_users = www-data,nextcloud.website.com
listen.acl_groups = nextcloud.website.com,www-data
;rendimiento
pm = dynamic
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 5
pm.max_requests = 0
;Chroot config
chdir = /
chroot = /home/nextcloud.website.com
php_admin_value[doc_root] = /www
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
; env[PATH] = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
clear_env = no
;hardened PHP settings
php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/php8.1-nextcloud.website.com.log
php_admin_flag[log_errors] = on
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@nextcloud.website.com
php_admin_value[memory_limit] = 1G
php_admin_value[disable_functions] = "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, exec"
php_admin_value[open_basedir] = "/home/nextcloud.website.com/www:/home/nextcloud.website.com/tmp:/usr/share/php:/tmp:/dev/random:/dev/urandom:/www:/nextclouddata:/tmp"
php_admin_value[expose_php] = Off
php_admin_value[sys_temp_dir] = /tmp/
php_admin_value[upload_tmp_dir] = /tmp/
The text was updated successfully, but these errors were encountered: