{"id":545,"date":"2014-03-19T18:04:28","date_gmt":"2014-03-19T09:04:28","guid":{"rendered":"http:\/\/lovelinux.mydns.jp\/?p=545"},"modified":"2014-08-22T23:08:03","modified_gmt":"2014-08-22T14:08:03","slug":"debianubuntulmde-%e3%81%ab-gitlab-6-6-5%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%97%e3%80%81nginx%e3%81%ae%e3%82%b5%e3%83%96%e3%83%95%e3%82%a9%e3%83%ab%e3%83%80%e3%81%a7","status":"publish","type":"post","link":"https:\/\/lovelinux.mydns.jp\/?p=545","title":{"rendered":"debian\/ubuntu \u306b GitLab 6.6.5\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001nginx\u306e\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u3067\u516c\u958b\u3059\u308b"},"content":{"rendered":"<p><a href=\"http:\/\/lovelinux.mydns.jp\/?p=130\">CentOS\u306bGitLab\u3092\u5c0e\u5165\u3059\u308b\u30e1\u30e2<\/a>\u3092\u66f8\u3044\u305f\u3089\u5999\u306b\u30a2\u30af\u30bb\u30b9\u6570\u304c\u591a\u304b\u3063\u305f\u306e\u3067\u3001debian\u7cfbOS\u3067GitLab6.6.5\uff08\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u3042\u307e\u308a\u6c17\u306b\u3057\u306a\u304f\u3066\u3082\u3001\u540c\u3058\u624b\u9806\u3067OK\u3067\u3059\u3002\uff09\u3092\u516c\u958b\u3059\u308b\u65b9\u6cd5\u3092\u66f8\u3044\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002CentOS\u306e\u6642\u306f\u30db\u30b9\u30c8\u3059\u308bWeb\u30b5\u30fc\u30d0\u30fc\u3092Apache\u3068\u3057\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306fnginx\u306e\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u3067\u516c\u958b\u3059\u308b\u65b9\u6cd5\u3092\u304a\u4f1d\u3048\u3057\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u306f debian wheezy 7.4\u3067\u3057\u304b\u52d5\u4f5c\u691c\u8a3c\u3057\u3066\u3044\u307e\u305b\u3093\u3002Ubuntu\u3001LMDE\u3067\u3082\u554f\u984c\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3082\u3057\u4e0d\u90fd\u5408\u7b49\u767a\u898b\u3055\u308c\u305f\u5834\u5408\u306f\u3001\u30b3\u30e1\u30f3\u30c8\u6b04\u306b\u30b3\u30e1\u30f3\u30c8\u3044\u305f\u3060\u3051\u308b\u3068\u52a9\u304b\u308a\u307e\u3059\u3002<\/p>\n<p>\u524d\u534a\u306f\u3001GitLab\u81ea\u4f53\u304cRuby On Rails\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308b\u306e\u3067\u3001Rails\u306e\u74b0\u5883\u69cb\u7bc9\u3092\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u5f8c\u534a\u306fGitlab\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3001nginx\u3068\u306e\u9023\u643a\u3068\u306a\u308a\u307e\u3059\u3002\u9577\u3044\u3051\u3069\u3001\u9811\u5f35\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01 <\/p>\n<h4>\u8ffd\u8a18<\/h4>\n<p>Ubuntu 12.04.4 Server\u3067\u306e\u691c\u8a3c\u7d42\u4e86\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u7528\u610f\u3055\u308c\u3066\u3044\u308bRuby\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c1.8\u3067\u3057\u305f\u306e\u3067\u3001\u554f\u984c\u3042\u308a\u3067\u3059\u3002PPA\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u3057\u3001Ruby2.1\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u3067\u3001\u7121\u4e8bGitLab\u74b0\u5883\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\uff08PPA\u8ffd\u52a0\u306e\u3042\u305f\u308a\u3082\u8a18\u8f09\u6e08\u307f\u3067\u3059\u3002\uff09<\/p>\n<h3>\u524d\u63d0\u6761\u4ef6<\/h3>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>Web\u30b5\u30fc\u30d0\u30fc\u306bnginx\u3092\u7528\u3044\u307e\u3059\u3002<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>Rails\u3068nginx\u306e\u9023\u643a\u306fpassenger\u3067\u884c\u3044\u307e\u3059\u3002<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>GitLab\u306fnginx\u306e\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u3067\u516c\u958b\u3057\u307e\u3059\u3002<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>\u516c\u958b\u30db\u30b9\u30c8\u540d\u3092 www.myhost.jp \u3068\u3059\u308b\u3002<\/p>\n<p class=\"point1\"><i class=\"fa fa-hand-o-right\"><\/i>GitLab\u516c\u958bURL\u3092 http:\/\/www.myhost.jp\/gitlab \u3068\u3059\u308b\u3002<\/p>\n<h3>git \u30e6\u30fc\u30b6\u30fc\u306e\u4f5c\u6210\u3068 sudo\u6a29\u9650<\/h3>\n<p>\u3053\u308c\u304c\u30d9\u30b9\u30c8\u306a\u65b9\u6cd5\u304b\u3001\u5c11\u3005\u7591\u554f\u3067\u3059\u304c\u3001\u4f5c\u696d\u306f\u3059\u3079\u3066\u65b0\u898f\u306b\u4f5c\u6210\u3059\u308bgit \u30e6\u30fc\u30b6\u30fc\u3067\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>git\u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u304a\u4efb\u305b\u3057\u307e\u3059\u3002<br \/>\n[bash]<br \/>\n$ sudo useradd git -md \/home\/git -s \/bin\/bash<br \/>\n$ sudo passwd git<br \/>\n$ sudo nano \/etc\/suders<br \/>\n[\/bash]<\/p>\n<p>git\u30e6\u30fc\u30b6\u30fc\u3092sudo\u53ef\u80fd\u306a\u30e6\u30fc\u30b6\u30fc\u306b\u52a0\u3048\u307e\u3059\u3002<br \/>\n[diff mark=&#8221;3&#8243;]<br \/>\n# User privilege specification<br \/>\nroot    ALL=(ALL:ALL) ALL<br \/>\n+ git     ALL=(ALL:ALL) ALL<\/p>\n<p>[\/diff]<\/p>\n<h3>\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u7fa4\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u3042\u307e\u308a\u6df1\u304f\u8003\u3048\u305a\u306b\u3001\u4ee5\u4e0b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30c9\u30ab\u30fc\u30f3\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3061\u3083\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>[bash]<br \/>\n$ su &#8211; git<\/p>\n<p>$ sudo apt-get install curl git build-essential libgtk2.0-dev libmysqlclient-dev mysql-server dialog zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev python-docutils sysv-rc-conf<\/p>\n<p>[\/bash]<\/p>\n<h3>gemrc\u4f5c\u6210<\/h3>\n<p>\u3053\u308c\u306fRuby\u306e\u304a\u4f5c\u6cd5\u307f\u305f\u3044\u306a\u3082\u306e\u306a\u306e\u3067\u6c17\u306b\u305b\u305a\u306b\u3053\u306e\u901a\u308a\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n[bash]<br \/>\n$ nano ~\/.gemrc<br \/>\n[\/bash]<\/p>\n<p>gem \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u3092\u7701\u7565\u3057\u307e\u3059\u3002<br \/>\n[bash]<br \/>\ngem: &#8211;no-ri &#8211;no-rdoc<br \/>\n[\/bash]<\/p>\n<h3>Ruby\/Rails \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>Ruby\u306e\u30d0\u30fc\u30b8\u30e7\u30f3 1.9 \u4ee5\u4e0a\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u5834\u5408\u3002<br \/>\n\uff08\u3053\u3053\u6700\u8fd1\u306e\u3082\u306e\u3067\u3042\u308c\u3070\u3000OK\u306a\u306f\u305a\u3067\u3059\u3002\uff09<br \/>\nUbuntu12.04\u306f Ruby1.8\u3000\u306a\u306e\u3067\u3001\u3053\u3053\u3092\u98db\u3070\u3057\u3066\u3001\u6b21\u306e\u9805\u76ee\u306b\u9032\u3093\u3067ppa\u304b\u3089Ruby2.1\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>[bash]<br \/>\n$ sudo apt-get install ruby ruby-dev<br \/>\n$ sudo gem install rails<\/p>\n<p>[\/bash]<\/p>\n<p><strong>Ubuntu 12.04\u306e\u5834\u5408<\/strong><br \/>\n[bash]<br \/>\nsudo apt-get install python-software-properties<br \/>\nsudo apt-add-repository ppa:brightbox\/ruby-ng<br \/>\nsudo apt-get update<br \/>\nsudo apt-get install ruby2.1 ruby2.1-dev<\/p>\n<p>sudo gem install rails<br \/>\n[\/bash]<\/p>\n<h3>REDIS\u8d77\u52d5\u3001\u8d77\u52d5\u8a2d\u5b9a<\/h3>\n<p>[bash]<br \/>\n$ sudo service redis-server restart<br \/>\n$ sudo sysv-rc-conf redis-server on<br \/>\n[\/bash]<\/p>\n<p>\u3053\u308c\u3067\u3001\u524d\u534a\u7d42\u4e86\u3067\u3059\u3002\u6b21\u304b\u3089GitLab\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u5165\u308a\u307e\u3059\uff01<\/p>\n<h3>Gitlab-shell\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>[bash]<br \/>\n$ git config &#8211;global user.name &#8220;GitLab&#8221;<br \/>\n$ git config &#8211;global user.email &#8220;gitlab@localhost&#8221;<br \/>\n$ git clone https:\/\/github.com\/gitlabhq\/gitlab-shell.git<br \/>\n$ cd gitlab-shell\/<br \/>\n$ git checkout -b 1.8.5 v1.8.5<br \/>\n$ cp config.yml.example config.yml<br \/>\n$ nano config.yml<br \/>\n[\/bash]<\/p>\n<p>\u4ee5\u4e0b\u306eURL\u6307\u5b9a\u306e\u90e8\u5206\u3092\u8abf\u6574\uff08gitlab\u3092\u30db\u30b9\u30c8\u3059\u308bURL\u3092\u8a18\u8ff0\uff09<\/p>\n<p>[diff]<br \/>\n&#8211; gitlab_url: &#8220;http:\/\/localhost\/&#8221;\u3000\u2190\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8<br \/>\n+ gitlab_url: &#8220;http:\/\/www.myhost.jp\/gitlab\/&#8221;<br \/>\n[\/diff]<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b9f\u884c<br \/>\n[bash]<br \/>\n$ .\/bin\/install <\/p>\n<p>[\/bash]<\/p>\n<h3>gitlab\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>github\u304b\u3089\u30bd\u30fc\u30b9\u3092\u30af\u30ed\u30fc\u30f3\u3057\u307e\u3059\u3002\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304b\u306a\u308a\u6642\u9593\u98df\u3044\u307e\u3059\u3002\u5408\u8a08\uff17\uff10\uff4d\uff42\u3050\u3089\u3044\uff09<\/p>\n<p>[bash]<\/p>\n<p>$ cd \/home\/git<br \/>\n$ git clone https:\/\/github.com\/gitlabhq\/gitlabhq.git gitlab<br \/>\n$ cd gitlab<br \/>\n$ git checkout -b 6.6.5 v6.6.5<br \/>\n$ cp config\/gitlab.yml.example config\/gitlab.yml<br \/>\n$ nano config\/gitlab.yml<br \/>\n[\/bash]<\/p>\n<h4>\u30db\u30b9\u30c8\u540d\u8a2d\u5b9a\uff08gitlab\u3092\u30db\u30b9\u30c8\u3059\u308bURL\u3092\u8a18\u8ff0\uff09\u3001\u76f8\u5bfe\u30eb\u30fc\u30c8\u306e\u8a2d\u5b9a<\/h4>\n<p>[diff]<br \/>\n&#8211;   host: localhost<br \/>\n+   host: www.myhost.jp<\/p>\n<p>    https: false<\/p>\n<p>    # Uncomment and customize the last line to run in a non-root path<br \/>\n    # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this. <\/p>\n<p>    # Note that four settings need to be changed for this to work.<br \/>\n    # 1) In your application.rb file: config.relative_url_root = &#8220;\/gitlab&#8221;<br \/>\n    # 2) In your gitlab.yml file: relative_url_root: \/gitlab<br \/>\n    # 3) In your unicorn.rb: ENV[&#8216;RAILS_RELATIVE_URL_ROOT&#8217;] = &#8220;\/gitlab&#8221;<br \/>\n    # 4) In ..\/gitlab-shell\/config.yml: gitlab_url: &#8220;http:\/\/127.0.0.1\/gitlab&#8221;<br \/>\n    # To update the path, run: sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production<\/p>\n<p>    #<br \/>\n&#8211;    # relative_url_root: \/gitlab<br \/>\n+    relative_url_root: \/gitlab<\/p>\n<p>[\/diff]<\/p>\n<h4>\u76f8\u5bfe\u30d1\u30b9\u306e\u8a2d\u5b9a<\/h4>\n<p>[bash]<br \/>\n$ nano config\/application.rb<br \/>\n[\/bash]<\/p>\n<p>\u3053\u306e\u6700\u5f8c\u306e\u884c\u3092\u8ffd\u52a0\u3059\u308b\u306e\u304c\u308f\u304b\u3089\u305a\u306b\u6570\u6642\u9593\u60a9\u307f\u307e\u3057\u305f\u30fb\u30fb\u30fb\u30fb<\/p>\n<p>[diff mark=&#8221;2,14&#8243;]<br \/>\n&#8211;    # config.relative_url_root = &#8220;\/gitlab&#8221;<br \/>\n+    config.relative_url_root = &#8220;\/gitlab&#8221;<\/p>\n<p>      \u301c\u7701\u7565\u301c<\/p>\n<p>      end<br \/>\n    end<br \/>\n  end<br \/>\nend<\/p>\n<p>&#8211;<br \/>\n+ ENV[&#8216;RAILS_RELATIVE_URL_ROOT&#8217;] = &#8220;\/gitlab&#8221;<\/p>\n<p>[\/diff]<\/p>\n<h4>Mysql\u306e\u30e6\u30fc\u30b6\u540d\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a(Production\u30e2\u30fc\u30c9)<\/h4>\n<p>[bash]<br \/>\n$ cp config\/database.yml.mysql config\/database.yml<br \/>\n$ nano config\/database.yml<br \/>\n[\/bash]<\/p>\n<p>[diff]<br \/>\n\t#<br \/>\n\t# PRODUCTION<br \/>\n\t#<br \/>\n\tproduction:<br \/>\n\t  adapter: mysql2<br \/>\n\t  encoding: utf8<br \/>\n\t  reconnect: false<br \/>\n\t  database: gitlabhq_production<br \/>\n\t  pool: 10<br \/>\n&#8211;\t  username: git<br \/>\n&#8211;\t  password: &#8220;secure password&#8221;<br \/>\n+\t  username: root<br \/>\n+\t  password: &#8220;xxxxxxxxx&#8221;<br \/>\n\t  # host: localhost<br \/>\n\t  # socket: \/tmp\/mysql.sock<br \/>\n[\/diff]<\/p>\n<h4>\u30d0\u30f3\u30c9\u30eb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff08\u304b\u306a\u308a\u9577\u3044\u6642\u9593\u3092\u8981\u3057\u307e\u3059\uff09<\/h4>\n<p>[bash]<br \/>\n$ bundle install &#8211;deployment &#8211;without development test postgres<br \/>\n[\/bash]<\/p>\n<p>\u79c1\u306e\u74b0\u5883\u3067\u306f\u4e00\u5ea6\u76ee\u306ebundle install \u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3057\u305f\u304c\u3001\u30b3\u30cd\u30af\u30b7\u30e7\u30f3 \u30ea\u30bb\u30c3\u30c8 \u306a\u306e\u3067\u3001\u518d\u5ea6\u540c\u3058\u30b3\u30de\u30f3\u30c9\uff08\u4e0a\u306e\u3082\u306e\uff09\u3092\u5b9f\u884c\u3057\u3066\u7121\u4e8b\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>[bash]<br \/>\nGem::RemoteFetcher::FetchError: Errno::ECONNRESET: Connection reset by peer &#8211; SSL_connect (https:\/\/rubygems.org\/gems\/rack-protection-1.5.1.gem)<br \/>\nAn error occurred while installing rack-protection (1.5.1), and Bundler cannot<br \/>\ncontinue.<br \/>\nMake sure that `gem install rack-protection -v &#8216;1.5.1&#8217;` succeeds before<br \/>\nbundling.<br \/>\n[\/bash]<\/p>\n<h4>\u4e0d\u8db3\u30d5\u30a9\u30eb\u30c0\u4f5c\u6210<\/h4>\n<p>[bash]<br \/>\n$ mkdir \/home\/git\/gitlab\/tmp\/pids<br \/>\n$ mkdir \/home\/git\/gitlab\/public\/uploads<br \/>\n[\/bash]<\/p>\n<h4>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4f5c\u6210<\/h4>\n<p>\u82f1\u8a9e\u3067\u3001\u524d\u306e\u30c7\u30fc\u30bf\u304c\u5931\u308f\u308c\u308b\u3088\u3002\u65b0\u898f\u306e\u30c7\u30fc\u30bf\u3092seed\u304b\u3089\u4f5c\u308b\u3051\u3069\u3044\u3044\uff1f\u307f\u305f\u3044\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u307e\u3059\u304c\u3001 yes \u3068\u5165\u529b\u3057\u3066\u7d9a\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>[bash]<br \/>\n$ rake db:create RAILS_ENV=production<br \/>\n$ rake gitlab:setup RAILS_ENV=production<\/p>\n<p>[\/bash]<\/p>\n<p>\u6700\u5f8c\u306b\u51fa\u529b\u3055\u308c\u308b\u3001\u30ed\u30b0\u30a4\u30f3\u540d\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u30e1\u30e2\u3063\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>login&#8230;&#8230;&#8230;admin@local.host<br \/>\npassword&#8230;&#8230;5iveL!fe<\/p>\n<h4>\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u4f5c\u6210\u3001\u8a2d\u5b9a<\/h4>\n<p>GitLab\u306e\u30b5\u30a4\u30c8\u306b\u306f puma\uff08Ruby\u88fd\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d0\u30fc\uff09\u3068\u9023\u643a\u3059\u308b\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u3057\u304b\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u30d9\u30fc\u30b9\u306bpassenger\u3067\u9023\u643a\u3057\u3066\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\n$ wget http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/03\/gitlab.sh<\/p>\n<p>$ sudo cp gitlab.sh \/etc\/init.d\/gitlab<br \/>\n$ sudo chmod 744 \/etc\/init.d\/gitlab<br \/>\n$ sudo sysv-rc-conf gitlab on<\/p>\n<p>$ sudo service gitlab start<br \/>\n[\/bash]<\/p>\n<h3>nginx\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>passenger\u3068\u9023\u643a\u3057\u3066GitLab\u3092nginx\u914d\u4e0b\u3067\u904b\u7528\u3059\u308b\u306e\u3067\u3001nginx\u3092\u30bd\u30fc\u30b9\u304b\u3089\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3059\u3002\uff08\u3042\u307e\u308a\u96e3\u3057\u304f\u8003\u3048\u305a\u306b\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u3084\u308c\u3070\u3001\u3046\u307e\u304f\u884c\u304d\u307e\u3059\uff09<\/p>\n<h3>passenger\u306egem\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>[bash]<br \/>\n$ sudo gem install passenger<br \/>\n[\/bash]<\/p>\n<h3>passenger \u9023\u643a\u306e\u305f\u3081\u306b\u3001nginx\u30b3\u30f3\u30d1\u30a4\u30eb<\/h3>\n<p>[bash]<br \/>\n$ sudo passenger-install-nginx-module<br \/>\n[\/bash]<\/p>\n<p>\u30b3\u30f3\u30d1\u30a4\u30eb\u524d\u306b\u30c1\u30a7\u30c3\u30af\u304c\u8d70\u308a\u3001curl-config \u304c\u7121\u3044\u3088\u7684\u306a\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u305f\u5834\u5408\u306f\u3001<\/p>\n<p>[bash]<br \/>\n$ sudo apt-get install libcurl4-openssl-dev<br \/>\n[\/bash]<\/p>\n<p>\u4ed6\u306e\u30a8\u30e9\u30fc\u306e\u5834\u5408\u306f\u3001\u3054\u81ea\u8eab\u3067\u304a\u8abf\u3079\u304f\u3060\u3055\u3044\u3002<br \/>\n\u30a8\u30e9\u30fc\u304c\u6d88\u3048\u308b\u307e\u3067\u4ee5\u4e0b\u3092\u7e70\u308a\u8fd4\u3057\u3066\u307f\u308b\u3002<br \/>\n[bash]<br \/>\n$ sudo passenger-install-nginx-module<br \/>\n[\/bash]<\/p>\n<p>\u7121\u4e8b\u30c1\u30a7\u30c3\u30af\u3092\u901a\u904e\u3059\u308c\u3070\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u304b\u3068\u805e\u3044\u3066\u304f\u308b\u306e\u3067\u3001\uff11\u3092\u9078\u3093\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b<br \/>\n\u3081\u3067\u305f\u304f\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u59cb\u307e\u308b\u3002\uff08\u305d\u3053\u305d\u3053\u5f85\u3061\u307e\u3059\u3002\uff09<br \/>\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068nginx\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b passenger\u306e\u5834\u6240\u304c\u66f8\u304d\u3053\u307e\u308c\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\nPlease specify a prefix directory [\/opt\/nginx]:<\/p>\n<p>Nginx with Passenger support was successfully installed.<\/p>\n<p>The Nginx configuration file (\/opt\/nginx\/conf\/nginx.conf)<br \/>\nmust contain the correct configuration options in order for Phusion Passenger<br \/>\nto function correctly.<\/p>\n<p>This installer has already modified the configuration file for you! The<br \/>\nfollowing configuration snippet was inserted:<\/p>\n<p>  http {<br \/>\n      &#8230;<br \/>\n      passenger_root \/var\/lib\/gems\/1.9.1\/gems\/passenger-4.0.39;<br \/>\n      passenger_ruby \/usr\/bin\/ruby1.9.1;<br \/>\n      &#8230;<br \/>\n  }<\/p>\n<p>After you start Nginx, you are ready to deploy any number of Ruby on Rails<br \/>\napplications on Nginx.<\/p>\n<p>[\/bash]<\/p>\n<h3>\/opt\/nginx \u30d5\u30a9\u30eb\u30c0\u6a29\u9650\u8abf\u6574<\/h3>\n<p>[bash]<br \/>\n$ sudo chown www-data:www-data \/opt\/nginx -R<br \/>\n$ sudo chmod 775 \/opt\/nginx -R<br \/>\n[\/bash]<\/p>\n<h3>nginx\u306e\u8a2d\u5b9a\u78ba\u8a8d\u3068\u3001\u8d77\u52d5\u3002<\/h3>\n<p>-t \u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001OK\u306a\u3089\u3070\u3001\u4e00\u65e6\u8d77\u52d5\u3057\u3066\u307f\u3066\u3001\u30d6\u30e9\u30a6\u30b6\u30fc\u3067 http:\/\/localhost \u3068\u3057\u3066\u3001nginx\u306e\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u304c\u958b\u3051\u308c\u3070OK\u3002<\/p>\n<p>[bash]<br \/>\n$ sudo \/opt\/nginx\/sbin\/nginx -t<br \/>\nnginx: the configuration file \/opt\/nginx\/conf\/nginx.conf syntax is ok<br \/>\nnginx: configuration file \/opt\/nginx\/conf\/nginx.conf test is successful<\/p>\n<p>$ sudo \/opt\/nginx\/sbin\/nginx<br \/>\n[\/bash]<\/p>\n<p>[bash]<br \/>\n$ ps aux |grep nginx<br \/>\n[\/bash]<\/p>\n<p>\u3068\u3057\u3066\u3001nginx: master process \u3068\u306a\u308b\u30d7\u30ed\u30bb\u30b9ID\u3092\u6bba\u3059\u3068\u6b62\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n[bash]<br \/>\n$ sudo kill pid<br \/>\n[\/bash]<\/p>\n<h3>nginx passenger\u9023\u643a\u8a2d\u5b9a<\/h3>\n<p>passenger\u306e\u5834\u6240\u306f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u81ea\u52d5\u7684\u306b\u7d44\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u306e\u4ed6\u306e\u9805\u76ee\u306e\u8abf\u6574\u3002<\/p>\n<p>http:\/\/www.myhost.jp\/gitlab \u3067\u516c\u958b\u3059\u308b\u3002<\/p>\n<p>[bash]<br \/>\n$ sudo nano \/opt\/nginx\/conf\/nginx.conf<br \/>\n[\/bash]<\/p>\n<p>\u4ee5\u4e0b\u306e\u90e8\u5206\u3092\u8ffd\u8a18<br \/>\n<strong>\u6ce8\u610f\u70b9\uff01\uff01\uff01\u3000pid\u306e\u884c\u306f\u3001pid\u3068 \/opt\/nginx\/logs\/nginx.pid \u306e\u9593\u306f\u30bf\u30d6\u3067\u533a\u5207\u3063\u3066\u304f\u3060\u3055\u3044\uff01<\/strong><br \/>\n\uff08\u5f8c\u306b\u8a2d\u5b9a\u3059\u308b\u3001\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3053\u306e\u90e8\u5206\u306e\u8a2d\u5b9a\u3092\u8aad\u307f\u8fbc\u3080\u305f\u3081\uff09<\/p>\n<p>[diff mark=&#8221;2&#8243;]<br \/>\n+ user  www-data;<br \/>\n+ pid \/opt\/nginx\/logs\/nginx.pid;<\/p>\n<p>\u301c\u7701\u7565\u301c<br \/>\n    server {<br \/>\n        listen       80;<br \/>\n        server_name  localhost;<\/p>\n<p>\u301c\u7701\u7565\u301c<br \/>\n&#8211;<br \/>\n+        location ~ ^\/gitlab {<br \/>\n+              root \/home\/git\/gitlab\/public;<br \/>\n+              #passenger_base_uri \/gitlab;<br \/>\n+              passenger_app_root \/home\/git\/gitlab;<br \/>\n+              #passenger_document_root \/home\/git\/gitlab\/public;<br \/>\n+              passenger_enabled on;<br \/>\n+              rails_env production;<br \/>\n+              access_log  \/opt\/nginx\/logs\/gitlab.access.log;<br \/>\n+              error_log  \/opt\/nginx\/logs\/gitlab.error.log;<br \/>\n+        }<\/p>\n<p>[\/diff]<\/p>\n<h3>\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u4f5c\u6210<\/h3>\n<p>\u3044\u3061\u3044\u3061\u3001\/opt\/nginx\/sbin\/nginx \u3068\u3057\u305f\u308a\u3001pid\u3092\u63a2\u3057\u3066Kill\u3059\u308b\u306e\u306f\u9762\u5012\u306a\u306e\u3067\u3001\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3002\u3053\u306e\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u306f apt-get \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u3082\u306e\u3092\u3001\u8abf\u6574\u3057\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u8abf\u6574\u7b87\u6240\u306f\u3000DEAMON\u306e\u30d1\u30b9\u3068nginx\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3002\u4e21\u65b9\u30d5\u30eb\u30d1\u30b9\u3067\u6307\u5b9a\u3057\u3066\u304a\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u3053\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/03\/nginx\">nginx\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8<\/a><\/p>\n<p>[diff mark=&#8221;14,28&#8243;]<br \/>\n#!\/bin\/sh<\/p>\n<p>### BEGIN INIT INFO<br \/>\n# Provides:\t  nginx<br \/>\n# Required-Start:    $local_fs $remote_fs $network $syslog $named<br \/>\n# Required-Stop:     $local_fs $remote_fs $network $syslog $named<br \/>\n# Default-Start:     2 3 4 5<br \/>\n# Default-Stop:      0 1 6<br \/>\n# Short-Description: starts the nginx web server<br \/>\n# Description:       starts nginx using start-stop-daemon<br \/>\n### END INIT INFO<\/p>\n<p>PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/sbin:\/bin:\/usr\/sbin:\/usr\/bin<br \/>\nDAEMON=\/opt\/nginx\/sbin\/nginx<br \/>\nNAME=nginx<br \/>\nDESC=nginx<\/p>\n<p># Include nginx defaults if available<br \/>\nif [ -r \/etc\/default\/nginx ]; then<br \/>\n\t. \/etc\/default\/nginx<br \/>\nfi<\/p>\n<p>test -x $DAEMON || exit 0<\/p>\n<p>. \/lib\/init\/vars.sh<br \/>\n. \/lib\/lsb\/init-functions<\/p>\n<p>PID=$(awk -F'[ \\t;]&#8217; &#8216;$1 !~ \/^#\/ &#038;&#038; \/pid\/ {print $2}&#8217; \/opt\/nginx\/conf\/nginx.conf)<\/p>\n<p>if [ -z &#8220;$PID&#8221; ]<br \/>\nthen<br \/>\n\tPID=\/run\/nginx.pid<br \/>\nfi<\/p>\n<p># Check if the ULIMIT is set in \/etc\/default\/nginx<br \/>\nif [ -n &#8220;$ULIMIT&#8221; ]; then<br \/>\n\t# Set the ulimits<br \/>\n\tulimit $ULIMIT<br \/>\nfi<\/p>\n<p>#<br \/>\n# Function that starts the daemon\/service<br \/>\n#<br \/>\ndo_start()<br \/>\n{<\/p>\n<p>\u4ee5\u4e0b\u7701\u7565<br \/>\n[\/diff]<\/p>\n<h3>\u8d77\u52d5\u30b9\u30af\u30ea\u30d7\u30c8\u30b3\u30d4\u30fc\u3001\u30b5\u30fc\u30d3\u30b9\u767b\u9332\u3002<\/h3>\n<p>[bash]<\/p>\n<p>$ sudo mv nginx \/etc\/init.d\/<br \/>\n$ sudo chmod 755 \/etc\/init.d\/nginx<br \/>\n$ sudo chown root:root \/etc\/init.d\/nginx<\/p>\n<p>$ sudo sysv-rc-conf nginx on<\/p>\n<p>[\/bash]<\/p>\n<p>\u3053\u308c\u3067\u3001<\/p>\n<p>[bash]<\/p>\n<p>$ sudo \/etc\/init.d\/nginx start<br \/>\n$ sudo \/etc\/init.d\/nginx stop<br \/>\n$ sudo \/etc\/init.d\/nginx restart<br \/>\n[\/bash]<\/p>\n<p>\u3082\u3057\u304f\u306f<\/p>\n<p>[bash]<\/p>\n<p>$ sudo service nginx start<br \/>\n[\/bash]<\/p>\n<p>\u306a\u3069\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>nginx(www-data)\u30e6\u30fc\u30b6\u30fc\u3092git\u30b0\u30eb\u30fc\u30d7\u306b\u52a0\u3048\u308b<\/h4>\n<p>nginx\u304c \/home\/git\/repositories\u3000\u30d5\u30a9\u30eb\u30c0\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u6a29\u9650\u3092\u8abf\u6574\u3057\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\n$ sudo usermod -aG git www-data<\/p>\n<p>[\/bash]<\/p>\n<h4>\u30a2\u30bb\u30c3\u30c8\u30d7\u30ea\u30b3\u30f3\u30d1\u30a4\u30eb<\/h4>\n<p>\u3053\u308c\u306fRails\u30a2\u30d7\u30ea\u3092production\u30e2\u30fc\u30c9\u3067\u516c\u958b\u3059\u308b\u3068\u304d\u306e\u304a\u4f5c\u6cd5\u306a\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u3044\u3066\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u5c11\u3005\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002<br \/>\n\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u7d42\u308f\u3063\u305f\u3089\u3001nginx\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\n$ cd \/home\/git\/gitlab<br \/>\n$ sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production<\/p>\n<p>$ sudo service nginx restart<br \/>\n[\/bash]<\/p>\n<h3>\u52d5\u4f5c\u78ba\u8a8d<\/h3>\n<p>\u30d6\u30e9\u30a6\u30b6\u30fc\u3067Gitlab\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u5c11\u3005\u5f85\u305f\u3055\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u6c17\u9577\u306b\u5f85\u3061\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>http:\/\/www.myhost.jp\/gitlab<\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-GitLab-Chromium.png\"><img decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-GitLab-Chromium.png\" alt=\"Screenshot-GitLab - Chromium\" width=\"650\" class=\"alignnone size-medium wp-image-141\" \/><\/a><\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4f5c\u6210\u6642\u306b\u30e1\u30e2\u3063\u3066\u304a\u3044\u305fID\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u308b<\/p>\n<p>login&#8230;&#8230;&#8230;admin@local.host<br \/>\npassword&#8230;&#8230;5iveL!fe<\/p>\n<h3>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\uff08\u30ea\u30dd\u30b8\u30c8\u30ea\u30fc\uff09\u306e\u4f5c\u6210<\/h3>\n<p>\u3053\u3053\u304b\u3089\u306fGUI\u306a\u306e\u3067\u3001\u64cd\u4f5c\u306f\u7c21\u5358\u3067\u3059\u3002<br \/>\n\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Dashboard-GitLab-Chromium.png\"><img decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Dashboard-GitLab-Chromium.png\" alt=\"Screenshot-Dashboard | GitLab - Chromium\" width=\"650\" class=\"alignnone size-medium wp-image-140\" \/><\/a><\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-New-Project-GitLab-Chromium.png\"><img decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-New-Project-GitLab-Chromium.png\" alt=\"Screenshot-New Project | GitLab - Chromium\" width=\"650\" class=\"alignnone size-medium wp-image-142\" \/><\/a><\/p>\n<p>\u5b9f\u969b\u306b\u30ea\u30dd\u30b8\u30c8\u30ea\u30fc\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d<\/p>\n<p>[bash]<br \/>\n# ls \/home\/git\/repositories\/root\/<br \/>\nabc.git  abc.wiki.git<br \/>\n[\/bash]<\/p>\n<p>\u3082\u3057\u6b63\u3057\u304f\u4f5c\u6210\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u4f55\u3089\u304b\u306e\u4e0d\u5177\u5408\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u306e\u3067\u3001Gitlab\u3092\u518d\u8d77\u52d5\u3057\u307e\u3057\u3087\u3046\u3002\uff08\u518d\u8d77\u52d5\u5f8c\u3001\u518d\u5ea6\u30d6\u30e9\u30a6\u30b6\u30fc\u304b\u3089\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210\u3092\u884c\u3044\u3001\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<p>[bash]<br \/>\n# service gitlab restart<br \/>\n[\/bash]<\/p>\n<h3>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3057\u30ea\u30dd\u30b8\u30c8\u30ea\u30fc\u306bPush\u3057\u3066\u307f\u308b<\/h3>\n<p>\u9069\u5f53\u306a\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u3001\u305d\u3053\u3067Git\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3002\u65b0\u898f\u306bREADME\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001Gitlab\u306bPush\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\n$ mkdir abc<br \/>\n$ cd abc<br \/>\n$ git init<br \/>\nInitialized empty Git repository in \/home\/hiro\/workspace\/abc\/.git\/<\/p>\n<p>$ git config user.name &#8220;myname&#8221;<br \/>\n$ git config user.email &#8220;myname@myhost.jp&#8221;<br \/>\n$ git remote add origin http:\/\/root@www.myhost.jp\/gitlab\/root\/abc.git<\/p>\n<p>$ echo &#8220;HELLO GITLAB&#8221; >> README<br \/>\n$ git add README<br \/>\n$ git commit -m &#8220;first commit&#8221;<br \/>\n$ git push -u origin master<\/p>\n<p>[\/bash]<\/p>\n<h3>\u30d6\u30e9\u30a6\u30b6\u30fc\u3067\u30b3\u30df\u30c3\u30c8\u5185\u5bb9\u78ba\u8a8d<\/h3>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Commits-at-master-Administrator-abc-GitLab-Chromium.png\"><img decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Commits-at-master-Administrator-abc-GitLab-Chromium.png\" alt=\"Screenshot-Commits at master - Administrator - abc | GitLab - Chromium\" width=\"650\" class=\"alignnone size-medium wp-image-139\" \/><\/a><\/p>\n<p><a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Administrator-abc-GitLab-Chromium.png\"><img decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/01\/Screenshot-Administrator-abc-GitLab-Chromium.png\" alt=\"Screenshot-Administrator - abc | GitLab - Chromium\" width=\"650\"  class=\"alignnone size-medium wp-image-138\" \/><\/a><\/p>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\u3002<br \/>\n\u3081\u3067\u305f\u3057\u3081\u3067\u305f\u3057\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS\u306bGitLab\u3092\u5c0e\u5165\u3059\u308b\u30e1\u30e2\u3092\u66f8\u3044\u305f\u3089\u5999\u306b\u30a2\u30af\u30bb\u30b9\u6570\u304c\u591a\u304b\u3063\u305f\u306e\u3067\u3001debian\u7cfbOS\u3067GitLab6.6.5\uff08\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u3042\u307e\u308a\u6c17\u306b\u3057\u306a\u304f\u3066\u3082\u3001\u540c\u3058\u624b\u9806\u3067OK\u3067\u3059\u3002\uff09\u3092\u516c\u958b\u3059\u308b\u65b9\u6cd5\u3092\u66f8\u3044\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002CentOS\u306e\u6642\u306f\u30db\u30b9\u30c8\u3059\u308bWeb\u30b5\u30fc\u30d0\u30fc\u3092Apache\u3068\u3057\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306fnginx\u306e\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u3067\u516c\u958b\u3059\u308b\u65b9\u6cd5\u3092\u304a\u4f1d\u3048\u3057\u307e\u3059\u3002 \u5b9f\u969b\u306b\u306f debian wheezy 7.4\u3067\u3057\u304b\u52d5\u4f5c\u691c\u8a3c\u3057\u3066\u3044\u307e\u305b\u3093\u3002Ubuntu\u3001LMDE\u3067\u3082\u554f\u984c\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3082\u3057\u4e0d\u90fd\u5408\u7b49\u767a\u898b\u3055\u308c\u305f\u5834\u5408\u306f\u3001\u30b3\u30e1\u30f3\u30c8\u6b04\u306b\u30b3\u30e1\u30f3\u30c8\u3044\u305f\u3060\u3051\u308b\u3068\u52a9\u304b\u308a\u307e\u3059\u3002 \u524d\u534a\u306f\u3001GitLab\u81ea\u4f53\u304cRuby On Rails\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308b\u306e\u3067\u3001Rails\u306e\u74b0\u5883\u69cb\u7bc9\u3092\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\u5f8c\u534a\u306fGitlab\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3001nginx\u3068\u306e\u9023\u643a\u3068\u306a\u308a\u307e\u3059\u3002\u9577\u3044\u3051\u3069\u3001\u9811\u5f35\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01 \u8ffd\u8a18 Ubuntu 12.04.4 Server\u3067\u306e\u691c\u8a3c\u7d42\u4e86\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u7528\u610f\u3055\u308c\u3066\u3044\u308bRuby\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c1.8\u3067\u3057\u305f\u306e\u3067\u3001\u554f\u984c\u3042\u308a\u3067\u3059\u3002PPA\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u3057\u3001Ruby2.1\u3092\u5c0e\u5165\u3059\u308b\u3053\u3068\u3067\u3001\u7121\u4e8bGitLab\u74b0\u5883\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3057\u305f\u3002 \uff08PPA\u8ffd\u52a0\u306e\u3042\u305f\u308a\u3082\u8a18\u8f09\u6e08\u307f\u3067\u3059\u3002\uff09 \u524d\u63d0\u6761\u4ef6 Web\u30b5\u30fc\u30d0\u30fc\u306bnginx\u3092\u7528\u3044\u307e\u3059\u3002 Rails\u3068nginx\u306e\u9023\u643a\u306fpassenger\u3067\u884c\u3044\u307e\u3059\u3002 GitLab\u306fnginx\u306e\u30b5\u30d6\u30d5\u30a9\u30eb\u30c0\u3067\u516c\u958b\u3057\u307e\u3059\u3002 \u516c\u958b\u30db\u30b9\u30c8\u540d\u3092 www.myhost.jp \u3068\u3059\u308b\u3002 GitLab\u516c\u958bURL\u3092 http:\/\/www.myhost.jp\/gitlab \u3068\u3059\u308b\u3002 git \u30e6\u30fc\u30b6\u30fc\u306e\u4f5c\u6210\u3068 sudo\u6a29\u9650 \u3053\u308c\u304c\u30d9\u30b9\u30c8\u306a\u65b9\u6cd5\u304b\u3001\u5c11\u3005\u7591\u554f\u3067\u3059\u304c\u3001\u4f5c\u696d\u306f\u3059\u3079\u3066\u65b0\u898f\u306b\u4f5c\u6210\u3059\u308bgit \u30e6\u30fc\u30b6\u30fc\u3067\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002 git\u30e6\u30fc\u30b6\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u304a\u4efb\u305b\u3057\u307e\u3059\u3002 [bash] $ sudo useradd git -md \/home\/git -s \/bin\/bash $ sudo passwd git $ sudo nano \/etc\/suders [\/bash] git\u30e6\u30fc\u30b6\u30fc\u3092sudo\u53ef\u80fd\u306a\u30e6\u30fc\u30b6\u30fc\u306b\u52a0\u3048\u307e\u3059\u3002 [diff mark=&#8221;3&#8243;] # User privilege specification root ALL=(ALL:ALL) ALL + git ALL=(ALL:ALL) ALL [\/diff] \u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u7fa4\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb \u3042\u307e\u308a\u6df1\u304f\u8003\u3048\u305a\u306b\u3001\u4ee5\u4e0b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30c9\u30ab\u30fc\u30f3\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3061\u3083\u3063\u3066\u304f\u3060\u3055\u3044\u3002 [bash] $ su &#8211; git $ sudo apt-get install curl git build-essential libgtk2.0-dev libmysqlclient-dev mysql-server dialog zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl git-core openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev python-docutils sysv-rc-conf [\/bash] gemrc\u4f5c\u6210 \u3053\u308c\u306fRuby\u306e\u304a\u4f5c\u6cd5\u307f\u305f\u3044\u306a\u3082\u306e\u306a\u306e\u3067\u6c17\u306b\u305b\u305a\u306b\u3053\u306e\u901a\u308a\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002 [bash] $ nano ~\/.gemrc [\/bash] gem \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069\u3092\u7701\u7565\u3057\u307e\u3059\u3002 [bash] gem: &#8211;no-ri &#8211;no-rdoc [\/bash] Ruby\/Rails \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb Ruby\u306e\u30d0\u30fc\u30b8\u30e7\u30f3 1.9 \u4ee5\u4e0a\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u30c7\u30a3\u30b9\u30c8\u30ea\u30d3\u30e5\u30fc\u30b7\u30e7\u30f3\u306e\u5834\u5408\u3002 \uff08\u3053\u3053\u6700\u8fd1\u306e\u3082\u306e\u3067\u3042\u308c\u3070\u3000OK\u306a\u306f\u305a\u3067\u3059\u3002\uff09 Ubuntu12.04\u306f Ruby1.8\u3000\u306a\u306e\u3067\u3001\u3053\u3053\u3092\u98db\u3070\u3057\u3066\u3001\u6b21\u306e\u9805\u76ee\u306b\u9032\u3093\u3067ppa\u304b\u3089Ruby2.1\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002 [bash] $ sudo apt-get install ruby ruby-dev $ sudo gem install rails [\/bash] Ubuntu 12.04\u306e\u5834\u5408 [bash] sudo apt-get install python-software-properties sudo apt-add-repository ppa:brightbox\/ruby-ng sudo apt-get update sudo apt-get install ruby2.1 ruby2.1-dev sudo gem install rails [\/bash] REDIS\u8d77\u52d5\u3001\u8d77\u52d5\u8a2d\u5b9a [bash] $ sudo service redis-server restart $ sudo sysv-rc-conf redis-server on [\/bash] \u3053\u308c\u3067\u3001\u524d\u534a\u7d42\u4e86\u3067\u3059\u3002\u6b21\u304b\u3089GitLab\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u5165\u308a\u307e\u3059\uff01 Gitlab-shell\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb [bash] $ git config &#8211;global user.name &#8220;GitLab&#8221; $ git config &#8211;global user.email &#8220;gitlab@localhost&#8221; $ git clone https:\/\/github.com\/gitlabhq\/gitlab-shell.git $ cd gitlab-shell\/ $ git checkout -b 1.8.5 v1.8.5 $ cp config.yml.example config.yml $ nano config.yml [\/bash] \u4ee5\u4e0b\u306eURL\u6307\u5b9a\u306e\u90e8\u5206\u3092\u8abf\u6574\uff08gitlab\u3092\u30db\u30b9\u30c8\u3059\u308bURL\u3092\u8a18\u8ff0\uff09 [diff] &#8211; gitlab_url: &#8220;http:\/\/localhost\/&#8221;\u3000\u2190\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8 + gitlab_url: &#8220;http:\/\/www.myhost.jp\/gitlab\/&#8221; [\/diff] \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b9f\u884c [bash] $ .\/bin\/install [\/bash] gitlab\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb github\u304b\u3089\u30bd\u30fc\u30b9\u3092\u30af\u30ed\u30fc\u30f3\u3057\u307e\u3059\u3002\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u304b\u306a\u308a\u6642\u9593\u98df\u3044\u307e\u3059\u3002\u5408\u8a08\uff17\uff10\uff4d\uff42\u3050\u3089\u3044\uff09 [bash] $ cd \/home\/git $ git clone https:\/\/github.com\/gitlabhq\/gitlabhq.git gitlab $ cd gitlab $ git checkout -b 6.6.5 v6.6.5 $ cp config\/gitlab.yml.example config\/gitlab.yml $ nano config\/gitlab.yml [\/bash] \u30db\u30b9\u30c8\u540d\u8a2d\u5b9a\uff08gitlab\u3092\u30db\u30b9\u30c8\u3059\u308bURL\u3092\u8a18\u8ff0\uff09\u3001\u76f8\u5bfe\u30eb\u30fc\u30c8\u306e\u8a2d\u5b9a [diff] &#8211; host: localhost + host: www.myhost.jp https: false # Uncomment and customize the last line to run in a non-root path # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this. # Note that four settings need to be changed for this to&#8230;<\/p>\n","protected":false},"author":1,"featured_media":558,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[4],"tags":[32,12,13,19],"class_list":{"0":"post-545","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-4","8":"tag-debian","9":"tag-gitlab","10":"tag-nginx","11":"tag-ubuntu"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=545"}],"version-history":[{"count":26,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/545\/revisions"}],"predecessor-version":[{"id":1052,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/545\/revisions\/1052"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/media\/558"}],"wp:attachment":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}