LoginSignup
4
4

More than 5 years have passed since last update.

さくらVPSでMojoliciousを使うの巻

Last updated at Posted at 2013-04-09

sakura vps 1GBにCentOS 6.xを入れまして、Perl と Mojolicious を入れていきます。

まず、そもそもPerlが入っているのかって話。

[hoge@hog1234xx ~]$ which perl
/usr/bin/perl

入ってますね。.ε=\_○ノ イヤッホーゥ!

[hoge@hog1234xx ~]$ sudo su -
[sudo] password for hoge:
[root@hog1234xx ~]#

rootになります。#が出てたらまあ、だいたいrootです。
初期設定では入ってないパッケージを入れます。
パッケージはRPM(RPM Package Manager(RはRedHatのR))で管理されていて、
それをyumコマンドでインスコする感じです。

[root@hog1234xx ~]# yum -y install perl-core

Complete!
````

Complete!が出たらだいたいOK。

ではMojoliciousなどののインスコ。
(ここから先は試練です。。。。試練の状況を見たい方はコチラ⇒(´;ω;`)

1. Install perlbrew

[hoge@hog1234xx ~]$ export PERLBREW_ROOT=$HOME/.perlbrew
[hoge@hog1234xx ~]$ curl -L http://xrl.us/perlbrewinstall --insecure | bash

Happy brewing!

## Installing patchperl

## Done.

2. Perlbrew 初期設定

[hoge@hog1234xx ~]$ ~/.perlbrew/bin/perlbrew init
[hoge@hog1234xx ~]$ echo 'source ~/.perlbrew/etc/bashrc' >> ~/.bashrc
[hoge@hog1234xx ~]$ source ~/.bashrc

3. Perlのインストール

[hoge@hog1234xx ~]$ perlbrew install -v perl-5.14.2 -D ccflags=-fPIC

これ30分以上かかるかも。
Perlのインストール確認

[hoge@hog1234xx ~]$ perlbrew list
----
  perl-5.14.2
----
[hoge@hog1234xx ~]$ perlbrew switch perl-5.14.2
[hoge@hog1234xx ~]$ perl -v
----
This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux
----

4. cpanmのインストール

[hoge@hog1234xx ~]$ curl -L http://cpanmin.us/ | perl - App::cpanminus
[hoge@hog1234xx ~]$ perlbrew install-cpanm
[hoge@hog1234xx ~]$ cpanm App::pmuninstall

5. Mojoliciousのインストール

[hoge@hog1234xx ~]$ cpanm Mojolicious

6. Mojoliciousを動かしてみる

[hoge@hog1234xx ~]$ mojo generate lite_app myapp.pl  
  [exist] /home/hoge
  [write] /home/hoge/myapp.pl
  [chmod] myapp.pl 744

ref) http://d.hatena.ne.jp/oggata/20110317/1300352262
ref) http://wata-jp.ldblog.jp/archives/1616964.html

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4