久久久精品一区ed2k-女人被男人叉到高潮的视频-中文字幕乱码一区久久麻豆樱花-俄罗斯熟妇真实视频

gitlab部署

一、配置epel源

融水網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)建站,融水網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為融水近千家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請找那個售后服務(wù)好的融水做網(wǎng)站的公司定做!

wget   http://mirrors.aliyun.com/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm  -ivh  epel-release-6-8.noarch.rpm

二、安裝依賴包

yum -y install libicu-devel patch gcc-c++ readline-devel zlib-devel libffi-devel openssl-devel make cmake autoconf automake libtool bison libxml2-devel libxslt-devel libyaml-devel zlib-devel openssl-devel cpio expat-devel gettext-devel curl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker

三、安裝git

下載鏈接:

wget -O git-src.zip https://github.com/git/git/archive/master.zip

[root@localhost ~]# unzip git-src.zip
[root@localhost ~]# cd git-master/
[root@localhost git-master]# make prefix=/usr/local all
[root@localhost git-master]# make prefix=/usr/local install
[root@localhost git-master]# ln -fs /usr/local/bin/git* /usr/bin/

四、安裝ruby

[root@localhost src]# wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-2.1.5.tar.gz
[root@localhost src]# tar-zxf ruby-2.1.5.tar.gz
[root@localhost src]# cd ruby-2.1.5
[root@localhost ruby-2.1.5]# ./configure --disable-install-rdoc && make && make install
[root@localhost ~]# ln -s /usr/local/bin/ruby /usr/bin/ruby
[root@localhost ~]# ln -s /usr/local/bin/gem /usr/bin/gem
[root@localhost ~]# gem install bundler --no-ri --no-rdoc
[root@localhost ~]# ln -s /usr/local/bin/bundle /usr/bin/bundle

五、安裝MySQL并初始化gitlab庫

[root@localhost ~]# yum -y install mysql mysql-devel mysql-server
[root@localhost ~]# service mysqld start
[root@localhost ~]# chkconfig mysqld on
[root@localhost ~]# mysql
mysql> create database gitlab;
mysql> grant all privileges on gitlab.* to 'gitlab'@'localhost' identified by 'gitlab';

 

測試是否可以用gitlab登錄數(shù)據(jù)庫:

[root@localhost ~]# mysql -u gitlab -p -D gitlab
Enter password:

 

六、安裝redis

[root@localhost ~]# yum -y install redis
[root@localhost ~]# vi /etc/redis.conf
  36 unixsocket /tmp/redis.sock
 37 unixsocket perm 755
[root@localhost ~]# service redis start
[root@localhost ~]# chkconfig redis on

七、創(chuàng)建git用戶并允許sudo

[root@localhost ~]# useradd git
echo "git ALL=(ALL)       NOPASSWD: ALL" >> /etc/sudoers

八、安裝gitlab

[root@localhost ~]# cd /home/git/
[root@localhost git]# sudo -u git -H git clone   -b 7-8-stable gitlab
[root@localhost git]# cd gitlab
[root@localhost gitlab]# cp config/gitlab.yml.example config/gitlab.yml
[root@localhost gitlab]# vi config/gitlab.yml
  20     host: localhost
  21     port: 80
  267    bin_path: /usr/bin/git
[root@localhost gitlab]# chown -R git log/
[root@localhost gitlab]# chown -R git tmp/
[root@localhost gitlab]# chmod -R u+rwX log/
[root@localhost gitlab]# chmod -R u+rwX tmp/
[root@localhost gitlab]# sudo -u git -H mkdir /home/git/gitlab-satellites
[root@localhost gitlab]# sudo chmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellites
[root@localhost gitlab]# chmod -R u+rwX tmp/pids/
[root@localhost gitlab]# chmod -R u+rwX tmp/sockets
[root@localhost gitlab]# chmod -R u+rwX public/uploads/
[root@localhost gitlab]# cp config/unicorn.rb.example  config/unicorn.rb
[root@localhost gitlab]# cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb

以上不存在的目錄,手動創(chuàng)建。

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

[root@localhost gitlab]# cp config/database.yml.mysql config/database.yml
[root@localhost gitlab]# vi config/database.yml
  9  database: gitlab       #這里的數(shù)據(jù)庫要跟在mysql中創(chuàng)建的庫名一致。
 10  pool: 10
 11  username: gitlab
 12  password: gitlab

九、安裝gitlab-shell

[root@localhost ~]# cd /home/git/
[root@localhost git]# sudo -u git -H git clone   -b v2.6.0
[root@localhost git]# cd gitlab-shell/
[root@localhost gitlab-shell]# cp config.yml.example config.yml
[root@localhost gitlab-shell]# vi config.yml
  9      gitlab_url: http://localhost:8080/
  30   bin: /usr/bin/redis-cli
[root@localhostgitlab-shell]# sudo -u git -H ./bin/install

十、nginx安裝

[root@localhost src]# tar -zxf pcre-8.38.tar.gz
[root@localhost src]# cd pcre-8.38
[root@localhostp cre-8.38]# ./configure --prefix=/usr/local/pcre-8.38 && make && make install
[root@localhost src]# wget http://124.205.69.171/files/8095000002FE839E/nginx.org/download/nginx-1.8.1.tar.gz
[root@localhost src]# tar -zxf nginx-1.8.1.tar.gz
[root@localhost src]# cd nginx-1.8.1
[root@localhost nginx-1.8.1]# ./configure  --prefix=/usr/local/nginx --user=git  --group=git--with-http_ssl_module  --with-http_stub_status_module --with-pcre=/usr/local/src/pcre-8.38/  && make  && make install

十一、安裝需要的gems

[root@localhost ~]# cd /home/git/gitlab
[root@localhost gitlab]# sudo -u git -H bundle install --deployment --without development testpostgres aws

十二、初始化數(shù)據(jù)庫

[root@localhost gitlab]# sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production

十三、拷貝啟動文件腳本及日志切割文件

[root@localhost gitlab]# cp lib/support/init.d/gitlab /etc/init.d/gitlab
[root@localhost gitlab]# cp lib/support/init.d/gitlab.default.example /etc/default/gitlab
[root@localhost gitlab]# cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab

十四、設(shè)置git賬號信息

[root@localhost gitlab]# sudo -u git -H "/usr/bin/git" config --global user.name  "GitLab"
[root@localhost gitlab]# sudo -u git -H "/usr/bin/git" config --global user.email "example@example.com"
[root@localhost gitlab]# sudo -u git -H "/usr/bin/git" config --global core.autocrlf "input"

十五、配置nginx

[root@localhost ~]# vi /usr/local/nginx/conf/nginx.conf
    upstream gitlab {
        server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
    }
    server {
        listen       80;
        server_name  localhost;
 
        access_log  /var/log/nginx/gitlab_access.log;
        error_log   /var/log/nginx/gitlab_error.log;
 
        root  /home/git/gitlab/public;
 
        location / {
            try_files $uri $uri/index.html $uri.html @gitlab;
        }
 
        location @gitlab {
            proxy_read_timeout 300;
            proxy_connect_timeout 300;
            proxy_redirect     off;
 
            proxy_set_header   X-Forwarded-Proto $scheme;
            proxy_set_header   Host           $http_host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
 
            proxy_pass http://gitlab;
        }
 
}
[root@localhost ~]# mkdir -p /var/log/nginx
[root@localhost ~]# chown -R git:git/var/log/nginx/
[root@localhost ~]# chown -R git:git /usr/local/nginx/
[root@localhost ~]# /usr/local/nginx/sbin/nginx -t
[root@localhost gitlab]# service nginx restart

十六、檢測當(dāng)前環(huán)境

[root@localhostgitlab]# sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

可能會有報錯:Error: Table 'gitlab.projects' doesn't exist

這時重新初始化數(shù)據(jù)庫,執(zhí)行以下命令:

[root@localhost gitlab]# sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production

會發(fā)現(xiàn),執(zhí)行結(jié)束時生成了一個登錄賬號和密碼:

login.........root
password......5iveL!fe 用來登錄gitlab

再次執(zhí)行環(huán)境檢測命令……OK

十七、拉取gitlab靜態(tài)資源文件

[root@localhost gitlab]# sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production

十八、啟動gitlab

[root@localhost gitlab]# /etc/init.d/gitlab start
[root@localhost gitlab]# sudo chmod -R ug+rwX,o-rwx /home/git/repositories/
[root@localhost gitlab]# sudo chmod -R ug-s /home/git/repositories/
[root@localhost gitlab]# find /home/git/repositories/ -type d -print0 | sudo xargs -0 chmod g+s

十九、檢測各個組件是否正常工作

[root@localhost gitlab]#sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

錯誤一:Send ping to redisserver: Could not connect to Redis at /tmp/redis.sock: Permission denied

[root@localhost gitlab]#vi /home/git/gitlab-shell/config.yml
35   #socket: /tmp/redis.sock # Comment out thisline if you want to use TCP

錯誤二:用瀏覽器訪問時,出現(xiàn)“502 Bad Gateway”

編譯nginx時指定--user=git --group=git

[root@localhost ~]# vi/usr/local/nginx/conf/nginx.conf
  2 user git;

文章名稱:gitlab部署
鏈接分享:http://sd-ha.com/article38/jgedpp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動網(wǎng)站建設(shè)、網(wǎng)站收錄、商城網(wǎng)站、網(wǎng)站排名、Google域名注冊

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作