1 go lang安装配置
1.1 centos go lang install
yum install mercurial
安装 mercurial包
安装git包
yum install git
安装gcc
yum install gcc
cd /app
获取go 安装包
wget https://go.googlecode.com/files/go1.5.1.linux-amd64.tar.gz
tar xvf go1.5.1.linux-amd64.tar.gz
vi /etc/profile
在profile里面添加如下内容
export GOROOT=/app/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/goTest
export GOBIN=$GOPATH/bin
go version
2 git 安装配置
2.1 centos git install
yum install curl
yum install curl-devel
yum install zlib-devel
yum install openssl-devel
yum install perl
yum install cpio
yum install expat-devel
yum install gettext-devel
yum install git
[root@svnserver go]# whereis git
git: /usr/bin/git /usr/share/man/man1/git.1.gz
[root@svnserver go]# git --version
git version 1.7.1
2.2 git version
3 mysql安装配置
3.1 rpm install (请看mysql 官网资料)
3.2 远程数据库创建
DROP DATABASE IF EXISTS gogs;
CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8 COLLATE utf8_general_ci;
4 nginx 安装配置
4.1 环境配置
wget nginx
tar xvf
./configure --prefix=/app/nginx
make && make install
[root@svnserver sbin]# ./nginx -V
nginx version: nginx/1.8.0
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)
configure arguments: --prefix=/app/nginx
./nginx -s reload
4.2 wget 及编译安装
4.3 nginx.conf 配置
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
# location / {
# root html;
# index index.html index.htm;
# }
location / {
proxy_pass http://127.0.0.1:3000;
}
5 gogs安装配置
5.1 部署路径参数规划
[root@svnserver gogs]# pwd
/app/gogs
[root@svnserver gogs]# ls
custom data gogs LICENSE log public README.md README_ZH.md repositories scripts templates
[root@svnserver gogs]#
[root@svnserver gogs]# pwd
/app/gogs
[root@svnserver gogs]# ls
custom data gogs LICENSE log public README.md README_ZH.md repositories scripts templates
[root@svnserver gogs]#
后台gogs守护进程使用
nohup ./gogs web &
5.2 安装配置
[root@svnserver conf]# vi app.ini
APP_NAME = Gogs: Go Git Service
RUN_USER = root
RUN_MODE = prod
[database]
DB_TYPE = mysql
HOST = 192.168.2.12:3306
NAME = gogs
USER = root
PASSWD = qazwsx
SSL_MODE = disable
PATH = data/gogs.db
[repository]
ROOT = /app/gogs/repositories
[server]
DOMAIN = 192.168.2.13
HTTP_PORT = 3000
ROOT_URL = http://192.168.2.13/
DISABLE_SSH = false
SSH_PORT = 22
OFFLINE_MODE = false
[mailer]
ENABLED = true
HOST = smtp.163.com:25
FROM = [email protected]
USER = [email protected]
PASSWD = ******
[service]
REGISTER_EMAIL_CONFIRM = true
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = false
ENABLE_CAPTCHA = true
REQUIRE_SIGNIN_VIEW = false
[picture]
DISABLE_GRAVATAR = false
[session]
PROVIDER = file
[log]
MODE = file
LEVEL = Info
[security]
INSTALL_LOCK = true
SECRET_KEY = LuKUtLjix5k4Dpq