安装gogs

/ 0评 / 0

GO环境部署

  1. 包下载
  2. 设置环境变量
    • vi /etc/profile 加入以下代码
      1. <span class="kwd">export</span><span class="pln"> GOROOT</span><span class="pun">=</span><span class="str">/usr/</span><span class="kwd">local</span><span class="pun">/</span><span class="pln">go</span>
      2. <span class="kwd">export</span><span class="pln"> GOBIN</span><span class="pun">=</span><span class="pln">$GOROOT</span><span class="pun">/</span><span class="pln">bin</span>
      3. <span class="pln"> </span><span class="kwd">export</span><span class="pln"> GOPATH</span><span class="pun">=</span><span class="str">/root/</span><span class="pln">xxx</span>
      4. <span class="pln"> </span><span class="kwd">export</span><span class="pln"> PATH</span><span class="pun">=</span><span class="pln">PATH</span><span class="pun">:</span><span class="pln">GOBIN</span><span class="pun">:</span><span class="pln">$GOPATH</span>
    • source /etc/profile 立刻生效
  3. 检查
    • go version 会显示
      1. <span class="pln">go version go1</span><span class="pun">.</span><span class="lit">5</span><span class="pln"> linux</span><span class="pun">/</span><span class="pln">amd64</span>

gogs 安装

  1. 二进制下载
  2. 配置
  3. 运行
    • ./gogs web
  4. 安装
    • 访问 /install 安装

来自为知笔记(Wiz)