문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
develop:ruby [2007/04/02 22:01] mattabu |
develop:ruby [2007/04/02 23:04] mattabu |
||
---|---|---|---|
줄 3: | 줄 3: | ||
===== Using Ruby on Debian Linux ===== | ===== Using Ruby on Debian Linux ===== | ||
==== Install on Debian Linux ==== | ==== Install on Debian Linux ==== | ||
- | package 를 찾아보면 ruby, ruby1.8 이 있는데 이중에서 | + | Debian Linux (Sarge) |
- | 버전이 | + | 다음과 같이 설치하면 된다. |
- | 다시 확인해보니, | + | |
< | < | ||
- | # apt-get install ruby irb ri rdoc | + | # apt-get install ruby irb ri rdoc ruby1.8-dev |
</ | </ | ||
* The **irb** is acronym for Interactive RuBy. It evaluates Ruby expression from the terminal. | * The **irb** is acronym for Interactive RuBy. It evaluates Ruby expression from the terminal. | ||
줄 19: | 줄 18: | ||
===== Set Rails Environment (1) ===== | ===== Set Rails Environment (1) ===== | ||
- | * **Install ruby 1.8.5 + Apache 2.2.3 + mod_proxy_balancer + mongrel + php5 on Debian (Etch) Linux** | + | **Install ruby 1.8.5 + Apache 2.2.3 + mod_proxy_balancer + mongrel + php5 on Debian (Etch) Linux** |
- | 우선 프로그램을 설치할 디렉토리를 생성한다. | + | |
- | < | + | |
- | # mkdir / | + | |
- | </ | + | |
mongrel 을 설치하기 위해서는 ruby 1.8.4 이상의 버전이어야 한다. Debian (Etch) Linux 의 Ruby 버전은 1.8.5 이므로 충족된다. | mongrel 을 설치하기 위해서는 ruby 1.8.4 이상의 버전이어야 한다. Debian (Etch) Linux 의 Ruby 버전은 1.8.5 이므로 충족된다. | ||
줄 53: | 줄 48: | ||
> 1 | > 1 | ||
Building native extensions. | Building native extensions. | ||
- | ERROR: | + | Building native extensions. |
- | | + | Successfully installed mongrel-1.0.1 |
- | + | Successfully installed fastthread-1.0 | |
- | ruby extconf.rb install | + | Successfully installed gem_plugin-0.2.2 |
- | extconf.rb:1:in `require': | + | Successfully installed cgi_multipart_eof_fix-2.1 |
- | from extconf.rb: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 | ||
+ | </ | ||
- | Gem files will remain installed in /usr/lib/ruby/gems/1.8/ | + | ==== Install MySQL Module for ruby ==== |
- | Results logged to /usr/lib/ruby/gems/1.8/ | + | < |
+ | # 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. | ||
+ | Successfully installed mysql-2.7 | ||
</ | </ | ||
줄 77: | 줄 90: | ||
==== Setting Apache2 ==== | ==== Setting Apache2 ==== | ||
< | < | ||
- | # vi /opt/rails/apache2/conf/ | + | # cd /etc/apache2/mods-enabled |
- | LoadModule php5_module modules/ | + | # ln -s ../mods-available/ |
- | AddType application/ | + | </code> |
- | AddType application/x-httpd-php-source .phps | + | < |
- | DirectoryIndex index.php index.html | + | # vi /etc/apache2/sites-available/test |
- | Include conf/extra/ | + | |
- | # vi /opt/rails/apache2/conf/ | + | |
- | # PHP 파트 | + | |
- | < | + | |
- | Options Indexes FollowSymLinks | + | |
- | AllowOverride None | + | |
- | Order allow, | + | |
- | Allow from all | + | |
- | </Directory> | + | |
< | < | ||
- | DocumentRoot PHP웹루트디렉토리 | ||
ServerName PHP도메인이름 | ServerName PHP도메인이름 | ||
+ | DocumentRoot PHP웹루트디렉토리 | ||
</ | </ | ||
- | # Rais 파트 | ||
- | < | ||
- | Options Indexes FollowSymLinks | ||
- | AllowOverride None | ||
- | Order allow,deny | ||
- | Allow from all | ||
- | </ | ||
< | < | ||
ServerName RAILS도메인이름 | ServerName RAILS도메인이름 | ||
+ | DocumentRoot RAILS웹루트디렉토리 | ||
+ | |||
RewriteEngine On | RewriteEngine On | ||
RewriteCond %{DOCUMENT_ROOT}/ | RewriteCond %{DOCUMENT_ROOT}/ | ||
줄 117: | 줄 116: | ||
BrowserMatch bMSIE !no-gzip !gzip-only-text/ | BrowserMatch bMSIE !no-gzip !gzip-only-text/ | ||
</ | </ | ||
+ | # cd / | ||
+ | # ln -s ../ | ||
</ | </ | ||
줄 131: | 줄 132: | ||
# mongrel_rails start -d -p 8001 -e production -P log/ | # mongrel_rails start -d -p 8001 -e production -P log/ | ||
# mongrel_rails start -d -p 8002 -e production -P log/ | # mongrel_rails start -d -p 8002 -e production -P log/ | ||
- | # /opt/rails/apache2/ | + | # /etc/init.d/apache2 start |
</ | </ | ||
이렇게 하고 해당 URL을 웹브라우저로 접근해 본다. ^^ | 이렇게 하고 해당 URL을 웹브라우저로 접근해 본다. ^^ | ||
줄 158: | 줄 159: | ||
===== 기타 ===== | ===== 기타 ===== | ||
==== Install lighttpd ==== | ==== Install lighttpd ==== | ||
- | RoR에 가장 적합한 환경인 lighttpd + FCGI 환경을 구축하려는데, | + | RoR에 가장 적합한 환경인 lighttpd + FCGI 환경을 구축하려는데, |
+ | 그러므로 별도로 패키지를 받아서 설치해야 한다. 먼저 lighttpd 를 설치하기전에 필요한 패키지부터 설치한다. | ||
< | < | ||
# apt-get install libpcre3 zlib1g | # apt-get install libpcre3 zlib1g |