きゃまメモ

(自分用のメモであったり、何かしらアップしたり)

CentOS7にaahをインストールする

2018.12.03
centos golang aah

早いらしいのでとりあえずインストールしてみる。

macのdockerに構築する。

必要なライブラリインストール > Goのインストール > aahのインストールの順番。

[mac]
docker run -dit -p 8080:8080 --name aah centos:7
docker exec -it aah bash

[container]
su -
yum -y install wget gcc
yum -y remove git
yum -y install https://centos7.iuscommunity.org/ius-release.rpm
yum -y install git2u yum-utils
yum-config-manager --disable ius

wget https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.11.2.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile
source /etc/profile
go version
> go version go1.11.2 linux/amd64

curl -s https://aahframework.org/install-cli | bash
git clone -b 'v0.13.0' --single-branch --depth 1 https://github.com/go-aah/tools.git aah-cli
cd aah-cli/aah && env GO111MODULE=on go install
mv ~/go/bin/aah /usr/local/go/bin/
aah --version

aah new
---------------------------------------------------------------
                 aah framework (cli v0.13.0)
---------------------------------------------------------------
# Report improvements/bugs at https://aahframework.org/issues #
Welcome to interactive way to create your aah application, press ^C to exit :)
Based on your inputs, aah CLI generates the aah application structure for you.
Enter your application import path: sample
Enter your application location: /root
Choose your application type (web, api or websocket), default is 'web': web
Choose your application View Engine (go), default is 'go': go
Choose your application Auth Scheme (form, basic), default is 'none': form
Choose your password hash algorithm (bcrypt, scrypt, pbkdf2), default is 'bcrypt': 
Choose your session store (cookie or file), default is 'cookie': 
Would you like to add API (/api/v1/*) within your Web App? [y/N]: y
Would you like to add WebSocket (/ws/*) within your Web App? [y/N]: y
Would you like to enable CORS? [y/N]: y
Your aah web application was created successfully at '/root/sample'
You shall run your application via the command 'aah run' from application base directory.
Go to https://docs.aahframework.org to learn more and customize your aah application.

起動してみる
cd sample
aah run

http://localhost:8080 にアクセスしてウェルカムページが出ることを確認する。