質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Q&A

0回答

1130閲覧

Vagrantにて、Apacheを利用したRailsアプリをpassengerを利用してセットアップしたい

yakumomutsuki

総合スコア12

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Apache

Apacheは、Apache HTTP Serverの略で、最も人気の高いWebサーバソフトウェアの一つです。安定性が高いオープンソースソフトウェアとして商用サイトから自宅サーバまで、多くのプラットフォーム向けに開発・配布されています。サーバーソフトウェアの不具合(NCSA httpd)を修正するパッチ(a patch)を集積、一つ独立したソフトウェアとして開発されました。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

0グッド

0クリップ

投稿2020/04/26 13:54

お世話になっております。
Railsを利用した際、Webアプリケーション公開用にApacheを利用しようと思い、passengerを利用するとRailsが使えるとのことで、CentOS + Rails + Apache + Passenger の構成でWebアプリケーションの設定を行っておりますが、どうにもうまくいきませんのでご助言いただければと思います。

開発環境

  • CentOS Linux release 7.7.1908 (Core)
  • ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
  • Rails 6.0.2.2

以下のコマンドを実行

/home/vagrant/.rbenv/versions/2.6.5/bin/ruby /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/passenger-6.0.4/bin/passenger-install-apache2-module --apxs2-path='/usr/bin/apxs'

Almost there! Please edit your Apache configuration file, and add these lines: LoadModule passenger_module /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/passenger-6.0.4/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/passenger-6.0.4 PassengerDefaultRuby /home/vagrant/.rbenv/versions/2.6.5/bin/ruby </IfModule> After you restart Apache, you are ready to deploy any number of web applications on Apache, with a minimum amount of configuration! Press ENTER when you are done editing. -------------------------------------------- Validating installation... * Checking whether this Passenger install is in PATH... (!) Please add /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/passenger-6.0.4/bin to PATH. Otherwise you will get "command not found" errors upon running any Passenger commands. Learn more at about PATH at: https://www.phusionpassenger.com/library/indepth/environment_variables.html#the-path-environment-variable * Checking whether there are no other Passenger installations... (!) You are currently validating against Phusion Passenger 6.0.4, located in: /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/passenger-6.0.4/bin/passenger Besides this Passenger installation, the following other Passenger installations have also been detected: /home/vagrant/.rbenv/shims/passenger Please uninstall these other Passenger installations to avoid confusion or conflicts. * Checking whether Apache is installed... ✓ * Checking whether the Passenger module is correctly configured in Apache... ✗ Your Apache installation might be broken You are about to validate Phusion Passenger against the following Apache installation: apxs2 : /usr/bin/apxs Executable: /usr/sbin/httpd Version : 2.4.6 However, this Apache installation appears to be broken, so this program cannot continue. To find out why this program thinks the above Apache installation is broken, run: export ORIG_PATH="$PATH" sudo -s -E export PATH="$ORIG_PATH" /home/vagrant/.rbenv/versions/2.6.5/bin/ruby /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/passenger-6.0.4/bin/passenger-config --detect-apache2 Detected 1 error(s), 2 warning(s). Please solve the above issues, then press ENTER to continue. -------------------------------------------- Deploying a web application To learn how to deploy a web app on Passenger, please follow the deployment guide: https://www.phusionpassenger.com/library/deploy/apache/deploy/ Enjoy Phusion Passenger, a product of Phusion® (www.phusion.nl) :-) https://www.phusionpassenger.com Passenger® is a registered trademark of Phusion Holding B.V.

Apacheが起動したないので、なぜなのか確認はしてみるものの...

[root@localhost vagrant]# sudo systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since 日 2020-04-26 13:50:21 UTC; 7s ago Docs: man:httpd(8) man:apachectl(8) Process: 31389 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE) Process: 31388 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE) Main PID: 31388 (code=exited, status=1/FAILURE) 4月 26 13:50:21 localhost.localdomain systemd[1]: Starting The Apache HTTP Server... 4月 26 13:50:21 localhost.localdomain httpd[31388]: httpd: Syntax error on line 353 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.d/passenger.conf: Cannot load /home/vagrant/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/passenger-6.0.4/buildout/apach... 4月 26 13:50:21 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE 4月 26 13:50:21 localhost.localdomain kill[31389]: kill: cannot find process "" 4月 26 13:50:21 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 4月 26 13:50:21 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server. 4月 26 13:50:21 localhost.localdomain systemd[1]: Unit httpd.service entered failed state. 4月 26 13:50:21 localhost.localdomain systemd[1]: httpd.service failed. Hint: Some lines were ellipsized, use -l to show in full.

正直なところ、ミドルウェアの設定については詳しくないので、どの部分で設定がミスっているのか、判断がいまいちつきません。
このような質問はよくないと思いつつ...、どうぞよろしくお願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問