-
修改
conf/app.conf
- RunMode 從
prod
改為dev
- [dev] 區塊內的 host 從
PUBLIC_INSTANCE_IP
改為要連的遠端的 EC2 public IP
- RunMode 從
-
Initial Setup 的 Instance ID 填 12345678。
-
AWS 上 EC2 的 security group 要開以下 port 允許自己的 IP 連入。
用途 Protocol Port SSH TCP 22 MySQL TCP 3306 Redis TCP 6379 Soft ether Server Manage Tool TCP 992 -
若使用 release 版本,EC2 要修改 MySQL 和 Redis 設定去接受外部連線
-
MySQL
- 在 EC2 上修改
vi /etc/mysql/mysql.conf.d/mysqld.cnf
,將bind-address = 127.0.0.1
這行前面加上#
註解起來 - 開啟 Security Group 的 3306 port 允許自己 IP
- 在 EC2 上修改
-
Redis
- 在 EC2 上修改
vi /etc/redis/redis.conf
,將bind 127.0.0.1
這行前面加上#
註解起來 - 開啟 Security Group 的 3306 port 允許自己 IP
- 在 EC2 上修改
- 在 Local [安裝 Beego 環境](#安裝 Beego 環境)
https://github.com/golang/go/wiki/Ubuntu
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install golang-go
執行 vi ~/.profile
編輯 bash 的 profile,將 path 該段內容改為以下:
# set PATH so it includes user's private bin directories
GOPATH="$HOME/go"
PATH="$GOPATH/bin:$HOME/bin:$HOME/.local/bin:$PATH"
完成以後執行以下指令讓設定生效。
source ~/.profile
mkdir ~/go/src/gitlab.ecoworkinc.com/Subspace && cd ~/go/src/gitlab.ecoworkinc.com/Subspace
git clone https://gitlab.ecoworkinc.com/Subspace/web-console
git clone https://gitlab.ecoworkinc.com/Subspace/subspace-utility
git clone https://gitlab.ecoworkinc.com/Subspace/softetherlib
git clone https://gitlab.ecoworkinc.com/Subspace/vpn-profile-generator
git clone https://gitlab.ecoworkinc.com/Subspace/server-status-api.git
cd ~/go/src/gitlab.ecoworkinc.com/Subspace/web-console
go get
go get -u github.com/astaxie/beego
go get -u github.com/beego/bee
如果在 EC2 上要執行,要先執行 sudo service subspace stop
把原本在跑的 subspace 停掉,否則 port 要調開。
cd ~/go/src/gitlab.ecoworkinc.com/Subspace/web-console
bee run
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
git config --global alias.lgo 'log --graph --decorate'
git config --global core.editor "vim"