-
Notifications
You must be signed in to change notification settings - Fork 416
CentOS上编译engineercms
hotqin888 edited this page Dec 12, 2018
·
1 revision
https://blog.csdn.net/maggiegu/article/details/60787251
https://www.cnblogs.com/chy123/p/6750347.html
https://studygolang.com/articles/7202
https://blog.csdn.net/bawenmao/article/details/80217055
用yum install golang这个命令不成功,所以改为源码包安装。
这里使用二进制源码包来安装,
下载go1.11.2.linux-amd64.tar.gz
wget https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz
然后解压到usr/local文件夹下:
tar -C /usr/local -xzf go1.11.2.linux-amd64.tar.gz
#设置环境变量 vim /etc/profile
在最后添加下面3行:
export GOROOT=/usr/local/go #设置为go安装的路径
export GOPATH=$HOME/gocode #默认安装包的路径
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
:wq保存退出
然后source使其生效:
source /etc/profile
[root@localhost ~]# git --version
yum 安装git
[root@localhost ~]# yum install git
[root@localhost ~]# go get github.com/astaxie/beego
[root@localhost ~]# git version
git version 1.8.3.1
[root@localhost ~]# go get github.com/astaxie/beego
[root@localhost ~]# go get github.com/beego/bee
[root@localhost ~]# go get github.com/mattn/go-sqlite3
[root@localhost ~]# github.com/mattn/go-sqlite3
exec: "gcc": executable file not found in $PATH
使用yum安装gcc:yum install gcc
[root@localhost ~]# yum install gcc
……全部安装完,bee run即可。
下载engineercms
[root@localhost ~]# go get github.com/3xxx/engineercms
进入文件夹后
[root@localhost ~]# bee run
如果出错,提示缺少包,则安装对应的包。Linux对大小写敏感,EngineerCMS文件夹名称需要改为engineercms全部小写字母。
EngineerCMS助力工程师