服務(wù)器
前言
京山網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)建站,京山網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為京山上千多家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)營(yíng)銷網(wǎng)站建設(shè)要多少錢,請(qǐng)找那個(gè)售后服務(wù)好的京山做網(wǎng)站的公司定做!原來(lái)的項(xiàng)目放在公網(wǎng)的gitlab上,處于安全考慮,在內(nèi)網(wǎng)搭建一套,有圖形界面,可以直接從外網(wǎng)git導(dǎo)入進(jìn)來(lái),使用了一下覺(jué)得挺方便,把安裝流程記錄下來(lái),參考官網(wǎng):https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/install/centos 可以直接移步那里看
基本環(huán)境安裝(git\\Redis\\ruby\\mysql...)
yum -y groupinstall \'Development Tools\' yum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc sqlite-devel libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui redis sudo wget crontabs logwatch logrotate perl-Time-HiRes git cmake libcom_err-devel.i686 libcom_err-devel.x86_64 nodejs yum -y install python-docutils yum -y install postfix git --version #安裝高于2.7.4的git版本 yum -y remove git yum install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel mkdir /tmp/git && cd /tmp/git curl --progress https://www.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz | tar xz cd git-2.9.0 ./configure make make prefix=/usr/local install yum remove ruby #安裝高于2.1版本的ruby,刪除老的 mkdir /tmp/ruby && cd /tmp/ruby curl --progress https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.9.tar.gz | tar xz cd ruby-2.1.9 ./configure --disable-install-rdoc make make prefix=/usr/local install gem install bundler --no-doc yum install redis Mysql /Data/apps/MYSQL/bin/mysqld_safe & /Data/apps/mysql/bin/mysql -uroot mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; mysql> grant all on gitlabhq_production.* to \'git\'@\'localhost\' identified by \'git\';
配置redis
vim /etc/redis.conf
unixsocket /var/run/redis/redis.sock unixsocketperm 0770
mkdir -p /var/run/redis chown redis:redis /var/run/redis chmod 755 /var/run/redis /etc/init.d/redis start usermod -aG redis git
配置gitlab相關(guān)
# 下載git,用的國(guó)內(nèi)源。國(guó)外的太慢了 cd /home/git sudo -u git -H git clone http://git.oschina.net/qiai365/gitlab-ce gitlab cd /home/git/gitlab sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml sudo -u git -H editor config/gitlab.yml # 修改成自己的host host: iaasgit1.prod.bj1 sudo -u git -H cp config/secrets.yml.example config/secrets.yml sudo -u git -H chmod 0600 config/secrets.yml sudo chown -R git log/ sudo chown -R git tmp/ sudo chmod -R u+rwX,go-w log/ sudo chmod -R u+rwX tmp/ sudo chmod -R u+rwX tmp/pids/ sudo chmod -R u+rwX tmp/sockets/ sudo -u git -H mkdir public/uploads/ sudo chmod 0700 public/uploads sudo chmod ug+rwX,o-rwx /home/git/repositories/ sudo chmod -R u+rwX builds/ sudo chmod -R u+rwX shared/artifacts/ sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb nproc sudo -u git -H editor config/unicorn.rb sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb sudo -u git -H git config --global core.autocrlf input sudo -u git -H git config --global gc.auto 0 sudo -u git -H cp config/resque.yml.example config/resque.yml sudo -u git -H editor config/resque.yml
配置db部分 only for mysql
sudo -u git cp config/database.yml.mysql config/database.yml sudo -u git -H editor config/database.yml #配置production部分的password: 密碼 sudo -u git -H chmod o-rwx config/database.yml
安裝gitlab相關(guān),并啟動(dòng)
# install gems cd /home/git/gitlab sudo -u git -H bundle install --deployment --without development test postgres aws kerberos # install gitlab shell sudo -u git -H bundle exec rake gitlab:shell:install[v3.3.3] REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production sudo -u git -H editor /home/git/gitlab-shell/config.yml # install gitlab-workhorse cd /home/git sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git cd gitlab-workhorse sudo -u git -H git checkout v0.7.5 sudo -u git -H make # Initialize Database and Activate Advanced Features cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production GITLAB_ROOT_PASSWORD=yourpassword GITLAB_ROOT_EMAIL=youremail cp lib/support/init.d/gitlab /etc/init.d/gitlab cp lib/support/init.d/gitlab.default.example /etc/default/gitlab chkconfig gitlab on cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production service gitlab start
配置nginx
yum install nginx cp lib/support/nginx/gitlab /Data/apps/nginx/conf/include/gitlab.conf usermod -a -G git nginx chmod g+rx /home/git/ /Data/apps/nginx/conf/include/gitlab.conf #把這個(gè)配置里的server_name配置好
最后check一下
cd /home/git/gitlab sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production # 啟動(dòng)gitlab /etc/init.d/gitlab restart # 直接打開(kāi)server_name對(duì)應(yīng)的url,發(fā)現(xiàn)樣式都沒(méi)了,執(zhí)行 sudo -u git -H bundle exec rake assets:clean assets:precompile REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production
最后說(shuō)明一下
這個(gè)只是記一個(gè)流水賬,里邊可能涉及到權(quán)限之類的問(wèn)題,在確保一下nginx\\git互相之間是否有權(quán)限,另外用check腳本進(jìn)行check,提示很友好,一般都能搞定,祝你成功。
中間使用的yum由于用的是重寫打包過(guò)的rpm,路徑和默認(rèn)的不同,如果你用的默認(rèn)的,可以根據(jù)自己情況改一下,或者直接參考官網(wǎng),我這就是官網(wǎng)的一個(gè)根據(jù)自己環(huán)境的閹割版。
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持創(chuàng)新互聯(lián)。
當(dāng)前題目:centos6搭建gitlab的方法步驟
分享路徑:http://www.rwnh.cn/article16/cpcddg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊(cè)、虛擬主機(jī)、外貿(mào)建站、企業(yè)網(wǎng)站制作、網(wǎng)站導(dǎo)航、App開(kāi)發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)