Amazon LightsailでLAMP環境を簡単に立ち上げてみた #reinvent

2016.12.01

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

こんにちは、城内です。

AWS re:Invent 2016で発表されたAmazon Lightsailが、とてもシンプルなUIで簡単にサーバを立ち上げられてしまうので、今回はLAMP環境をサクッと立ち上げてみようと思います。

やってみた

セットアップ

「Create instance」から「LAMP Stack」を選択します。

ls-00

ls-01

次に、SSHの鍵を設定します。

ls-02

ls-03

ls-04

スペックはミニマムで設定します。

ls-05

「Create」ボタンをクリックで出来上がりです。

ls-06

ls-07

動作確認

早速SSHでアクセスしてみます。

ls-08

Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-100-generic x86_64)
       ___ _ _                   _
      | _ |_) |_ _ _  __ _ _ __ (_)
      | _ \ |  _| ' \/ _` | '  \| |
      |___/_|\__|_|_|\__,_|_|_|_|_|

  *** Welcome to the Bitnami LAMP 5.6.27-0 ***
  *** Documentation:  https://docs.bitnami.com/aws/infrastructure/lamp/ ***
  ***                 https://docs.bitnami.com/aws/ ***
  *** Bitnami Forums: https://community.bitnami.com/ ***
bitnami@ip-172-26-7-110:~$

中身はBitnamiですね。
一応、ApacheやMySQLなどを確認してみます。

bitnami@ip-172-26-7-110:~$ uname -a
Linux ip-172-26-7-110 3.13.0-100-generic #147-Ubuntu SMP Tue Oct 18 16:48:51 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
bitnami@ip-172-26-7-110:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
bitnami@ip-172-26-7-110:~$ php -v
PHP 5.6.27 (cli) (built: Oct 17 2016 11:20:19)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
bitnami@ip-172-26-7-110:~$ ps aux | grep apache
root      2874  0.0  3.9 203756 19720 ?        Ss   07:59   0:00 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf
daemon    2879  0.0  0.8 810228  4488 ?        Sl   07:59   0:00 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf
daemon    2880  0.0  0.9 875764  4732 ?        Sl   07:59   0:00 /opt/bitnami/apache2/bin/httpd.bin -f /opt/bitnami/apache2/conf/httpd.conf
bitnami   4344  0.0  0.1  11740   936 pts/0    S+   08:18   0:00 grep --color=auto apache
bitnami@ip-172-26-7-110:~$ ps aux | grep mysql
root      2436  0.0  0.0   4440     8 ?        S    07:59   0:00 /bin/sh /opt/bitnami/mysql/bin/mysqld_safe --defaults-file=/opt/bitnami/mysql/my.cnf --mysqld=mysqld.bin --socket=/opt/bitnami/mysql/tmp/mysql.sock --datadir=/opt/bitnami/mysql/data --log-error=/opt/bitnami/mysql/data/mysqld.log --pid-file=/opt/bitnami/mysql/data/mysqld.pid --lower-case-table-names=1
mysql     2756  0.0 42.5 926132 212984 ?       Sl   07:59   0:00 /opt/bitnami/mysql/bin/mysqld.bin --defaults-file=/opt/bitnami/mysql/my.cnf --basedir=/opt/bitnami/mysql --datadir=/opt/bitnami/mysql/data --plugin-dir=/opt/bitnami/mysql/lib/plugin --user=mysql --lower-case-table-names=1 --log-error=/opt/bitnami/mysql/data/mysqld.log --pid-file=/opt/bitnami/mysql/data/mysqld.pid --socket=/opt/bitnami/mysql/tmp/mysql.sock --port=3306
bitnami   4346  0.0  0.1  11744   932 pts/0    S+   08:18   0:00 grep --color=auto mysql
bitnami@ip-172-26-7-110:~$

phpMyAdminの方も、ちょこっとApacheをイジイジして画面を確認しました。

ls-09

さいごに

ベースはBitnamiのAMIだと思われるので、中身はEC2で立ち上げるのと変わりませんが、立ち上げまでのスピードが断然速いですね。
もちろん、EC2でカッチリ作るのも必要だと思いますが、一方で、サクッと作りたい場合はお薦めかもしれません。