Jailkit 用户无法执行 Nextcloud OCC 命令
Jailkit User Cannot Execute Nextcloud OCC Commands
我根据 [these instructions:]1
全新安装了 nextcloud 22.2.0
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): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#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
我遇到了与您相同的问题,奇怪的是,我对相同的服务使用相同的 user/client。
我已经通过以下方式解决了(除了你关于“语言环境”的解决方案)。
进入监狱根目录 (/var/www/clients/client1/web19
)。这里创建包含 PHP 内容的目录:
mkdir -p etc/php/7.4/cli/conf.d
复制 system-wide php.ini for cli 到 jail:
cp -a /etc/php/7.4/cli/php.ini etc/php/7.4/cli/php.ini
“几乎”link 每个文件 *.so 存在于 system-wide conf 中。例如:
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"
...似乎一切正常! :-)
我根据 [these instructions:]1
全新安装了 nextcloud 22.2.0NC 安装后,我的 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): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#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
我遇到了与您相同的问题,奇怪的是,我对相同的服务使用相同的 user/client。 我已经通过以下方式解决了(除了你关于“语言环境”的解决方案)。
进入监狱根目录 (/var/www/clients/client1/web19
)。这里创建包含 PHP 内容的目录:
mkdir -p etc/php/7.4/cli/conf.d
复制 system-wide php.ini for cli 到 jail:
cp -a /etc/php/7.4/cli/php.ini etc/php/7.4/cli/php.ini
“几乎”link 每个文件 *.so 存在于 system-wide conf 中。例如:
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"
...似乎一切正常! :-)