首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件开发 >

gitlab6 nginx配置跟启动脚本

2013-10-06 
gitlab6 nginx配置和启动脚本gitlab6 nginx配置和启动脚本cheungmine2013-10最近把gitlab安装到了ubuntu12

gitlab6 nginx配置和启动脚本

gitlab6 nginx配置和启动脚本

cheungmine

2013-10

最近把gitlab安装到了ubuntu12.04.3的虚拟机上了。参考:

https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md
www.nickyeoman.com/blog/system-administration/180-install-gitlab-on-ubuntu


我用了2个虚拟机,vm-gitlab6安装gitlab6和相关的东西:nginx, postfix, redis,ruby,另一个vm-mysqldb4git安装了mysql db。用这2台虚拟机构成了整个内网下的 gitlab服务。由于使用了NAT,还需要在主机上安装nginx,指向vm-gitlab6上的nginx服务。

虚拟机的用户car设置了sudo免密码,参考:

http://blog.csdn.net/cheungmine/article/details/12341005

这样连同主机在内有3台机器:

--------------------------------------------------

host: 192.168.90.122

nginx A

/etc/hosts 中加入:

#!/bin/bash# stop-gitlab.sh# cheungmine@gmail.com################################################################################# vm-gitlab6vm_gitlab6_name='vm-gitlab6'vm_gitlab6_ip='192.168.122.24'vm_gitlab6_login='car'vm_gitlab6_passwd='abc1234'# vm-mysqldb4gitvm_mysqldb4git_name='vm-mysqldb4git'vm_mysqldb4git_ip='192.168.122.139'vm_mysqldb4git_login='car'vm_mysqldb4git_passwd='abc1234'echo "================================================================="echo "stop gitlab, mysqldb4git virtual machines and services..."# stop services on vm-gitlab6if (! ping -c 1 $vm_gitlab6_ip); then    echo -e $vm_gitlab6_name "(" $vm_gitlab6_ip ") is not running!\r\n"else    sshpass -p $vm_gitlab6_passwd ssh $vm_gitlab6_login@$vm_gitlab6_ip "sudo /etc/init.d/gitlab stop"    sshpass -p $vm_gitlab6_passwd ssh $vm_gitlab6_login@$vm_gitlab6_ip "sudo /etc/init.d/nginx stop"    sleep 10    sudo virsh shutdown $vm_gitlab6_namefi# stop services on vm-mysqldb4gitif (! ping -c 1 $vm_mysqldb4git_ip); then    echo -e $vm_mysqldb4git_name "(" $vm_mysqldb4git_ip ") is not running!\r\n"else    # close mysqldb    # sleep 5    sudo virsh shutdown $vm_mysqldb4git_name    sleep 5fisudo virsh list --all# stop local nginx serviceecho "stop nginx at localhost:" `hostname`sudo /etc/init.d/nginx stopecho "gitlab, mysqldb4git virtual machines are shutdown !"echo "================================================================="




热点排行