사용자 도구

사이트 도구


develop:ruby

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
develop:ruby [2007/04/02 23:04]
mattabu
develop:ruby [2014/04/10 11:26] (현재)
starlits
줄 1: 줄 1:
 ====== Ruby ====== ====== Ruby ======
  
-===== Using Ruby on Debian Linux ===== +  - [[develop:ruby:install | Ruby installation ]] 
-==== Install on Debian Linux ==== +  [[develop:ruby:env | Set Rails Environment ]] 
-Debian Linux (Sarge) 에서 지원되는 ruby의 버전이 낮으니 될 수 있으면, Debian Linux (Etch) 를 사용하기를 권고한다. +  - [[develop:lighttpd:install | Install lighttpd ]]
-다음과 같이 설치하면 된다. +
-<code> +
-# apt-get install ruby irb ri rdoc ruby1.8-dev +
-</code> +
-  * The **irb** is acronym for Interactive RuBy.  It evaluates Ruby expression from the terminal. +
-  * **ri** is a command line tool that displays descriptions of built-in Ruby methods, classes, and modules. For methods, it shows you the calling sequence and a description. For classes and modules, it shows a synopsis along with a list of the methods the class or module implements.+
  
-==== Install RubyGems ==== 
-RubyGems는 Ruby의 표준 패키지 관리프로그램이다. 
-<code> 
-# apt-get install rubygems 
-</code> 
  
-===== Set Rails Environment (1) ===== 
-**Install ruby 1.8.5 + Apache 2.2.3 + mod_proxy_balancer + mongrel + php5 on Debian (Etch) Linux** \\ 
-mongrel 을 설치하기 위해서는 ruby 1.8.4 이상의 버전이어야 한다. Debian (Etch) Linux 의 Ruby 버전은 1.8.5 이므로 충족된다. 
- 
-==== Install Rails ==== 
-<code> 
-# gem update --system 
-# gem install rails --include-dependencies 
-</code> 
- 
-==== Install mongrel ==== 
-<code> 
-# gem update --system 
-# gem install mongrel mongrel_cluster --include-dependencies 
-Select which gem to install for your platform (i486-linux) 
- 1. mongrel 1.0.1 (ruby) 
- 2. mongrel 1.0.1 (mswin32) 
- 3. mongrel 1.0 (mswin32) 
- 4. mongrel 1.0 (ruby) 
- 5. Skip this gem 
- 6. Cancel installation 
-> 1 
-Select which gem to install for your platform (i486-linux) 
- 1. fastthread 1.0 (ruby) 
- 2. fastthread 1.0 (mswin32) 
- 3. fastthread 0.6.4.1 (mswin32) 
- 4. fastthread 0.6.4.1 (ruby) 
- 5. Skip this gem 
- 6. Cancel installation 
-> 1 
-Building native extensions.  This could take a while... 
-Building native extensions.  This could take a while... 
-Successfully installed mongrel-1.0.1 
-Successfully installed fastthread-1.0 
-Successfully installed gem_plugin-0.2.2 
-Successfully installed cgi_multipart_eof_fix-2.1 
-Installing ri documentation for mongrel-1.0.1... 
-Installing ri documentation for gem_plugin-0.2.2... 
-Installing ri documentation for cgi_multipart_eof_fix-2.1... 
-Installing RDoc documentation for mongrel-1.0.1... 
-Installing RDoc documentation for gem_plugin-0.2.2... 
-Installing RDoc documentation for cgi_multipart_eof_fix-2.1... 
-Successfully installed mongrel_cluster-0.2.1 
-</code> 
- 
-==== Install MySQL Module for ruby ==== 
-<code> 
-# apt-get install libmysqlclient15-dev 
-# gem install mysql 
-Select which gem to install for your platform (i486-linux) 
- 1. mysql 2.7.3 (mswin32) 
- 2. mysql 2.7.1 (mswin32) 
- 3. mysql 2.7 (ruby) 
- 4. mysql 2.6 (ruby) 
- 5. Skip this gem 
- 6. Cancel installation 
-> 3 
-Building native extensions.  This could take a while... 
-Successfully installed mysql-2.7 
-</code> 
- 
-==== Install Apache 2.2.3 ==== 
-<code> 
-# apt-get install apache2.2-common 
-</code> 
- 
-==== Install PHP 5 ==== 
-<code> 
-# apt-get install libapache2-mod-php5 
-</code> 
- 
-==== Setting Apache2 ==== 
-<code> 
-# cd /etc/apache2/mods-enabled 
-# ln -s ../mods-available/rewrite.load rewrite.load 
-</code> 
-<code> 
-# vi /etc/apache2/sites-available/test 
-<VirtualHost 아이피주소> 
-    ServerName PHP도메인이름 
-    DocumentRoot PHP웹루트디렉토리 
-</VirtualHost> 
-<VirtualHost 아이피주소> 
-    ServerName RAILS도메인이름 
-    DocumentRoot RAILS웹루트디렉토리 
- 
-    RewriteEngine On 
-    RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f 
-    RewriteCond %{SCRIPT_FILENAME} !maintenance.html 
-    RewriteRule ^.*$ /system/maintenance.html [L] 
-    RewriteRule ^/$ /index.html [QSA] 
-    RewriteRule ^([^.]+)$ $1.html [QSA] 
-    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f 
-    RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L] 
-    AddOutputFilterByType DEFLATE text/html text/plain text/css 
-    BrowserMatch ^Mozilla/4 gzip-only-text/html 
-    BrowserMatch ^Mozilla/4.0[678] no-gzip 
-    BrowserMatch bMSIE !no-gzip !gzip-only-text/html 
-</VirtualHost> 
-# cd /etc/apache2/sites-enabled 
-# ln -s ../sites-available/test 001-test 
-</code> 
- 
-==== Create RAILS웹루트디렉토리 ==== 
-만약 /opt/www/test 라는 RAILS웹루트디렉토리를 만들고 싶다면 다음과 같이 실행한다.  
-<code> 
-# cd /opt/www 
-# rails test 
-</code> 
- 
-==== mongrel_rails + apache2 실행 ==== 
-<code> 
-# mongrel_rails start -d -p 8000 -e production -P log/mongrel-0.pid -c /opt/www/test 
-# mongrel_rails start -d -p 8001 -e production -P log/mongrel-1.pid -c /opt/www/test 
-# mongrel_rails start -d -p 8002 -e production -P log/mongrel-2.pid -c /opt/www/test 
-# /etc/init.d/apache2 start 
-</code> 
-이렇게 하고 해당 URL을 웹브라우저로 접근해 본다. ^^ 
- 
-==== mongrel_rails 중지 ==== 
-<code> 
-# mongrel_rails stop -P log/mongrel-0.pid -c /opt/www/test 
-# mongrel_rails stop -P log/mongrel-1.pid -c /opt/www/test 
-# mongrel_rails stop -P log/mongrel-2.pid -c /opt/www/test 
-</code> 
- 
-==== mongrel_cluster 이용 ==== 
-mongrel_cluster를 이용하면 mongrel_rails 시작/중지시 귀찮은 타이핑 수고를 덜 수 있습니다. 
-<code> 
-# cd /opt/www/test 
-# mongrel_rails cluster::configure -e production -p 8000 -N 3 -c /opt/www/test 
-</code> 
-위 명령을 실행하면 RAILS_ROOT/config/mongrel_cluster.yml이 만들어지고, 그 후에는 
-<code> 
-# cd /opt/www/test 
-# mongrel_rails cluster::start 
-# mongrel_rails cluster::stop 
-</code> 
-명령으로 기동/중지를 할 수 있습니다. 
- 
-===== 기타 ===== 
-==== Install lighttpd ==== 
-RoR에 가장 적합한 환경인 lighttpd + FCGI 환경을 구축하려는데, Debian Stable 에 lighttpd 패키지도 존재하지 않는다.  
-그러므로 별도로 패키지를 받아서 설치해야 한다. 먼저 lighttpd 를 설치하기전에 필요한 패키지부터 설치한다. 
-<code> 
-# apt-get install libpcre3 zlib1g 
-</code> 
-http://www.lighttpd.net/download/ 으로 가서 데비안 패키지를 다운로드 받아서 설치한다. 
-<code> 
-# wget http://www.lighttpd.net/download/debian/sarge/lighttpd_1.4.3-1_i386.deb 
-# dpkg -i lighttpd_1.4.3-1_i386.deb 
-</code> 
-만약 Debian이 unstable 이라면 다음과 같이 바로 설치할 수 있다. 
-<code> 
-# apt-get update 
-# apt-get install lighttpd lighttpd-doc 
-</code> 
-소스를 직접 데비안 패키지로 만들어서 설치하려면 다음과 같이 한다. 
-<code> 
-??? 
-</code> 
-다음으로 log 디렉토리의 소유자:그룹을 재설정하고 configuration 파일을 생성한다. 
-<code> 
-# chown www-data:www-data /var/log/lighttpd/ 
-# cd /etc/lighttpd 
-# cp lighttpd.conf.dpkg-new lighttpd.conf 
-</code> 
  
 ===== Link ===== ===== Link =====
줄 202: 줄 24:
   * [[http://wiki.rubyonrails.com/rails/pages/Lighttpd]]   * [[http://wiki.rubyonrails.com/rails/pages/Lighttpd]]
   * [[http://trac.lighttpd.net/trac/wiki/#ReferenceDocumentation]]   * [[http://trac.lighttpd.net/trac/wiki/#ReferenceDocumentation]]
- 
develop/ruby.1175522642.txt.gz · 마지막으로 수정됨: 2007/04/02 23:04 저자 mattabu