Centos-Go 服务器使用
在window终端执行
1.set GOOS=linux 回车
2.set GOARCH=amd64 回车
3.go build main.go 或者 go build -o (重命名生成的文件名称) main.go 回车
会在执行目录地下生成main(重命名)文件
在mac终端执行: GOOS=linux GOARCH=amd64 go build main.go
1.上传本地编译好的go程序
2.服务器执行后台运行代码: nohup ./main &
3.查看运行进程pid: ps aux |grep main (main为名称)
3.关闭运行代码:kill -2 7159pid
域名绑定 vi /etc/httpd/conf.d/httpd-vhosts.conf
ServerName go.host.com
ProxyRequests Off Order deny,allow Allow from all
ProxyPass / http://127.0.0.1:8081/
ProxyPassReverse / http://127.0.0.1:8081/
版权声明:本文著作权归原作者所有,如有侵权,请联系我们立即删除!