Skip to content

Instantly share code, notes, and snippets.

@DevSecOpsGuy
Created November 11, 2019 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save DevSecOpsGuy/befd8157263b8aab8a0161661d63d07e to your computer and use it in GitHub Desktop.
Save DevSecOpsGuy/befd8157263b8aab8a0161661d63d07e to your computer and use it in GitHub Desktop.
golang and beego framework in linux ubuntu 18.04 LTS
##Install golang and beego framework in linux ubuntu 18.04 LTS
#Download and decompress the Golang 1.x.x archive
mkdir golang_source
cd golang_source
wget https://storage.googleapis.com/golang/go1.9.1.linux-amd64.tar.gz
sudo tar -zxvf go1.9.1.linux-amd64.tar.gz -C /usr/local
# Setup GOROOT and PATH environment variables
echo 'export GOROOT=/usr/local/go' | sudo tee -a /etc/profile
echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/profile
source /etc/profile
go version
go env
#Setup GOPATH and PATH environment variables (for bee tool)
sudo mkdir -p /usr/local/go_path
echo 'export GOPATH=/usr/local/go_path' | sudo tee -a /etc/profile
echo 'export PATH=$PATH:/usr/local/go_path/bin' | sudo tee -a /etc/profile
source /etc/profile
sudo chown -Rv arif:arif /usr/local/go_path
cd /usr/local/go_path
mkdir -p src/hello
cd src/hello
vi hello.go
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
go run hello.go
#Install Beego
go get github.com/astaxie/beego
sudo apt-get install git
git config --global http.sslVerify false
#Install Bee tool
go get github.com/beego/bee
go install github.com/beego/bee
bee
#Create new beego project with bee tool
bee new sample_mvc
#Run beego project
cd sample_mvc
bee run
http://your-ip:8080
#If you want to running in background, you can use “nohup”, like as below :
nohup bee run >/dev/null 2>&1 &
@UbuntuEvangelist
Copy link

good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment