Apacheä¸ã§Railsã¢ããªãåããPassengerã使ã£ã¦ã¿ããï¼ãã®ï¼ï¼
Apacheä¸ã§Redmineãåãããã¨ããã®ã§ãããè¨å®ãªã©ããããé¢åãªã¨ãããããã¾ãã
ã¡ããã©ãPassengerã¨ãããã®ç¥ã£ãã®ã§ã試ãã¦ã¿ããã¨ã«ãã¾ããã
Apache上でRuby on Railsアプリケーションを動かす/Passenger(mod_rails for Apache)の利用 — Redmine.JP
- Apacheåç¬ã§Railsã¢ããªã±ã¼ã·ã§ã³ãå®è¡å¯è½ã§ããApacheã®ã¢ã¸ã¥ã¼ã«ã¨ãã¦å®è£ ããã¦ãããå¥éãã¼ã¢ã³ãèµ·åããå¿ è¦ãããã¾ãããtcpãã¼ãã使ãã¾ããã
- Railsã¢ããªã±ã¼ã·ã§ã³ã®ãããã¤ãç°¡åã«ãªãã¾ãããã¡ã¤ã«ãã¢ãããã¼ãããã ããã»ã¼PHPæè¦ã§ãã
- ãµã¼ãã®ã¡ã¢ãªãç¯ç´ã§ãã¾ããRailsã¤ã³ã¹ã¿ã³ã¹ã¯å¿ è¦ãªã¿ã¤ãã³ã°ã§çæãã¾ããã¾ããä¸å®æéã¢ã¯ã»ã¹ããªããã°ã¤ã³ã¹ã¿ã³ã¹ãçµäºããã¾ãã
Apacheåç¬ã§Railsã¢ããªã±ã¼ã·ã§ã³ãå®è¡ã§ãã¦ããããã¤ãç°¡åã«ãªãã
ããæãã§ããã
ã¤ã³ã¹ãã¼ã«
gemã§ç°¡åã«ã¤ã³ã¹ãã¼ã«ã§ãã¾ãã
# gem install passenger
次ã«Apacheã¢ã¸ã¥ã¼ã«ã®ãã«ãã¨ã¤ã³ã¹ãã¼ã«ããã¾ãã
# passenger-install-apache2-module
対話形å¼ã§å¦çãç¶ãã¾ãã
è¶³ããªãã½ããã¦ã§ã¢ãªã©ãããã¨ãaptçã§ã¤ã³ã¹ãã¼ã«ããããã®ã³ãã³ãã示ãã¦ããã¾ãã
親åã§ããã
* Apache 2 development headers... not found
* Apache Portable Runtime (APR) development headers... not found
* Apache Portable Runtime Utility (APU) development headers... not foundSome required software is not installed.
But don't worry, this installer will tell you how to install them.Press Enter to continue, or Ctrl-C to abort.
- -
Installation instructions for required software
* To install Curl development headers with SSL support:
Please run apt-get install libcurl4-openssl-dev or libcurl4-gnutls-dev, whichever you prefer.* To install Apache 2 development headers:
Please run apt-get install apache2-prefork-dev as root.* To install Apache Portable Runtime (APR) development headers:
Please run apt-get install libapr1-dev as root.* To install Apache Portable Runtime Utility (APU) development headers:
Please run apt-get install libaprutil1-dev as root.
å¿
è¦ãªã½ããã¦ã§ã¢ãã¤ã³ã¹ãã¼ã«ããApacheã¢ã¸ã¥ã¼ã«ããã«ããã¦ããã¨ã³ã³ãã¤ã«ã§ã¨ã©ã¼çºçã
cd /usr/lib/ruby/gems/1.8/gems/passenger-3.0.2/usr/bin/ruby1.8 /usr/bin/rake apache2:clean apache2 RELEASE=yes# /usr/bin/ruby1.8 /usr/bin/rake apache2:clean apache2 RELEASE=yes(in /usr/lib/ruby/gems/1.8/gems/passenger-3.0.2)rm -rf ext/common/libboost_oxt.a ext/common/libboost_oxtrm -rf ext/common/libpassenger_common.a ext/common/libpassenger_commonrm -f agents/PassengerWatchdog agents/PassengerLoggingAgentrm -rf ext/apache2/module_libboost_oxt.a ext/apache2/module_libboost_oxtrm -rf ext/apache2/module_libpassenger_common.a ext/apache2/module_libpassenger_commonrm -rf ext/apache2/Configuration.o ext/apache2/Bucket.o ext/apache2/Hooks.o ext/apache2/mod_passenger.o ext/apache2/mod_passenger.so agents/PassengerHelperAgentmkdir -p ext/apache2/module_libpassenger_commong++ -Iext -Iext/common -Iext/libev -fPIC -fvisibility=hidden -DVISIBILITY_ATTRIBUTE_SUPPORTED -Wno-attributes -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/postgresql -I/usr/include/mysql -DLINUX=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/mysql -I/usr/include/openssl -I/usr/include/postgresql -I/usr/include/xmltok -pthread -I/usr/include/apache2 -D_REENTRANT -I/usr/local/include -DHASH_NAMESPACE="__gnu_cxx" -DHASH_NAMESPACE="__gnu_cxx" -DHASH_FUN_H="
" -DBOOST_SP_USE_PTHREADS -Wall -g -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS -o ext/apache2/module_libpassenger_common/aggregate.o -c ext/apache2/module_libpassenger_common/aggregate.cppIn file included from ext/common/Utils/VariantMap.h:33, from ext/common/AgentBase.h:30, from ext/common/AgentBase.cpp:44,
from ext/apache2/module_libpassenger_common/aggregate.cpp:6:
ext/common/MessageChannel.h: In member function âbool Passenger::MessageChannel::readRaw(void*, unsigned int, long long unsigned int*)â:
ext/common/MessageChannel.h:583: error: âllroundlâ was not declared in this scope
ext/common/MessageChannel.h:590: error: âllroundlâ was not declared in this scope
rake aborted!
Command failed with status (1): [g++ -Iext -Iext/common -Iext/libev -fPIC -...](See full trace by running task with --trace)
ã¨ã©ã¼ã®å
容ããããã¨ãMessageChannel.hä¸ã®llroundlã¨ãã颿°ãæªå®ç¾©ããããã¹ã
llroundlãä½ãã®ã調ã¹ãã¨ãã以ä¸ã®ãããªãã¼ã¸çºè¦ã
C言語関数辞典 - llround, llroundf, llroundl
llroundl 颿°ã¯ï¼long double åã®å¼æ° x ãæãè¿ãæ´æ°å¤ã«ä¸¸ãï¼çµæã long long åã§è¿ãã¾ãï¼å¼æ°ãã¡ããã©ä¸éã«ããå ´åã¯ï¼ãã®æç¹ã®ä¸¸ãæ¹åã«ããããã 0 ããé ãæ¹åãé¸ã³ã¾ãï¼
ãããã忍äºå
¥ã¨ãããã¤ã§ãã
C99ã®math.hã«å
¥ã£ã¦ãã颿°ãããã§ãããg++ã«ã¯å«ã¾ãã¦ãªãã®ãããããªãã§ããã
ä»åã¯çç®±Proã®Debian lennyä¸ã§ã³ã³ãã¤ã«ããããããããããã¨ARMç¨ã®ã³ã³ãã¤ã©ã ã¨å¯¾å¿ãã¦ãªãã£ãã®ããããã¾ããã
ãã ã®å¤ãã¾ãããå¦çã®ãããªã®ã§ãllroundlã使ããªãå½¢å¼ã«MessageChannel.hãæ¸ãæãã¾ããã
- Before
bool readRaw(void *buf, unsigned int size, unsigned long long *timeout = NULL) { if (timeout != NULL) { unsigned long long t = *timeout * 1000; unsigned int ret; try { ret = Passenger::readExact(fd, buf, size, &t); #ifdef __NetBSD__ *timeout = llround((double) t / 1000); #else *timeout = llroundl((long double) t / 1000); #endif return ret == size; } catch (...) { #ifdef __NetBSD__ *timeout = llround((double) t / 1000); #else *timeout = llroundl((long double) t / 1000); #endif throw; } } else { return Passenger::readExact(fd, buf, size) == size; } }
- After
bool readRaw(void *buf, unsigned int size, unsigned long long *timeout = NULL) { if (timeout != NULL) { unsigned long long t = *timeout * 1000; unsigned int ret; try { ret = Passenger::readExact(fd, buf, size, &t); #ifdef __NetBSD__ *timeout = llround((double) t / 1000); #else *timeout = (long long)((long double) t / 1000 + 0.5); #endif return ret == size; } catch (...) { #ifdef __NetBSD__ *timeout = llround((double) t / 1000); #else *timeout = (long long)((long double) t / 1000 + 0.5); #endif throw; } } else { return Passenger::readExact(fd, buf, size) == size; } }
llroundl(hogehoge)ãªã¨ããã(long long)(hogehoge + 0.5)ã«ããã ãã§ããã
ä¸å¿ãããã§ã³ã³ãã¤ã«ã¯ç¡äºéãã¾ããã