Answer the question
In order to leave comments, you need to log in
nginx + php-fpm + chroot + symlink = brokenlink?
Good day.
The environment is generally standard:
Ubuntu with nginx on board. Which works with php-fpm which in turn is locked in its own cage and works through the chroot parameter, each host from its own user.
Chroot-path: /home/www/vhostdata/example.dev/
The project itself is in /home/www/vhostdata/example.dev/home/htdocks/
but for a chrooted user, this path looks like - /home/htdocks/
Hence the problem.
In my case it is yii framework. Assets Manager creates symlinks based on the chroot.
That is - nginx goes to /home/www/vhostdata/example.dev/home/htdocks/web/assets and sees the following there:
lrwxrwxrwx 1 example.dev example.dev 39 дек. 24 00:37 509ca038 -> /home/htdocks/web/themes/default/assets
lrwxrwxrwx 1 example.dev example.dev 64 дек. 24 00:37 5d465bfb -> /home/htdocks/web/protected/vendors/framework/zii/widgets/assets
lrwxrwxrwx 1 example.dev example.dev 55 дек. 24 00:37 7b30adf2 -> /home/htdocks/web/protected/extensions/bootstrap/assets
lrwxrwxrwx 1 example.dev example.dev 59 дек. 24 00:37 a0ef63b0 -> /home/htdocks/web/protected/vendors/framework/web/js/source
lrwxrwxrwx 1 example.dev example.dev 56 дек. 24 00:37 f5a86c4c -> /home/htdocks/web/protected/extensions/highcharts/assets
ln -s ../web/assets 7b30adf2
Answer the question
In order to leave comments, you need to log in
Try using hardlinks.
ln ЦЕЛЬ ИМЯ_ССЫЛКИ
По умолчанию создаются жёсткие ссылки
from mana ubunta on ln
-d, -F, --directory
allow the superuser to attempt to hard link directories (note: will probably fail due to system restrictions, even for the superuser)
And from what it follows that the problem is in Yii? I have a whole bunch of Yii installations running in chroots and everything works without problems. But Yii 1.1.14 does not create a symlink in assets.
the problem is not in yii. and I already mentioned it 2 times.
Specifically, you may not have set the option in yii protected/config/main.php
'assetManager' => array(
'class' => 'CAssetManager',
'linkAssets' => true
),
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question