##前提・困っていること
現在RailsアプリをAWS上にデプロイをしたいのですが、EC2のセキュリティグループで詰まっています。
サーバーはデフォルとのPuma使用しています。
下記のように3000番ポートにアクセスできるようにし、bundle exec rails s -b 0.0.0.0で接続できなのですが、
下記のように3000番ポートではなく80番ポートでアクセスできるようにしたのですが接続できません。
またこのとき、rails serverに接続する際のコマンドは3000番ポートに接続したコマンドと同じく
bundle exec rails s -b 0.0.0.0 で接続するのしょうか。
ご教授いただけましたら幸いです。
##追記
$sudo rails s -b 0.0.0.0 -p 80 => Booting Puma => Rails 6.1.2 application starting in development => Run `bin/rails server --help` for more startup options Puma starting in single mode... * Puma version: 5.2.1 (ruby 2.7.2-p137) ("Fettisdagsbulle") * Min threads: 5 * Max threads: 5 * Environment: development * PID: 25060 Exiting Traceback (most recent call last): 39: from bin/rails:2:in `<main>' 38: from bin/rails:2:in `load' 37: from /home/ec2-user/game-bug-app/src/bin/spring:7:in `<top (required)>' 36: from /home/ec2-user/game-bug-app/src/bin/spring:7:in `tap' 35: from /home/ec2-user/game-bug-app/src/bin/spring:10:in `block in <top (required)>' 34: from /home/ec2-user/game-bug-app/src/bin/spring:10:in `require' 33: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `<top (required)>' 32: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/binstub.rb:11:in `load' 31: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/bin/spring:49:in `<top (required)>' 30: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client.rb:30:in `run' 29: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/command.rb:7:in `call' 28: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `call' 27: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/spring-2.1.1/lib/spring/client/rails.rb:28:in `load' 26: from /home/ec2-user/game-bug-app/src/bin/rails:5:in `<top (required)>' 25: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 24: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 23: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 22: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 21: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 20: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-6.1.2/lib/rails/commands.rb:18:in `<main>' 19: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-6.1.2/lib/rails/command.rb:50:in `invoke' 18: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-6.1.2/lib/rails/command/base.rb:69:in `perform' 17: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch' 16: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command' 15: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run' 14: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-6.1.2/lib/rails/commands/server/server_command.rb:135:in `perform' 13: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-6.1.2/lib/rails/commands/server/server_command.rb:135:in `tap' 12: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-6.1.2/lib/rails/commands/server/server_command.rb:144:in `block in perform' 11: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/railties-6.1.2/lib/rails/commands/server/server_command.rb:39:in `start' 10: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:327:in `start' 9: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.2.1/lib/rack/handler/puma.rb:72:in `run' 8: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.2.1/lib/puma/launcher.rb:181:in `run' 7: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.2.1/lib/puma/single.rb:44:in `run' 6: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.2.1/lib/puma/runner.rb:144:in `load_and_bind' 5: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.2.1/lib/puma/binder.rb:152:in `parse' 4: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.2.1/lib/puma/binder.rb:152:in `each' 3: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.2.1/lib/puma/binder.rb:169:in `block in parse' 2: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.2.1/lib/puma/binder.rb:288:in `add_tcp_listener' 1: from /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.2.1/lib/puma/binder.rb:288:in `new' /home/ec2-user/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/puma-5.2.1/lib/puma/binder.rb:288:in `initialize': Permission denied - bind(2) for "0.0.0.0" port 80 (Errno::EACCES)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/03/21 22:19
2021/03/21 22:25
2021/03/21 22:32 編集
2021/03/21 22:35
2021/03/21 22:40