お世話になっております。
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.
正直なところ、ミドルウェアの設定については詳しくないので、どの部分で設定がミスっているのか、判断がいまいちつきません。
このような質問はよくないと思いつつ...、どうぞよろしくお願いいたします。
あなたの回答
tips
プレビュー