走った後
sudo service apache2 restart
私は持っている
[Thu Dec 04 15:30:37 2014] [warn] module passenger_module is already loaded, skipping
Syntax error on line 274 of /etc/apache2/apache2.conf:
Invalid command 'PassengerDefaultRuby', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
failed!
apache.conf の最後に: (この行は、passenger-install-apache2-module の後に取得しました)
LoadModule passenger_module /home/ruslan/.rvm/gems/r$
<IfModule mod_passenger.c>
PassengerRoot /home/ruslan/.rvm/gems/ruby-2.1.5/gem$
PassengerDefaultRuby /home/ruslan/.rvm/gems/ruby-2.$
</IfModule>
/etc/apache2/mods-available/passenger.conf :
<VirtualHost *:80>
ServerName www.rackexample.com
DocumentRoot /home/ruslan/blog/public
<Directory /home/ruslan/blog/public>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>
</VirtualHost>
/etc/apache2/sites-enabled/mysite には同じものがあります:
<VirtualHost *:80>
ServerName www.rackexample.com
DocumentRoot /home/ruslan/blog/public
<Directory /home/ruslan/blog/public>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>
</VirtualHost>
また、uri を開くと、次のようになります。
内部サーバーエラー
サーバーで内部エラーまたは構成ミスが発生したため、リクエストを完了できませんでした。
サーバー管理者 [アドレスなし] に連絡して、エラーが発生した時刻と、エラーの原因となった可能性のある操作を知らせてください。
このエラーの詳細については、サーバー エラー ログを参照してください。
146.148.7.236 ポート 80 の Apache/2.2.22 (Debian) サーバー
何が問題になる可能性がありますか?(重要な場合は、Google Developers Console で Debian を使用しています)
ここでも同じ問題に気付きましたが、違いが見つかりません。
UPD: apache.conf の末尾にある行を削除しました。
LoadModule passenger_module
そして今、私はこのエラーがあります:
ruslan@olga-blog:~$ sudo service apache2 restart
Syntax error on line 273 of /etc/apache2/apache2.conf:
Invalid command 'PassengerDefaultRuby', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
failed!
したがって、Apache ログの最後に tail -f -n 100 /var/log/apache2/error.log ( Fir 05 - 今日なので、最新のログ) が表示されます。
[Fri Dec 05 03:00:07 2014] [error] [client 180.153.195.33] Premature end of script headers:
[Fri Dec 05 03:20:20 2014] [error] [client 76.14.162.37] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /tmUnblock.cgi
App 10140 stderr: [ 2014-12-05 03:46:21.5488 10221/0x00000000e1d2f0(Worker 1) utils.rb:84 ]: *** Exception RuntimeError in Rack application object (Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`) (process 10221, thread 0x00000000e1d2f0(Worker 1)):
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.8/lib/rails/application.rb:462:in `validate_secret_key_config!'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.8/lib/rails/application.rb:195:in `env_config'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.8/lib/rails/engine.rb:510:in `call'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.8/lib/rails/application.rb:144:in `call'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
[Fri Dec 05 03:46:21 2014] [error] [client 180.153.196.169] Premature end of script headers:
App 10140 stderr: [ 2014-12-05 04:26:21.9010 10221/0x00000000e1d2f0(Worker 1) utils.rb:84 ]: *** Exception RuntimeError in Rack application object (Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`) (process 10221, thread 0x00000000e1d2f0(Worker 1)):
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.8/lib/rails/application.rb:462:in `validate_secret_key_config!'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.8/lib/rails/application.rb:195:in `env_config'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.8/lib/rails/engine.rb:510:in `call'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/railties-4.1.8/lib/rails/application.rb:144:in `call'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
App 10140 stderr: from /home/ruslan/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
[Fri Dec 05 04:26:21 2014] [error] [client 171.13.14.23] Premature end of script headers:
UPD2: my_app/config/secrets.yml に秘密鍵を追加しました
ログファイルを削除して作成する
sudo rm -rf /var/log/apache2/error.log
sudo touch /var/log/apache2/error.log
Apache を再起動すると、次のエラーが再び表示されます。
ruslan@olga-blog:~/blog$ sudo service apache2 restart
Syntax error on line 273 of /etc/apache2/apache2.conf:
Invalid command 'PassengerDefaultRuby', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
failed!
ログは空です
tail -f -n 100 /var/log/apache2/error.log
UPD3: 試行中
: sudo aptitude purge libapache2-mod-passenger
sudo apt-get install rubygems build-essential apache2-prefork-dev libapr1-dev libssl-dev zlib1g-dev
sudo gem install Passenger
-install-apache2-module
出力を貼り付けますapache2.conf の終わり (上記のパッセンジャーに関する前の行は削除されました)
LoadModule passenger_module /home/ruslan/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53/buildout/apache2/mod$
<IfModule mod_passenger.c>
PassengerRoot /home/ruslan/.rvm/gems/ruby-2.1.5/gems/passenger-4.0.53
PassengerDefaultRuby /home/ruslan/.rvm/gems/ruby-2.1.5/wrappers/ruby
</IfModule>
Apache を再起動し、Apache メッセージが表示される
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
なんで?
UPD4
sudo nano /etc/apache2/mods-available/passenger.conf
空っぽに見える、なぜ?
UPD5:
apt-get install libapache2-mod-passenger
LoadModule の行を apache.conf から削除して、apache を再起動してもまだ
ruslan@olga-blog:~/blog$ sudo service apache2 restart
Syntax error on line 273 of /etc/apache2/apache2.conf:
Invalid command 'PassengerDefaultRuby', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
failed!
UPD6:コマンド sudo パッセンジャー ステータスは次のように表示されます。
Version : 4.0.53
Date : Fri Dec 05 10:34:32 +0000 2014
Instance: 1021
----------- General information -----------
Max pool size : 6
Processes : 0
Requests in top-level queue : 0
----------- Application groups -----------
ruslan@olga-blog:~$ apachectl -t -D DUMP_MODULES|grep -i passenger
-bash: apachectl: command not found
ruslan@olga-blog:~$ apachectl configtest
-bash: apachectl: command not found