³¹¤ËÂԤä¿¡£¡£¡¡Passenger ( Mod_rails For Apache ) !!

ÂÔ¤Á¤ËÂԤä¿ Mod_Rails for apache¡¡ ( modrails )¡Á
´ò¤·¤¤¤Î¤ÇÁᮥ¤¥ó¥¹¥È¡¼¥ë¤ò¤·¤Æ¤ß¤ë¤³¤È¤Ë¡£

¤È¤ê¤¢¤¨¤º²¾ÁÛ¥Þ¥·¥ó¤ÇºÇ¾®¸Â¹½À®¤Î¥Þ¥·¥ó¤ò¹½ÃÛ¤¹¤ë¡£OS¤ÏFedoara

ɬÍפÊCGI¤Ê¤É¤ò¥¤¥ó¥¹¥È¡¼¥ë¡£ImageMagick¤Ê¤É¤â¤Ä¤¤¤Ç¤Ë¤¤¤ì¤Æ¤·¤Þ¤¦¡£

yum install ruby ruby-devel rubygems ImageMagick ImageMagick-devel ruby-mysql¡¡httpd



¤Ä¤Å¤¤¤ÆGem¤ÇɬÍפ˥ѥ屡¼¥¸¤Î¥¤¥ó¥¹¥È¡¼¥ë¡£

gem install rails -y
gem install passenger



¢­¥í¥°


[root@mod_rails_test /]# gem install rails -y
Successfully installed rails-2.0.2
Successfully installed rake-0.8.1
Successfully installed activesupport-2.0.2
Successfully installed activerecord-2.0.2
Successfully installed actionpack-2.0.2
Successfully installed actionmailer-2.0.2
Successfully installed activeresource-2.0.2
Installing ri documentation for rake-0.8.1...
Installing ri documentation for activesupport-2.0.2...
Installing ri documentation for activerecord-2.0.2...
Installing ri documentation for actionpack-2.0.2...
Installing ri documentation for actionmailer-2.0.2...
Installing ri documentation for activeresource-2.0.2...
Installing RDoc documentation for rake-0.8.1...
Installing RDoc documentation for activesupport-2.0.2...
Installing RDoc documentation for activerecord-2.0.2...
Installing RDoc documentation for actionpack-2.0.2...
Installing RDoc documentation for actionmailer-2.0.2...
Installing RDoc documentation for activeresource-2.0.2...
[root@mod_rails_test /]# gem install passenger
Install required dependency fastthread? [Yn] Y
Select which gem to install for your platform (i386-linux)
1. fastthread 1.0.1 (mswin32)
2. fastthread 1.0.1 (ruby)
3. Skip this gem
4. Cancel installation
> 2
Building native extensions. This could take a while...
Install required dependency rspec? [Yn] Y
Building native extensions. This could take a while...
Successfully installed passenger-1.0.1
Successfully installed fastthread-1.0.1
Successfully installed rspec-1.1.3
Installing ri documentation for passenger-1.0.1...
Installing ri documentation for fastthread-1.0.1...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump
Installing ri documentation for rspec-1.1.3...
Installing RDoc documentation for passenger-1.0.1...
Installing RDoc documentation for fastthread-1.0.1...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:25: warning: already initialized constant FONTS
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:235: warning: already initialized constant STYLE
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:246: warning: already initialized constant XHTML_PREAMBLE
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:289: warning: already initialized constant HEADER
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:310: warning: already initialized constant FOOTER
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:335: warning: already initialized constant FILE_PAGE
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:384: warning: already initialized constant CLASS_PAGE
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:604: warning: already initialized constant METHOD_LIST
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:621: warning: already initialized constant BODY
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:640: warning: already initialized constant SRC_PAGE
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:649: warning: already initialized constant FR_INDEX_BODY
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:675: warning: already initialized constant FILE_INDEX
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:677: warning: already initialized constant CLASS_INDEX
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:678: warning: already initialized constant METHOD_INDEX
/usr/lib/ruby/1.8/rdoc/generators/template/html/html.rb:704: warning: already initialized constant INDEX
Installing RDoc documentation for rspec-1.1.3...
[root@mod_rails /]#



¥¤¥ó¥¹¥È¡¼¥ë¥¬¥¤¥É¤Ë±è¤Ã¤Æ°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¡£

passenger-install-apache2-module


¤¹¤ë¤È¡¢¡¢


[root@mod_rails /]# passenger-install-apache2-module
Welcome to the Passenger Apache 2 module installer.

This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.

Here's what you can expect from the installation process:

1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.

Checking for required software...

* GNU C++ compiler... found at /usr/bin/g++
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at /usr/bin/rake
* Apache 2... found at /usr/sbin/httpd
* Apache 2 development headers... not found
* Apache Portable Runtime (APR) development headers... not found
* fastthread... found

Some 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 Apache 2 development headers:
Please run yum install httpd-devel as root.

* To install Apache Portable Runtime (APR) development headers:
Please run yum install apr-devel as root.

[root@mod_rails /]#




¤´ÃúÇ«¤Ë¤Á¤ã¤ó¤ÈYUM¥³¥Þ¥ó¥É¤Ç½Ð¤·¤Æ¤¯¤ì¤ë¡£
¤Ê¤ó¤Ç»Ø¼¨Ä̤ꡢ¥Ñ¥Ã¥±¡¼¥¸Äɲ乤롣

yum install httpd-devel apr-devel



¥Ñ¥Ã¥±¡¼¥¸¤Î¥¤¥ó¥¹¥È¡¼¥ë¤¬½ª¤ï¤Ã¤¿°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¡£

passenger-install-apache2-module




[root@mod_rails /]# passenger-install-apache2-module
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Welcome to the Passenger Apache 2 module installer.

This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.

Here's what you can expect from the installation process:

1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.

Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.

Press Enter to continue, or Ctrl-C to abort.

Checking for required software...

* GNU C++ compiler... found at /usr/bin/g++
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at /usr/bin/rake
* Apache 2... found at /usr/sbin/httpd
* Apache 2 development headers... found at /usr/sbin/apxs
* Apache Portable Runtime (APR) development headers... found
* fastthread... found
--------------------------------------------
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

--------------------------------------------
Compiling and installing Apache 2 module...
cd /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1
rake clean apache2
(in /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ja_JP.eucJP"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
### In ext/apache2:
rm -rf Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o mod_passenger.so

rm -r pkg
### In ext/passenger:
make clean
rm -f Makefile

### In ext/boost/src:
rm -f libboost_thread.a *.o

### In test:
rm -f Apache2ModuleTests *.o

### In benchmark:
rm -f DummyRequestHandler

### In ext/boost/src:
g++ -O2 -fPIC -I../.. -D_REENTRANT -DNDEBUG -c *.cpp
ar cru libboost_thread.a *.o
ranlib libboost_thread.a

### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -I.. -c mod_passenger.c

### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -I.. -c Utils.cpp

### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -I.. -c Logging.cpp

### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -I.. -c Configuration.cpp

### In ext/apache2:
g++ -D_REENTRANT -Wall -g -I/usr/local/include -fPIC -g -DPASSENGER_DEBUG -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/apr-1 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/httpd -I.. -c Hooks.cpp

### In ext/apache2:
g++ -shared Utils.o Logging.o Configuration.o Hooks.o mod_passenger.o -fPIC -o mod_passenger.so -lstdc++ -lpthread ../boost/src/libboost_thread.a -laprutil-1 -lldap -llber -ldb-4.3 -lexpat -lapr-1 -luuid -lcrypt -lpthread -ldl
/usr/bin/ld: cannot find -luuid
collect2: ld returned 1 exit status
rake aborted!

Command failed with status (1): [g++ -shared Utils.o Logging.o Configuratio...]
/usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/Rakefile:132
(See full trace by running task with --trace)

--------------------------------------------
It looks like something went wrong

Please read our Users guide for troubleshooting tips:

/usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/doc/Users guide.html

If that doesn't help, please use our support facilities at:

http://www.modrails.com/

We'll do our best to help you.



¤ó¡¼¥¨¥é¡¼¤¬µ¯¤­¤ë¡£¡£¤É¤¦¤ä¤élibuuid¤¬¤Ê¤¤¤é¤·¤¤¡£
yum¤ÇÆþ¤ì¤Æ¤ß¤ÆºÆÅٻ¤Æ¤ß¤ë¤¬¤É¤¦¤âư¤«¤Ê¤¤¡£¡£
lib¥Õ¥©¥ë¥À¤ò¸«¤ë¤È¡¢¤Ê¤¼¤«libuuid.so.1¤Ã¤Æ¤Ê¤Ã¤Æ¤ë¡£¤Ê¤Ë¡£.1¤Ã¤Æ¤Ê¤ó¤À¤è¡£¡£
¤È¤ê¤¢¤¨¤º¥·¥ó¥Ü¥ê¥Ã¥¯¤òŽ¤Ã¤Æ¤ß¤ë¡£

ln -s /lib/libuuid.so.1 /lib/libuuid.so



ºÆÅÙ¡¢passenger-install-apache2-module¤ò¼Â¹Ô!
º£Å٤Ϥ¦¤Þ¤¯¤¤¤­¤Þ¤·¤¿¡£



--------------------------------------------
The Apache 2 module was successfully installed.

Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so
RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
RailsRuby /usr/bin/ruby


After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!

Press ENTER to continue.


--------------------------------------------
Deploying a Ruby on Rails application: an example

Suppose you have a Ruby on Rails application in /somewhere. Add a virtual host
to your Apache configuration file, and set its DocumentRoot to
/somewhere/public, like this:

<VirtualHost *:80>
ServerName www.yourhost.com
DocumentRoot /somewhere/public
</VirtualHost>


And that's it! You may also want to check the Users Guide for security and
optimization tips and other useful information:

/usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/doc/Users guide.html

Enjoy Passenger, a product of Phusion (www.phusion.nl) :-)
http://www.modrails.com/



»Ø¼¨Ä̤êApacheÀßÄê¥Õ¥¡¥ë¥¤¤Ë°Ê²¼¤Î3¹Ô¤òÄɲáÁ

/etc/httpd/conf/httpd.conf


LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/ext/apache2/mod_passenger.so
RailsSpawnServer /usr/lib/ruby/gems/1.8/gems/passenger-1.0.1/bin/passenger-spawn-server
RailsRuby /usr/bin/ruby



¤ó¤Ç¥Ð¡¼¥Á¥ã¥ë¥Û¥¹¥È¤ËÀßÄê¡£¥Ý¡¼¥È880

Listen *:880


<VirtualHost *:80>
ServerName rails_app
DocumentRoot /var/www/html/rails_app/public
</VirtualHost>



ApacheºÆµ¯Æ°


/etc/init.d/httpd restart



¥Ö¥é¥¦¥¶¤Ç³Îǧ

̵»öư¤¤¤Æ¤Þ¤·¤¿!


ÅÓÃæ uuid¥é¥¤¥Ö¥é¥ê¤Ç¾¯¤·»þ´Ö¤È¤é¤ì¤¿¤±¤É¡¢Â¾¤Ï¤ï¤ê¤È¥¹¥à¡¼¥º¡£
PassengerÁÇŨ¤Ç¤¹¡£¡£



RubyAmf ƳÆþ¡Á





³¹¤ËÂԤä¿¡¡apache mod_rails¡¡




comment

´ÉÍý¼Ô¤Ë¤À¤±¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ë

¥×¥í¥Õ¥£¡¼¥ë

Author:liao
³¤¤È¤«»³¤È¤«Àî¤È¤«¼ò¤È¤«¹¥¤­¤Ç¤¹¡£

Á´µ­»öɽ¼¨¥ê¥ó¥¯

Á´¤Æ¤Îµ­»ö¤òɽ¼¨¤¹¤ë

¥«¥ì¥ó¥À¡¼
07 | 2008/08 | 09
Æü ·î ²Ð ¿å ÌÚ ¶â ÅÚ
- - - - - 1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31 - - - - - -
¥Ö¥í¥°Æâ¸¡º÷
¤­¤Ã¤È¤¢¤Ê¤¿¤Ïº£Æü¡¦¡¦¡¦¡¦
ºÇ¶á¤Îµ­»ö
ºÇ¶á¤Î¥³¥á¥ó¥È
ºÇ¶á¤Î¥È¥é¥Ã¥¯¥Ð¥Ã¥¯
¥«¥Æ¥´¥ê¡¼
¸¡º÷¥Õ¥©¡¼¥à
¥Ö¥í¤È¤â°ìÍ÷

¢£ ¥Ö¥í¥°Ì¾¡§25ºÐ¡ê¡¢¥¤¥ó¥Ç¥£¤Ë¤Ê¤ë¡ª
¥ê¥ó¥¯
¥Ö¥í¤È¤â¿½ÀÁ¥Õ¥©¡¼¥à

¤³¤Î¿Í¤È¥Ö¥í¤È¤â¤Ë¤Ê¤ë

QR¥³¡¼¥É
£Ñ£Ò¥³¡¼¥É
ºÇ¶áݤ¤¤¿ÆÉ¤ó¤À½ñÀÒ&²»³Ú