0

我最近使用 linux plesk onyx 将一个typo3 9lts 实例从托管服务器移动到了根服务器。它似乎工作正常,除了图像虽然在那里但不会渲染。我收到“HTTP/2 403 Forbidden 21ms”错误所以我认为这是权限问题。如果我看一张图片,例如

/fileadmin/_processed_/2/9/csm_typo3-book-backend-login_af97155c7b.png

...并比较路径,我为托管服务器(MS)和根服务器(rs)设置了以下权限:

fileadmin
MS: rwx rwx r-x
RS: rwx r-x r-x 

_processed_
MS: rwx r-x ---
RS: rwx r-x --- 

2
MS: rwx rwx r-x
RS: rwx r-x r-x 

9
MS: rwx rwx r-x
RS: rwx r-x r-x 

csm_typo3-book-backend-login_af97155c7b.png
MS: rw- rw- r--
RS: rw- r-- r--

我需要做什么才能再次渲染图像?如果我需要更改许可,最好的方法是什么?

4

2 回答 2

2

重新渲染图像

您可以使用 InstallTool(维护 › 删除临时资产)重新渲染图像。

权限

您应该考虑适合您的用例的权限概念。

我只是建议我如何做到这一点 - 还有许多其他同样可能的方法。

找出您的网络服务器使用的用户组

# search for php-fpm (or apache, or nginx, ... depending on which process runs PHP when accessed via the web on your server)
sudo ps -o command,user,group -p $(pgrep php-fpm)

将更改文件的用户放入同一组

这可能是您用于部署到服务器的用户,运行 FTP 守护程序的用户,...

sudo usermod -a -G WEBSERVER_GROUP YOUR_USERNAME

在 Web 应用目录上设置用户/组/权限

cd YOUR_APP_ROOT_DIR # e.g. /var/www/my_typo3
sudo chown -R WEBSERVER_USER:WEBSERVER_GROUP .
sudo find . -type f -exec chmod 660 {} \;
sudo find . -type d -exec chmod 2770 {} \;

这也会在目录上设置 setgid 位,这意味着新创建的子目录将具有相同的组。

确保也使用这些权限创建新文件

检查您的用户(或 FTP 守护程序,或...)创建的新文件是否会授予该组的完全权限!

umask
# that should start with 000 - e.g. 0002 is OK, 0007 would be most secure

如果错误(常见:0022),用umask 0002. 最容易持久化的通常是设置在 /etc/profile 或 ~/.bashrc 中。

还要确保 TYPO3 为组提供完整的写入权限并设置 setgid:

# In LocalConfiguration.php: (or wherever you set your TYPO3 configuration):
SYS/fileCreateMask = '0660' # you can ignore the last digit, 0 for maximum security
SYS/folderCreateMask = '2770' # you can ignore the last digit 

检查

注销并重新登录。

umask # should be 000x
groups # should include the webserver group

# create files and folders with your user 
# create files and folders in TYPO3 "File List" module and check permissions

这应该是一个安全的设置,对于遇到权限问题非常有弹性。它允许从 IDE 直接上传。它允许多个用户/守护进程更改文件。

于 2020-06-05T18:27:34.280 回答
0

首先你应该尝试清除TYPO3维护>刷新缓存,删除临时文件,处理文件,授予所需的权限,检查其他问题,然后尝试使用权限修复,后端刷新缓存解决了一段时间的主要问题..

于 2020-06-06T04:43:03.737 回答