MojoliciousをAmazonLinuxで動かす

yum install perl-ExtUtils-MakeMaker perl-ExtUtils-Manifest perl-Test-Simple perl-Data-Dumper perl-Time-HiRes perl-IO-Compress
sh -c "curl -L cpanmin.us | perl - Mojolicious"

/var/www/vhosts/perlmojo/perlmojo

#!/usr/bin/perl
use Mojolicious::Lite;

get '/' => sub {
     my $self = shift;
     $self->render(text => 'Hello World!');
};

app->start;
~

/etc/init.d/perlmojo

#!/bin/bash
# chkconfig: 345 91 05
# description: PerlMojo server daemon
#
# Init file for PerlMojo server daemon
# pidfile: /var/run/perlmojo.pid

if [ -f /etc/init.d/functions ] ; then
    . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
    . /etc/rc.d/init.d/functions
else
    exit 1
fi

unset TMPDIR
RETVAL=0
APP_NAME=perlmojo
APP_HOME=/var/www/vhosts/$APP_NAME
PID_FILE=/var/run/$APP_NAME.pid
LOCK_FILE=/var/lock/subsys/$APP_NAME
USER=root

start()
{
    echo -n "Starting $APP_NAME service: "
    cd $APP_HOME;
    runuser -l $USER -c "$APP_HOME/$APP_NAME daemon > /dev/null 2>&1 &" && echo_success || echo_failure
    PID=`ps -aefw | grep "$APP_HOME/$APP_NAME" | grep -v " grep " | awk '{print $2}'`
    echo "${PID}" > ${PID_FILE}
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch $LOCK_FILE || RETVAL=1
    return $RETVAL
}

stop()
{
    echo -n "Shutting down $APP_NAME service: "
    if [ ! -f "$LOCK_FILE" ] ; then
        echo
        echo -n "$APP_NAME is not runnning"
        echo_failure
        echo
        return $RETVAL
    fi
    killproc $APP_NAME
    RETVAL=$?
    [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE && rm -f $PID_FILE
    echo
    return $RETVAL
}

reload()
{
    stop
    start
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    reload)
        reload
        ;;
    restart)
        stop
        start
        ;;
    status)
        status -p $PID_FILE $APP_NAME
        ;;
    *)
        echo "Usage: $0 {start|stop|reload|restart|status}"
        exit 2
esac
exit $?
chmod +x /etc/init.d/perlmojo
service perlmojo start

http://ec2-xxxxxxxx:3000/ にアクセスできれば成功です。