如何在 Debian 上为 Prestashop 缓存创建 ramdisc

如何在 Debian 上为 Prestashop 缓存创建 ramdisc

最近,我一直在努力为 Prestashop 缓存文件夹创建具有读写权限的 RAM 磁盘。我使用 Apache + Nginx(作为反向代理)和PHP-FPM 5.6 (即将升级至 7.2)

当我将此缓存装入等/fstab通过使用

tmpfs /var/www/virtual/domain.pl/htdocs/cache/smarty/cache tmpfs defaults,size=768M,mode=0755 0 0

然后运行安装 -a整个商店瘫痪,出现 500 个错误。我可以以 root 身份登录到这个 Debian 驱动的 VPS。

当我输入安装 -l我可以看到我添加的记录:

tmpfs on /var/www/virtual/domain.pl/htdocs/cache/smarty/cache type tmpfs (rw,relatime,size=786432k,mode=0755)

我在 apache 错误日志中发现了这些错误:

 [proxy:error] [pid 29096:tid 140317986412288] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/run/php5-fpm-domain.pl.sock (*) failed
[Mon Aug 10 14:52:37.667220 2020] [proxy_fcgi:error] [pid 29096:tid 140317986412288] [client 66.249.***.***:17018] AH01079: failed to make connection to backend: httpd-UDS

上面的命令有什么问题?或者我应该怎么做才能让它工作?我可以看到它无法写入磁盘,但这是什么原因造成的?

是的,我知道重启后缓存将从 RAM 中删除。

答案1

我发现组和用户没有访问权限,因为它是由 root 创建的,并且 root 是所有者,所以我需要添加:

uid=<user_id_here>, gid=<group_id_here>

紧接着模式参数。

要获取所需组或用户的 ID,您需要输入:

id -u username

或者

id -g groupname

相关内容