Jailkit用户无法执行Nextcloud OCC命令



我有一个新安装的nextcloud 22.2.0,我是根据[这些说明:]1 安装的

NC安装后,我的NC日志中没有任何错误。然而,在概述部分,我有一些基本的磨损,我知道是";假阳性";允许新安装。在那里,我想运行NC occ来修复东西:

./occ integrity:check-core

然而,我得到了这些错误:

Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.
Cannot create "data" directory
This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/22/go.php?to=admin-dir_permissions
Setting locale to en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8 failed
Please install one of these locales on your system and restart your webserver.
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /web/lib/private/Console/Application.php:162
Stack trace:
#0 /web/console.php(98): OCConsoleApplication->loadCommands(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#1 /web/occ(11): require_once('/web/console.ph...')
#2 {main}

我能够解决这个错误:

Setting locale to en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8 failed
Please install one of these locales on your system and restart your webserver.

通过使用:

chattr -i /var/www/clients/client1/web19/
jk_cp -j /var/www/clients/client1/web19/ /usr/lib/locale
chattr +i /var/www/clients/client1/web19/

有人能告诉我如何解决剩下的两个错误,以便NC occ正确工作吗?

感谢

此外,用户的权限是正确的:

# ls -la /var/www/clients/client1/web19 
total 60
drwxr-xr-x 15 root  root    4096 Nov 12 15:12 .
drwxr-xr-x  9 root  root    4096 Nov 12 14:50 ..
lrwxrwxrwx  1 root  root       7 Nov 12 15:09 bin -> usr/bin
drwxr-xr-x  2 web19 client1 4096 Nov 12 14:50 cgi-bin
drwxr-xr-x  2 root  root    4096 Nov 12 17:36 dev
drwxr-xr-x  8 root  root    4096 Nov 12 15:12 etc
drwxr-xr-x  4 root  root    4096 Nov 12 15:12 home
lrwxrwxrwx  1 root  root       7 Nov 12 15:09 lib -> usr/lib
lrwxrwxrwx  1 root  root       9 Nov 12 15:09 lib64 -> usr/lib64
drwxr-xr-x  2 root  root    4096 Nov 12 19:58 log
drwx--x---  2 web19 client1 4096 Nov 12 20:05 private
drwx------  2 web19 client1 4096 Nov 12 15:09 .ssh
drwxr-xr-x  2 root  root    4096 Nov 12 14:55 ssl
drwxrwx---  2 web19 client1 4096 Nov 12 20:09 tmp
drwxr-xr-x  8 root  root    4096 Nov 12 15:09 usr
drwxr-xr-x  4 root  root    4096 Nov 12 15:12 var
drwx--x--x 14 web19 client1 4096 Nov 12 20:09 web
drwx--x---  2 web19 client1 4096 Nov 12 14:50 webdav

我遇到了和您相同的问题,奇怪的是,我为相同的服务使用了相同的用户/客户端。我已经通过以下方式解决了问题(除了您关于"locale"的解决方案之外(。

进入监狱根(/var/www/clients/client1/web19(。这里创建包含PHP内容的目录:

mkdir -p etc/php/7.4/cli/conf.d

将cli的系统范围的php.ini复制到监狱中:

cp -a /etc/php/7.4/cli/php.ini etc/php/7.4/cli/php.ini

"几乎;将系统范围conf中存在的每个文件*.so链接到监狱中。例如:

ln /etc/php/7.4/mods-available/apcu.ini 20-apcu.ini

如果你也有缓存问题(和我一样(,你可以在运行occ之前添加一个定义。我使用以下命令:

runuser -l web19 -c "cd /web; php --define apc.enable_cli=1 ./occ"

一切似乎都很好!:-(

相关内容

  • 没有找到相关文章

最新更新