濮阳杆衣贸易有限公司

主頁 > 知識庫 > CentOS系統(tǒng)中GitLab客戶端的安裝教程

CentOS系統(tǒng)中GitLab客戶端的安裝教程

熱門標(biāo)簽:ai人工電話機器人 常州云呼叫外呼系統(tǒng) bs外呼系統(tǒng) 小藍鴿電話機器人 長沙人工外呼系統(tǒng)公司 河北機器人電銷 京東外呼系統(tǒng)怎么操作 上海營銷外呼系統(tǒng)定制 阿克蘇市地圖標(biāo)注app

添加epel倉庫

復(fù)制代碼
代碼如下:

cat > /etc/yum.repos.d/epel.repo EOF
[epel]
name=Extra Packages for Enterprise Linux 6 - \$basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/\$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6arch=\$basearch
failovermethod=priority
enabled=1
gpgcheck=0
EOF

添加PUIAS Computational參考

復(fù)制代碼
代碼如下:

cat > /etc/yum.repos.d/PUIAS_6_computational.repo EOF
[PUIAS_6_computational]
name=PUIAS computational Base \$releasever - \$basearch
mirrorlist=http://puias.math.ias.edu/data/puias/computational/\$releasever/\$basearch/mirrorlist
#baseurl=http://puias.math.ias.edu/data/puias/computational/\$releasever/\$basearch
enabled=1
gpgcheck=0
EOF

安裝依賴包

復(fù)制代碼
代碼如下:

yum -y install vim-enhanced readline readline-devel ncurses-devel \
gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel \
db4-devel byacc sqlite-devel gcc-c++ libyaml libyaml-devel libffi \
libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel \
system-config-firewall-tui python-devel crontabs logwatch \
logrotate perl-Time-HiRes git

Ruby安裝

復(fù)制代碼
代碼如下:

cd lnmp/src
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz
tar xzf ruby-2.1.5.tar.gz
cd ruby-2.1.5
./configure --prefix=/usr/local/ruby
make make install
cd ..

添加到環(huán)境變量

復(fù)制代碼
代碼如下:

vi /etc/profile
export PATH=/usr/local/ruby/bin:$PATH
. /etc/profile

安裝Bundler Gem

復(fù)制代碼
代碼如下:

gem install bundler --no-ri --no-rdoc

為GitLab創(chuàng)建一個git用戶

復(fù)制代碼
代碼如下:

adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git
su - git

GitLab shell安裝

復(fù)制代碼
代碼如下:

git clone https://github.com/gitlabhq/gitlab-shell.git
cd gitlab-shell
git checkout v1.8.0
cp config.yml.example config.yml
sed -i 's@http://localhost/@http://git.jb51.net/@' config.yml
sed -i 's@/usr/bin/redis-cli@/usr/local/redis/bin/redis-cli@' config.yml
./bin/install

數(shù)據(jù)庫/MySQL

復(fù)制代碼
代碼如下:

$ mysql -uroot -p
mysql> create database gitlabhq_production;
mysql> quit;

redis.sock路徑指定

復(fù)制代碼
代碼如下:

su -
service redis-server stop
mkdir /var/run/redis;chown -R redis.redis /var/run/redis
vi /usr/local/redis/etc/redis.conf
unixsocket /var/run/redis/redis.sock
service redis-server start
ls -l /var/run/redis/redis.sock
GitLab
su - git
wget https://github.com/gitlabhq/gitlabhq/archive/v7.4.5.tar.gz
tar xzvf v7.4.5.tar.gz
mv gitlabhq-7.4.5 gitlab
cd gitlab
cp config/gitlab.yml.example config/gitlab.yml
sed -i 's@localhost@git.jb51.net@g' config/gitlab.yml
chown -R git log/
chown -R git tmp/
chmod -R u+rwX log/
chmod -R u+rwX tmp/
mkdir /home/git/gitlab-satellites
mkdir tmp/pids/
mkdir tmp/sockets/
chmod -R u+rwX tmp/pids/
chmod -R u+rwX tmp/sockets/
mkdir public/uploads
chmod -R u+rwX public/uploads
cp config/unicorn.rb.example config/unicorn.rb
git config --global user.name "GitLab"
git config --global user.email "gitlab@jb51.net"
git config --global core.autocrlf input
cp config/resque.yml.example config/resque.yml

GitLab數(shù)據(jù)庫配置

復(fù)制代碼
代碼如下:

cp config/database.yml{.mysql,}
cat config/database.yml
production:
adapter: mysql2
encoding: utf8
collation: utf8_general_ci
reconnect: false
database: gitlabhq_production
pool: 10
username: root
password: "password"
# host: localhost
# socket: /tmp/mysql.sock
chmod o-rwx config/database.yml

Gems安裝

復(fù)制代碼
代碼如下:

su -
gem install charlock_holmes --version '0.6.9.4'
exit
cd /home/git/gitlab/
bundle install --deployment --without development test postgres puma aws postgres

GitLab shell安裝

復(fù)制代碼
代碼如下:

bundle exec rake gitlab:shell:install[v2.1.0] REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production
vi /home/git/gitlab-shell/config.yml

修改正確路徑,如redis-cli,路徑改成bin: "/usr/local/bin/redis-cli"

復(fù)制代碼
代碼如下:

restorecon -Rv /home/git/.ssh

初始化數(shù)據(jù)庫和激活高級功能

復(fù)制代碼
代碼如下:

git init
bundle exec rake gitlab:setup RAILS_ENV=production #yes
login.........root
password......5iveL!fe

GitLab初始化腳本

復(fù)制代碼
代碼如下:

su -
wget -O /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/master/init/sysvinit/centos/gitlab-unicorn
chmod +x /etc/init.d/gitlab
chkconfig --add gitlab
chkconfig gitlab on
exit #切回git用戶

檢查應(yīng)用狀態(tài)

復(fù)制代碼
代碼如下:

cd /home/git/gitlab/
bundle exec rake gitlab:env:info RAILS_ENV=production
Compile assets
bundle exec rake assets:precompile RAILS_ENV=production

GitLab啟動

復(fù)制代碼
代碼如下:

su -
service gitlab start
Nginx配置
usermod -a -G git www
chmod 770 /home/git
mkdir /usr/local/nginx/conf/vhost
cd /usr/local/nginx/conf/vhost
wget -O git.jb51.net.conf https://gitlab.com/gitlab-org/gitlab-ce/raw/master/lib/support/nginx/gitlab-ssl
vi git.jb51.net.conf #修改一下配置項
root /home/git/gitlab/public;
server_name
access_log
error_log
ssl_certificate gitlab.crt;
ssl_certificate_key gitlab.key;

ps:證書生成方法如下(正式環(huán)境建議將生成公鑰用第三方簽名使瀏覽器能識別):

復(fù)制代碼
代碼如下:

cd /usr/local/nginx/conf
openssl genrsa -out gitlab.key 2048
openssl req -new -x509 -days 36500 -key gitlab.key -out gitlab.crt -subj "/C=CN/ST=Shanghai/L=Shanghai/O=LinuxEye Ltd./OU=LinuxEye"

重啟nginx

復(fù)制代碼
代碼如下:

service nginx restart

訪問:https://git.jb51.net,用戶名/密碼:root/5iveL!fe

標(biāo)簽:忻州 銅仁 邢臺 甘南 來賓 甘孜 泉州 周口

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《CentOS系統(tǒng)中GitLab客戶端的安裝教程》,本文關(guān)鍵詞  CentOS,系統(tǒng),中,GitLab,客戶端,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《CentOS系統(tǒng)中GitLab客戶端的安裝教程》相關(guān)的同類信息!
  • 本頁收集關(guān)于CentOS系統(tǒng)中GitLab客戶端的安裝教程的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    大荔县| 澎湖县| 临邑县| 青海省| 淳化县| 黄龙县| 商城县| 东乌珠穆沁旗| 清流县| 青海省| 永泰县| 偏关县| 临武县| 甘南县| 连州市| 平顺县| 沂南县| 梧州市| 治多县| 清流县| 南平市| 沙坪坝区| 山阳县| 斗六市| 礼泉县| 美姑县| 宣威市| 思茅市| 武宁县| 西乡县| 理塘县| 花垣县| 金山区| 湾仔区| 盐边县| 肥西县| 辽宁省| 南江县| 清水河县| 康平县| 通河县|