【问题标题】:php-fpm + bindfs not workingphp-fpm + bindfs 不工作
【发布时间】:2017-03-21 16:26:31
【问题描述】:

我正在尝试使用 vagrant 设置我的本地 Web 服务器。我的 vagrant 共享文件夹位于我的主文件夹 (~/home/vagrant/www) 中,我想使用 bindfs 将此文件夹挂载到 /var/www 中。

这些是我的虚拟机的规格:

  • Apache/2.4.23 (Ubuntu)
  • PHP 7.0.12
  • Ubuntu 14.04

我正在使用 php-fpm 执行 php 脚本,但使用 bindfs 后,我的网站总是会返回 File not found.

这也是我的虚拟主机配置:

<VirtualHost *:80>
    ServerName project1.dev

    ## Vhost docroot
    DocumentRoot "/var/www/project1/public"

    ## Directories, there should at least be a declaration for /var/www/project1/public

   <Directory "/var/www/project1/public">
       Options Indexes FollowSymlinks MultiViews
       AllowOverride All
       Require all granted

       <FilesMatch "\.php$">
          Require all granted
          SetHandler proxy:fcgi://127.0.0.1:9000
       </FilesMatch>

   </Directory>

   ## Logging
   ErrorLog "/var/log/apache2/av_anhk5lpgjldb_error.log"
   ServerSignature Off
   CustomLog "/var/log/apache2/av_anhk5lpgjldb_access.log" combined

   ## Server aliases 
   ServerAlias www.project1.dev

   ## SetEnv/SetEnvIf for environment variables
   SetEnv APP_ENV dev
   SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

   ## Custom fragment
</VirtualHost>

谁能帮帮我?

【问题讨论】:

    标签: php ubuntu bind apache2.4


    【解决方案1】:

    我设法在我的虚拟机中成功运行 php-fpm + bindfs。我只是确保运行 php-fpm 和 apache 的用户是我在 bindfs 命令中设置的用户。我的 apache 由 www-user 运行,所以我将命令更改为 sudo bindfs -o perms=0755,mirror-only=www-user,force-group=www-data,force-user=www-user /home/vagrant/www /var/www 并确保 apache 也由 www-user 运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-06-19
      • 2018-12-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-12
      • 2015-04-29
      • 1970-01-01
      相关资源
      最近更新 更多