• 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

WordPressとRailsを動かすためにMySQLとRuby/gem/Railsをインストールする。

mysql5のインストール

# aptitude install mysql-server mysql-client libmysqlclient15-dev

# aptitude install libmysql-ruby1.8

文字コードをUTF8に設定

/etc/mysql/my.cnf に下記内容を追記。

[client]

default-character-set=utf8

[mysqld]

default-character-set=utf8

# /etc/init.d/mysql restart

# mysql> status でlatin1が混じっていないか確認する。

mysqladminのインストール

# aptitude install mysql-admin

Ruby1.8.7インストール

# aptitude install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby sqlite3 libsqlite3-ruby1.8

# sudo ln -s /usr/bin/ruby1.8 /usr/bin/ruby

# sudo ln -s /usr/bin/ri1.8 /usr/bin/ri

# sudo ln -s /usr/bin/rdoc1.8 /usr/bin/rdoc

# sudo ln -s /usr/bin/irb1.8 /usr/bin/irb

# ruby -v

ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]

gem1.3.1のソースインストール

# cd /usr/local/src/

# wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz

# tar xvf rubygems-1.3.1.tgz

# cd rubygems-1.3.1

# ruby setup.rb

# ln -s /usr/bin/gem1.8 /usr/bin/gem

# gem -v

1.3.1

# gem update

# gem install rails

Railsのインストール

# rails -v

Rails 2.2.2

ImageMagickのインストール

# aptitude install imagemagick librmagick-ruby1.8 librmagick-ruby-doc libfreetype6-dev xml-core -y

# aptitude install libmagick9-dev # export GEM_HOME=/var/lib/gems/1.8 # export RUBY_LIB=/usr/lib # gem install rmagick Successfully installed rmagick-2.8.0

posted by Face ysakaki on Sun 14 Dec 2008 at 03:37

www:一般公開用サイト

dev:テスト用サイト

blog:開発用ブログ

とします。

root@onering:~# cd /var/www/ root@onering:/var/www# ls index.html root@onering:/var/www# cat index.html

It works!

root@onering:/var/www# cd ../ root@onering:/var# ls backups cache lib local lock log mail opt run spool tmp www root@onering:/var# cd /etc/apache2/sites-available/ root@onering:/etc/apache2/sites-available# ls default default-ssl root@onering:/etc/apache2/sites-available# nano footfun.jp root@onering:/etc/apache2/sites-available# su - ysakaki ysakaki@onering:~$ pwd /home/ysakaki ysakaki@onering:~$ mkdir footfun.jp ysakaki@onering:~$ cd footfun.jp/ ysakaki@onering:~/footfun.jp$ ls ysakaki@onering:~/footfun.jp$ mkdir www ysakaki@onering:~/footfun.jp$ mkdir log ysakaki@onering:~/footfun.jp$ exit logout root@onering:~# a2ensite footfun.jp Enabling site footfun.jp. Run '/etc/init.d/apache2 reload' to activate new configuration! root@onering:~# /etc/init.d/apache2 reload

  • Reloading web server config apache2 ...done. root@onering:~# su - ysakaki ysakaki@onering:~$ mkdir dev.footfun.jp ysakaki@onering:~$ mkdir blog.footfun.jp ysakaki@onering:~$ mkdir blog.footfun.jp/www ysakaki@onering:~$ mkdir blog.footfun.jp/log ysakaki@onering:~$ mkdir dev.footfun.jp/www ysakaki@onering:~$ mkdir dev.footfun.jp/log ysakaki@onering:~$ exit logout root@onering:~# cd /etc/apache2/sites-available/ root@onering:/etc/apache2/sites-available# ls default default-ssl footfun.jp root@onering:/etc/apache2/sites-available# cp footfun.jp dev.footfun.jp root@onering:/etc/apache2/sites-available# cp footfun.jp blog.footfun.jp root@onering:/etc/apache2/sites-available# nano dev.footfun.jp root@onering:/etc/apache2/sites-available# nano blog.footfun.jp root@onering:/etc/apache2/sites-available# a2ensite dev.footfun.jp Enabling site dev.footfun.jp. Run '/etc/init.d/apache2 reload' to activate new configuration! root@onering:/etc/apache2/sites-available# a2ensite blog.footfun.jp Enabling site blog.footfun.jp. Run '/etc/init.d/apache2 reload' to activate new configuration! root@onering:/etc/apache2/sites-available# /etc/init.d/apache2 reload
  • Reloading web server config apache2 ...done.
posted by Face ysakaki on Sun 14 Dec 2008 at 02:19
Contents
[Slicehost]MySQLとRuby/Railsの導入
WEBサービス用のapache設定を追加する
Comments
satoko: 私もGIMP入れてみたんですよ、で、同じ文字化け。 言語の優先順位を1.English、2:... '08-11
榊 祐介: >satokoさん コメントありがとうございます。 画像編集はGIMPを入れてみたのですがい... '08-11
satoko: しまったsubmitするの忘れてたのですが、昨日書いていたコメントです。^^ '08-11
satoko: あわあわ、私も今日までずっと困っていました。先ほど別のところでこの設定方法を学んだところです!... '08-11
榊 祐介: 検索したら自分のブログだった乙orz '08-11
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ