Gitlab是一个用Ruby on Rails开发的开源项目管理程序,可以通过WEB界面进行访问公开的或者私人项目。它和Github有类似的功能,能够浏览源代码,管理缺陷和注释。
下面介绍如何在 Debian/Ubuntu 和 Centos 下搭建配置 GitLab。
安装依赖
Debian/Ubuntu下:
复制代码 代码如下:
sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate
安装python(注意需要2.5以上版本):
sudo apt-get install -y python python-docutils
安装git(注意需要1.7.10以上版本):
sudo apt-get install -y git-core
Centos下官方仓库的软件比较老旧,推荐先添加epel源,然后再安装依赖:
复制代码 代码如下:
sudo yum install git patch gcc-c++ readline-devel zlib-devel libffi-devel openssl-devel make autoconf automake libtool bison libxml2-devel libxslt-devel libyaml-devel git python python-docutils
安装 Ruby 2.0
需要安装Ruby2.0,软件仓库中的Ruby 1.8不支持:
mkdir /tmp/ruby && cd /tmp/ruby curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz | tar xz cd ruby-2.0.0-p353 ./configure --disable-install-rdoc make sudo make install
安装Bundler Gem:
sudo gem install bundler --no-ri --no-rdoc
配置gitlab-shell
创建git用户:
sudo adduser --system --create-home --comment 'GitLab' git
配置gitlab-shell
su - git -c "git clone https://github.com/gitlabhq/gitlab-shell.git" su - git -c "cd gitlab-shell && git checkout v1.3.0" su - git -c "cp gitlab-shell/config.yml.example gitlab-shell/config.yml" sed -i "s/localhost/gitlab.51yip.com/g" /home/git/gitlab-shell/config.yml su - git -c "gitlab-shell/bin/install" chmod 600 /home/git/.ssh/authorized_keys chmod 700 /home/git/.ssh
数据库
GitLab支持 MySQL 和 PostgreSQL 数据库。下面以 MySQL为例,介绍安装方法:
Debian/Ubuntu下使用如下命令安装:
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
Centos下使用如下命令:
sudo yum install mysql-server sudo chkconfig mysqld on
配置MySQL:
sudo echo "CREATE DATABASE IF NOT EXISTS gitlabhq_production DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';" | mysql -u root sudo echo "UPDATE mysql.user SET Password=PASSWORD('123456') WHERE User='root'; FLUSH PRIVILEGES;" | mysql -u root
注意,用你的密码替换123456。
安装配置 gitlab
su - git -c "git clone https://github.com/gitlabhq/gitlabhq.git gitlab" su - git -c "cd gitlab;git checkout 5-1-stable" su git -c "cp config/gitlab.yml.example config/gitlab.yml" su git -c "mkdir /home/git/gitlab-satellites" su git -c "mkdir public/uploads" su git -c "mkdir -p tmp/sockets/" su git -c "mkdir -p tmp/pids/" sed -i "s/ host: localhost/ host: gitlab.segmentfault.com/g" config/gitlab.yml sed -i "s/from: gitlab@localhost/from: gitlab@gitlab.segmentfault.com/g" config/gitlab.yml su git -c "cp config/puma.rb.example config/puma.rb" su git -c 'git config --global user.name "GitLab"' su git -c 'git config --global user.email "gitlab@gitlab.segmentfault.com"'
注意将gitlab.segmentfault.com替换为你自己的内容。
配置数据库连接:
sudo su git -c "cp config/database.yml.mysql config/database.yml" sudo sed -i "s/secure password/mysql的root密码/g" config/database.yml
安装MySQL需要的Gems
sudo -u git -H bundle install --deployment --without development test postgres aws
初始化:
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab sudo chmod +x /etc/init.d/gitlab sudo update-rc.d gitlab defaults 21
查看是否配置妥当:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
重启GitLab:
sudo service gitlab start
配置Nginx
Debian/Ubuntu下:
sudo apt-get install -y nginx
CentOS下:
sudo yum install nginx
下载配置文件样例:
sudo cp lib/support/nginx/gitlab /etc/nginx/sites-available/gitlab sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
修改 /etc/nginx/sites-available/gitlab,特别留意将 YOUR_SERVER_FQDN 改成自己的。
重启nginx:
sudo service nginx restart
好了,你可以登录GitLab了,默认安装后的用户名:admin@local.host,密码5iveL!fe。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
- 群星《前途海量 电影原声专辑》[FLAC/分轨][227.78MB]
- 张信哲.1992-知道新曲与精丫巨石】【WAV+CUE】
- 王翠玲.1995-ANGEL【新艺宝】【WAV+CUE】
- 景冈山.1996-我的眼里只有你【大地唱片】【WAV+CUE】
- 群星《八戒 电影原声带》[320K/MP3][188.97MB]
- 群星《我的阿勒泰 影视原声带》[320K/MP3][139.47MB]
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[320K/MP3][148.91MB]
- 刘雅丽.2001-丽花皇后·EMI精选王【EMI百代】【FLAC分轨】
- 齐秦.1994-黄金十年1981-1990CHINA.TOUR.LIVE精丫上华】【WAV+CUE】
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]