后,我有客运+的Apache +红宝石
[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结束时,我有:(此线后,我得到了乘客安装-Apache2的模块)
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// 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我有:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/2.2.22 (Debian) Server at 146.148.7.236 Port 80
什么可能是一个问题? (如果它很重要,我在Google Developers Console上使用Debian)
我也注意到同样的问题here,但我找不到差异。
UPD: 我的apache.conf结束,其中包含
LoadModule passenger_module
和删除的行现在我有这样的错误:
[email protected]:~$ 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 log with tail -f -n 100 /var/log/apache2/error.log(冷杉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应用/配置/ secrets.yml
删除日志文件,并创建
sudo rm -rf /var/log/apache2/error.log
sudo touch /var/log/apache2/error.log
重启Apache,并有再次出现此错误:
[email protected]:~/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: TRYING: 须藤性向净化中的libapache2-MOD-乘客
命令和apt-get安装的RubyGems建立必要的Apache2-prefork的-dev的libapr1-dev的的libssl-dev的的zlib1g-dev的
sudo的创业板安装乘客
passenger-install-apache2-module
将输出粘贴到apache2的末尾。配置(以上关于乘客前面的行删除)
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的又来了,有阿帕奇消息
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:从的apache.conf 重启Apache
apt-get install libapache2-mod-passenger
删除的LoadModule线 ,仍然有
[email protected]:~/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 -----------
[email protected]:~$ apachectl -t -D DUMP_MODULES|grep -i passenger
-bash: apachectl: command not found
[email protected]:~$ apachectl configtest
-bash: apachectl: command not found
感谢响应!不,$ - 被纳米截断,我更新了我的答案(请参见UPD3) – user1028432 2014-12-05 09:53:31
啊,这几乎使我的答案无用,那么我会发布我的目录设置,看看是否有帮助。 – martincarlin87 2014-12-05 10:00:12