문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
develop:ruby [2007/04/02 22:03] mattabu |
develop:ruby [2014/04/10 11:26] starlits |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== Ruby ====== | ====== Ruby ====== | ||
- | ===== Using Ruby on Debian Linux ===== | + | - [[develop: |
- | ==== Install on Debian Linux ==== | + | - [[develop:ruby:env | Set Rails Environment ]] |
- | Sarge 에서 지원되는 ruby의 버전이 낮으니 될 수 있으면, Etch 를 사용하기를 권고한다. | + | - [[develop: |
- | package 를 찾아보면 ruby, ruby1.8 이 있는데 이중에서 어떤 것을 설치해야 할지 모르겠다. | + | |
- | 버전이 약간 차이가 있는데, 다른 부분은 어떻게 다른지 알 수 없다. | + | |
- | 다시 확인해보니, | + | |
- | < | + | |
- | # apt-get install | + | |
- | </ | + | |
- | | + | |
- | * **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의 표준 패키지 관리프로그램이다. | ||
- | < | ||
- | # apt-get install rubygems | ||
- | </ | ||
- | ===== Set Rails Environment (1) ===== | ||
- | * **Install ruby 1.8.5 + Apache 2.2.3 + mod_proxy_balancer + mongrel + php5 on Debian (Etch) Linux** | ||
- | 우선 프로그램을 설치할 디렉토리를 생성한다. | ||
- | < | ||
- | # mkdir /opt/rails | ||
- | </ | ||
- | mongrel 을 설치하기 위해서는 ruby 1.8.4 이상의 버전이어야 한다. Debian (Etch) Linux 의 Ruby 버전은 1.8.5 이므로 충족된다. | ||
- | |||
- | ==== Install Rails ==== | ||
- | < | ||
- | # gem update --system | ||
- | # gem install rails --include-dependencies | ||
- | </ | ||
- | |||
- | ==== Install mongrel ==== | ||
- | < | ||
- | # 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. | ||
- | ERROR: | ||
- | ERROR: Failed to build gem native extension. | ||
- | |||
- | ruby extconf.rb install mongrel mongrel_cluster --include-dependencies | ||
- | extconf.rb: | ||
- | from extconf.rb: | ||
- | |||
- | |||
- | Gem files will remain installed in / | ||
- | Results logged to / | ||
- | </ | ||
- | |||
- | ==== Install Apache 2.2.3 ==== | ||
- | < | ||
- | # apt-get install apache2.2-common | ||
- | </ | ||
- | |||
- | ==== Install PHP 5 ==== | ||
- | < | ||
- | # apt-get install libapache2-mod-php5 | ||
- | </ | ||
- | |||
- | ==== Setting Apache2 ==== | ||
- | < | ||
- | # vi / | ||
- | LoadModule php5_module modules/ | ||
- | AddType application/ | ||
- | AddType application/ | ||
- | DirectoryIndex index.php index.html | ||
- | Include conf/ | ||
- | # vi / | ||
- | # PHP 파트 | ||
- | < | ||
- | Options Indexes FollowSymLinks | ||
- | AllowOverride None | ||
- | Order allow,deny | ||
- | Allow from all | ||
- | </ | ||
- | < | ||
- | DocumentRoot PHP웹루트디렉토리 | ||
- | ServerName PHP도메인이름 | ||
- | </ | ||
- | # Rais 파트 | ||
- | < | ||
- | Options Indexes FollowSymLinks | ||
- | AllowOverride None | ||
- | Order allow,deny | ||
- | Allow from all | ||
- | </ | ||
- | < | ||
- | ServerName RAILS도메인이름 | ||
- | RewriteEngine On | ||
- | RewriteCond %{DOCUMENT_ROOT}/ | ||
- | RewriteCond %{SCRIPT_FILENAME} !maintenance.html | ||
- | RewriteRule ^.*$ / | ||
- | RewriteRule ^/$ /index.html [QSA] | ||
- | RewriteRule ^([^.]+)$ $1.html [QSA] | ||
- | RewriteCond %{DOCUMENT_ROOT}/ | ||
- | RewriteRule ^/(.*)$ balancer:// | ||
- | AddOutputFilterByType DEFLATE text/html text/plain text/css | ||
- | BrowserMatch ^Mozilla/4 gzip-only-text/ | ||
- | BrowserMatch ^Mozilla/ | ||
- | BrowserMatch bMSIE !no-gzip !gzip-only-text/ | ||
- | </ | ||
- | </ | ||
- | |||
- | ==== Create RAILS웹루트디렉토리 ==== | ||
- | 만약 / | ||
- | < | ||
- | # cd /opt/www | ||
- | # rails test | ||
- | </ | ||
- | |||
- | ==== mongrel_rails + apache2 실행 ==== | ||
- | < | ||
- | # mongrel_rails start -d -p 8000 -e production -P log/ | ||
- | # mongrel_rails start -d -p 8001 -e production -P log/ | ||
- | # mongrel_rails start -d -p 8002 -e production -P log/ | ||
- | # / | ||
- | </ | ||
- | 이렇게 하고 해당 URL을 웹브라우저로 접근해 본다. ^^ | ||
- | |||
- | ==== mongrel_rails 중지 ==== | ||
- | < | ||
- | # mongrel_rails stop -P log/ | ||
- | # mongrel_rails stop -P log/ | ||
- | # mongrel_rails stop -P log/ | ||
- | </ | ||
- | |||
- | ==== mongrel_cluster 이용 ==== | ||
- | mongrel_cluster를 이용하면 mongrel_rails 시작/ | ||
- | < | ||
- | # cd / | ||
- | # mongrel_rails cluster:: | ||
- | </ | ||
- | 위 명령을 실행하면 RAILS_ROOT/ | ||
- | < | ||
- | # cd / | ||
- | # mongrel_rails cluster:: | ||
- | # mongrel_rails cluster:: | ||
- | </ | ||
- | 명령으로 기동/ | ||
- | |||
- | ===== 기타 ===== | ||
- | ==== Install lighttpd ==== | ||
- | RoR에 가장 적합한 환경인 lighttpd + FCGI 환경을 구축하려는데, | ||
- | < | ||
- | # apt-get install libpcre3 zlib1g | ||
- | </ | ||
- | http:// | ||
- | < | ||
- | # wget http:// | ||
- | # dpkg -i lighttpd_1.4.3-1_i386.deb | ||
- | </ | ||
- | 만약 Debian이 unstable 이라면 다음과 같이 바로 설치할 수 있다. | ||
- | < | ||
- | # apt-get update | ||
- | # apt-get install lighttpd lighttpd-doc | ||
- | </ | ||
- | 소스를 직접 데비안 패키지로 만들어서 설치하려면 다음과 같이 한다. | ||
- | < | ||
- | ??? | ||
- | </ | ||
- | 다음으로 log 디렉토리의 소유자: | ||
- | < | ||
- | # chown www-data: | ||
- | # cd / | ||
- | # cp lighttpd.conf.dpkg-new lighttpd.conf | ||
- | </ | ||
===== Link ===== | ===== Link ===== | ||
줄 201: | 줄 24: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
- |