Rails 6.0.2 App 在 AWS EC2 实例中部署需要什么配置?

问题描述 投票:0回答:1

我有一个AWS EC2实例,我已经在那里部署了我的Rails应用。

RAILS - 6.0.2, Ruby - 2.6.6 & Apache2 + Passenger。

我已经配置了Apache2 & Passenger的根目录,直到rails_apppublic。

我仍然得到这个错误。

AH01797: client denied by server configuration

配置的apache文件在sites-available。

LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
<IfModule mod_passenger.c>
     PassengerRoot /home/ubuntu/.rvm/gems/ruby-2.6.6@default/gems/passenger-6.0.5
     PassengerDefaultRuby /home/ubuntu/.rvm/gems/ruby-2.6.6@default/wrappers/ruby
</IfModule>
<VirtualHost *:80>
    ServerName myserver.com
    DocumentRoot /project/rails_webapp/public
    RailsEnv production
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

  <Directory "/project/rails_webapp/public/">
    AuthType Basic
    AuthName "Restricted Content"
    AuthUserFile /etc/apache2/.htpasswd
    Require valid-user
    Options FollowSymLinks
    Order Allow,Deny
    Deny from all
  </Directory>
</VirtualHost>

对于rails应用:安装了Webpack,yarn,证书等。

有什么建议吗?

amazon-ec2 apache2 ubuntu-16.04 passenger ruby-on-rails-6
1个回答
0
投票

我已经解决了这个问题。这是由于克隆EC2实例而发生的。我们使用了最新版本的Ruby, Rails & Passenger。但在Apache配置中仍然指向旧的乘客版本。

所以重新安装了乘客模块&它解决了这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.