问题:我的应用程序没有启动,我相信是因为apache2启动后 Passenger spawn server 无法正常工作。
以下是apache2启动后的错误
/etc/init.d/apache2开始
tail -f /var/log/myapp/production.log
[ 2019-03-25 15:56:39.6282 15170/7fb14e35c700 age/Cor/CoreMain.cpp:532 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ 2019-03-25 15:56:39.6282 15178/7f11376e1700 age/Ust/UstRouterMain.cpp:422 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ 2019-03-25 15:56:39.6283 15170/7fb153863780 age/Cor/CoreMain.cpp:901 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ 2019-03-25 15:56:39.6284 15178/7f113c972780 age/Ust/UstRouterMain.cpp:492 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ 2019-03-25 15:56:39.6285 15170/7fb14dada700 Ser/Server.h:817 ]: [ServerThr.2] Freed 128 spare client objects
[ 2019-03-25 15:56:39.6286 15170/7fb14dada700 Ser/Server.h:464 ]: [ServerThr.2] Shutdown finished
[ 2019-03-25 15:56:39.6286 15178/7f11376e1700 Ser/Server.h:464 ]: [UstRouter] Shutdown finished
[ 2019-03-25 15:56:39.6286 15178/7f1136ee0700 Ser/Server.h:817 ]: [UstRouterApiServer] Freed 0 spare client objects
[ 2019-03-25 15:56:39.6287 15178/7f1136ee0700 Ser/Server.h:464 ]: [UstRouterApiServer] Shutdown finished
[ 2019-03-25 15:56:39.6288 15170/7fb11effd700 Ser/Server.h:817 ]: [ApiServer] Freed 0 spare client objects
[ 2019-03-25 15:56:39.6289 15170/7fb11effd700 Ser/Server.h:464 ]: [ApiServer] Shutdown finished
[ 2019-03-25 15:56:39.6301 15170/7fb14d258700 Ser/Server.h:817 ]: [ServerThr.3] Freed 128 spare client objects
[ 2019-03-25 15:56:39.6302 15170/7fb14c9d6700 Ser/Server.h:817 ]: [ServerThr.4] Freed 128 spare client objects
[ 2019-03-25 15:56:39.6302 15170/7fb14e35c700 Ser/Server.h:817 ]: [ServerThr.1] Freed 128 spare client objects
[ 2019-03-25 15:56:39.6302 15170/7fb14d258700 Ser/Server.h:464 ]: [ServerThr.3] Shutdown finished
[ 2019-03-25 15:56:39.6302 15170/7fb11ffff700 Ser/Server.h:817 ]: [ServerThr.5] Freed 128 spare client objects
[ 2019-03-25 15:56:39.6303 15170/7fb14c9d6700 Ser/Server.h:464 ]: [ServerThr.4] Shutdown finished
[ 2019-03-25 15:56:39.6303 15170/7fb11ffff700 Ser/Server.h:464 ]: [ServerThr.5] Shutdown finished
[ 2019-03-25 15:56:39.6303 15170/7fb14e35c700 Ser/Server.h:464 ]: [ServerThr.1] Shutdown finished
[ 2019-03-25 15:56:39.6305 15178/7f113c972780 age/Ust/UstRouterMain.cpp:523 ]: Passenger UstRouter shutdown finished
[ 2019-03-25 15:56:39.6305 15170/7fb11f7fe700 Ser/Server.h:817 ]: [ServerThr.6] Freed 128 spare client objects
[ 2019-03-25 15:56:39.6306 15170/7fb11f7fe700 Ser/Server.h:464 ]: [ServerThr.6] Shutdown finished
[ 2019-03-25 15:56:39.6645 15205/7f82ee303780 age/Wat/WatchdogMain.cpp:1291 ]: Starting Passenger watchdog...
[ 2019-03-25 15:56:39.6809 15208/7f7693f84780 age/Cor/CoreMain.cpp:982 ]: Starting Passenger core...
[ 2019-03-25 15:56:39.6812 15208/7f7693f84780 age/Cor/CoreMain.cpp:235 ]: Passenger core running in multi-application mode.
[ 2019-03-25 15:56:39.6867 15208/7f7693f84780 age/Cor/CoreMain.cpp:732 ]: Passenger core online, PID 15208
[ 2019-03-25 15:56:39.7002 15215/7f4b98dd1780 age/Ust/UstRouterMain.cpp:529 ]: Starting Passenger UstRouter...
[ 2019-03-25 15:56:39.7013 15215/7f4b98dd1780 age/Ust/UstRouterMain.cpp:342 ]: Passenger UstRouter online, PID 15215
[ 2019-03-25 15:56:39.7154 15170/7fb153863780 age/Cor/CoreMain.cpp:967 ]: Passenger core shutdown finished
[ 2019-03-25 15:56:41.6136 13822/7fe0ccef7700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /usr/share/myapp: An error occurred while starting up the preloader: it did not write a startup response in time.
Error ID: 1f651915
Error details saved to: /tmp/passenger-error-gY5lcp.html
Message from application: An error occurred while starting up the preloader: it did not write a startup response in time. Please read <a href="https://github.com/phusion/passenger/wiki/Debugging-application-startup-problems">this article</a> for more information about this problem.<br>
<h2>Raw process output:</h2>
(empty)
[ 2019-03-25 15:56:41.6410 13822/7fe0ed2c2700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-20] Cannot checkout session because a spawning error occurred. The identifier of the error is 1f651915. Please see earlier logs for details about the error.
[ 2019-03-25 15:56:41.6415 13822/7fe0ed2c2700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-21] Cannot checkout session because a spawning error occurred. The identifier of the error is 1f651915. Please see earlier logs for details about the error.
[ 2019-03-25 15:56:41.6416 13822/7fe0eca40700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 2-20] Cannot checkout session because a spawning error occurred. The identifier of the error is 1f651915. Please see earlier logs for details about the error.
[ 2019-03-25 15:56:41.6416 13822/7fe0ce7fc700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 6-19] Cannot checkout session because a spawning error occurred. The identifier of the error is 1f651915. Please see earlier logs for details about the error.
PassengerLogLevel 3
[ 2019-03-25 15:56:41.6419 13822/7fe0ed2c2700 Ser/Server.h:817 ]: [ServerThr.1] Freed 128 spare client objects
[ 2019-03-25 15:56:41.6420 13822/7fe0ed2c2700 Ser/Server.h:464 ]: [ServerThr.1] Shutdown finished
[ 2019-03-25 15:56:41.6420 13822/7fe0cf7fe700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 4-20] Cannot checkout session because a spawning error occurred. The identifier of the error is 1f651915. Please see earlier logs for details about the error.
[ 2019-03-25 15:56:41.6422 13822/7fe0cffff700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 3-20] Cannot checkout session because a spawning error occurred. The identifier of the error is 1f651915. Please see earlier logs for details about the error.
[ 2019-03-25 15:56:41.6416 13822/7fe0ceffd700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 5-20] Cannot checkout session because a spawning error occurred. The identifier of the error is 1f651915. Please see earlier logs for details about the error.
[ 2019-03-25 15:56:41.6424 13822/7fe0eca40700 Ser/Server.h:817 ]: [ServerThr.2] Freed 128 spare client objects
[ 2019-03-25 15:56:41.6424 13822/7fe0eca40700 Ser/Server.h:464 ]: [ServerThr.2] Shutdown finished
[ 2019-03-25 15:56:41.6426 13822/7fe0ce7fc700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 6-20] Cannot checkout session because a spawning error occurred. The identifier of the error is 1f651915. Please see earlier logs for details about the error.
[ 2019-03-25 15:56:41.6427 13822/7fe0cffff700 Ser/Server.h:817 ]: [ServerThr.3] Freed 128 spare client objects
[ 2019-03-25 15:56:41.6428 13822/7fe0cffff700 Ser/Server.h:464 ]: [ServerThr.3] Shutdown finished
[ 2019-03-25 15:56:41.6430 13822/7fe0ce7fc700 Ser/Server.h:817 ]: [ServerThr.6] Freed 128 spare client objects
[ 2019-03-25 15:56:41.6431 13822/7fe0ce7fc700 Ser/Server.h:464 ]: [ServerThr.6] Shutdown finished
[ 2019-03-25 15:56:41.6435 13822/7fe0cf7fe700 Ser/Server.h:817 ]: [ServerThr.4] Freed 128 spare client objects
[ 2019-03-25 15:56:41.6435 13822/7fe0ceffd700 Ser/Server.h:817 ]: [ServerThr.5] Freed 128 spare client objects
[ 2019-03-25 15:56:41.6436 13822/7fe0cf7fe700 Ser/Server.h:464 ]: [ServerThr.4] Shutdown finished
[ 2019-03-25 15:56:41.6436 13822/7fe0ceffd700 Ser/Server.h:464 ]: [ServerThr.5] Shutdown finished
[ 2019-03-25 15:56:41.7198 13822/7fe0f27c9780 age/Cor/CoreMain.cpp:967 ]: Passenger core shutdown finished
Apache:2.4
乘机乘客:5.0.30
Debian:9(拉伸)
Ruby框架:Padrino
/etc/apache2/mods-available/passenger.load
LoadModule passenger_module /usr/lib/ruby-flo/lib/ruby/gems/2.1.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby-flo/lib/ruby/gems/2.1.0/gems/passenger-5.0.30
PassengerDefaultRuby /usr/lib/ruby-flo/bin/ruby
PassengerLoadShellEnvvars off
PassengerSpawnMethod smart
</IfModule>
/etc/apache2/sites-available/myapp.conf
PassengerLogLevel 3
PassengerDebugLogFile /var/log/myapp/production.log
PassengerDefaultRuby /usr/bin/ruby-flo
Listen 28850
<VirtualHost *:28850>
AddDefaultCharset utf-8
DocumentRoot /usr/share/myapp/public
PassengerAppRoot /usr/share/myapp
KeepAlive On
KeepAliveTimeout 5
MaxKeepAliveRequests 1000
SetEnv DEPLOY_ENV production
SetEnv PADRINO_ENV production
</VirtualHost>
Listen 28852
<VirtualHost *:28852>
AddDefaultCharset utf-8
DocumentRoot /usr/share/myapp/public
PassengerAppRoot /usr/share/myapp
SSLEngine On
SSLCertificateFile /etc/fk-flo-rubycas-server/ssl/cert.pem
SetEnv SUPPLY_CHAIN_COMPANY b2b
SetEnv FLO_GEM_SERVER http://10.85.147.182/
SetEnv DEPLOY_ENV production
SetEnv PADRINO_ENV production
SetEnv NO_AUTH
SetEnv MULTI
SetEnv INFER_HEADER
SetEnv LDAP_PERM
SetEnv MULTI_TENANCY_ENABLED
SetEnv DISABLE_COMPANY_CHECK
SetEnv BAG_LABEL_MAPPINGS
</VirtualHost>
<Directory /usr/share/myapp/public>
Require all Granted
AllowOverride all
Options -MultiViews
</Directory>
$乘客内存统计信息
Version: 5.0.30
Date : 2019-03-25 16:18:12 +0530
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_IN:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_IN:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US").
---------- Apache processes ----------
PID PPID VMSize Private Name
--------------------------------------
15955 1 98.7 MB 0.5 MB /usr/sbin/apache2 -k start
15990 15955 379.0 MB 0.5 MB /usr/sbin/apache2 -k start
15993 15955 379.0 MB 0.5 MB /usr/sbin/apache2 -k start
### Processes: 3
### Total private dirty RSS: 1.43 MB
-------- Nginx processes --------
### Processes: 0
### Total private dirty RSS: 0.00 MB
----- Passenger processes ------
PID VMSize Private Name
--------------------------------
15958 414.8 MB 0.9 MB Passenger watchdog
15961 1310.1 MB 2.4 MB Passenger core
15969 423.0 MB 0.9 MB Passenger ust-router
### Processes: 3
### Total private dirty RSS: 4.18 MB