简体   繁体   English

Centos7、Apache、Mod Passenger 和 Ruby 2.6.3 上的权限被拒绝

[英]Permission denied on Centos7, Apache, Mod Passenger and Ruby 2.6.3

I never tried working with Cent-OS for hosting my Rails applications.我从未尝试过使用 Cent-OS 来托管我的 Rails 应用程序。 I was using before and now I got a server which is running Cent-OS 7. I installed Apache, Phusion Passenger, RVM, Ruby 2.6.3 and bundle updated the Rails app.我以前使用过,现在我得到了一台运行 Cent-OS 7 的服务器。我安装了 Apache、Phusion Passenger、RVM、Ruby 2.6.3 并捆绑更新了 Rails 应用程序。 Everything was fine up to this.一切都很好。

I added the Virtual-Host and restarted the Apache2 server, I got 403 Forbidden message from the browser.我添加了虚拟主机并重新启动了 Apache2 服务器,我从浏览器收到了 403 Forbidden 消息。

Also I checked the error_log I got the following errors.我还检查了 error_log 我得到了以下错误。

[Tue Feb 11 08:34:14.377938 2020] [core:error] [pid 125490] (13)Permission denied: [client 172.69.78.16:30474] AH00035: access to / denied (filesystem path '/home/santosh/sites') because search permissions are missing on a component of the path
[Tue Feb 11 08:34:14.593925 2020] [core:error] [pid 125490] (13)Permission denied: [client 172.69.78.16:30474] AH00035: access to / denied (filesystem path '/home/santosh/sites') because search permissions are missing on a component of the path

The virtual host:虚拟主机:

<VirtualHost *:80>
        ServerName domain.com.np
        ServerAlias www.domain.com.np
        <IfModule mod_rewrite.c>
                RewriteEngine On
                RewriteCond %{HTTP_HOST} !^www\. [NC]
                RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
        </IfModule>
        # ModPagespeed on
        # Tell Apache and Passenger where your app's 'public' directory is
        DocumentRoot /home/santosh/sites/app/public
        PassengerRuby /home/santosh/.rvm/gems/ruby-2.6.3/wrappers/ruby

        # Relax Apache security settings
        <Directory /home/santosh/sites/app/public>
                Allow from all
                Options -MultiViews
                # Uncomment this if you're on Apache >= 2.4:
                Require all granted
        </Directory>
</VirtualHost>

And the permission of the app directory is as: app目录的权限为:

drwxrwxr-x. 4 santosh santosh        31 May 18  2019 app

I couldn't figure out what I am missing.我无法弄清楚我错过了什么。 Please help me.请帮我。

您是否检查了服务器上的文件夹权限,请尝试在您的文件夹上运行“ls -l”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM