{"id":367,"date":"2014-11-01T02:14:07","date_gmt":"2014-10-31T17:14:07","guid":{"rendered":"http:\/\/www.dracula.mydns.jp\/blog\/?p=367"},"modified":"2014-11-01T02:14:07","modified_gmt":"2014-10-31T17:14:07","slug":"gitlab%e3%82%92%ef%bc%97%e3%81%ab%e3%81%97%e3%81%9f%e3%80%82%e3%81%a4%e3%81%84%e3%81%a7%e3%81%ab%e3%82%b5%e3%83%96%e3%83%87%e3%82%a3%e3%83%ac%e3%82%af%e3%83%88%e3%83%aa%e3%81%ab%e3%81%97%e3%81%9f","status":"publish","type":"post","link":"https:\/\/www.dracula.mydns.jp\/blog\/?p=367","title":{"rendered":"GitLab\u3092\uff17\u306b\u3057\u305f\u3002\u3064\u3044\u3067\u306b\u30b5\u30d6\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3057\u305f\u3002"},"content":{"rendered":"<p>\u5f79\u5272\u3054\u3068\u306b\u30b5\u30fc\u30d0\u3092\u5206\u3051\u308b\u3088\u3046\u306b\u30b5\u30fc\u30d0\u69cb\u6210\u306e\u898b\u76f4\u3057\u3092\u3057\u305f\u3002<br \/>\n\u305d\u306e\u4e00\u74b0\u3067GitLab\u3092\u5c02\u7528\u30b5\u30fc\u30d0\u306b\u7acb\u3066\u76f4\u3059\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<p>\u4ee5\u524d\u306fV6\u3092\u4f7f\u3063\u3066\u3044\u305f\u304c\u305b\u3063\u304b\u304f\u306a\u306e\u3067V7\u306b\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3002<br \/>\n\u7269\u51c4\u304f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u697d\u306b\u306a\u3063\u3066\u3044\u305f\u3002\u3042\u308a\u304c\u3068\u3046\u3002<\/p>\n<p>\u305f\u3060\u30c7\u30d5\u30a9\u30eb\u30c8\u3060\u3068\u30eb\u30fc\u30c8\u3067\u52d5\u3044\u3066\u3057\u307e\u3046\u3002\u3064\u307e\u308a\u4ee5\u4e0b\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3002<br \/>\n\u3000http:\/\/\u30b5\u30fc\u30d0\/<\/p>\n<p>\u3046\u3061\u306e\u30b5\u30fc\u30d0\u69cb\u6210\u3067\u306fnginx\u3092\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u306b\u3057\u3066URL\u3092\u898b\u3066\u30b5\u30fc\u30d0\u306e\u632f\u308a\u5206\u3051\u3092\u3057\u3066\u308b\u306e\u3067\u3053\u308c\u3067\u306f\u5c11\u3057\u5177\u5408\u304c\u308f\u308b\u3044\u3002<br \/>\n\u3000http:\/\/\u30b5\u30fc\u30d0\/gitlab<br \/>\n\u306bURL\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306b\u3059\u308b\u3002<\/p>\n<p>\u307e\u305a\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u306b\u3084\u308c\u3070OK\u3060\u3002<br \/>\n\u3000https:\/\/about.gitlab.com\/downloads\/<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f7.2.2\u3060\u3063\u305f\u306e\u3067\u9069\u5b9c\u8aad\u307f\u66ff\u3048\u3067\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ curl -O http:\/\/downloads-packages.s3.amazonaws.com\/centos-7.0.1406\/gitlab-7.2.2_omnibus-1.el7.x86_64.rpm\r\n$ yum install openssh-server\r\n$ systemctl enable sshd\r\n$ systemctl start sshd\r\n$ yum install postfix\r\n$ systemctl enable postfix\r\n$ systemctl start postfix\r\n$ rpm -i gitlab-7.2.2_omnibus.1-1.el7.x86_64.rpm\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ vi \/etc\/gitlab\/gitlab.rb\r\nexternal_url 'http:\/\/\u30b5\u30fc\u30d0'     &lt;= \u306a\u305c\u304bhttp:\/\/\u3092\u3064\u3051\u3066\u304f\u308c\u3066\u306a\u3044\u306e\u3067\u4ed8\u3051\u308b\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ gitlab-ctl reconfigure\r\n$ firewall-cmd --permanent --add-service=http\r\n$ systemctl reload firewalld\r\n<\/pre>\n<p>\u901a\u5e38\u306a\u3089\u3053\u308c\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8d77\u52d5\u306f\u5b8c\u4e86\u3002\u975e\u5e38\u306b\u697d\u3060\u3002V6\u306e\u6642\u306b\u4f55\u6642\u9593\u3082\u304b\u3051\u305f\u306e\u306f\u4f55\u3060\u3063\u305f\u306e\u3060\u308d\u3046\u3002\u3002<\/p>\n<p>\u3000 http:\/\/\u30b5\u30fc\u30d0\u3000\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068GitLab\u306e\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u3060\u308d\u3046\u3002<\/p>\n<p>\u3055\u3066\u3001\u3053\u306e\u307e\u307e\u3060\u3068URL\u304c\u30eb\u30fc\u30c8\u306e\u307e\u307e\u306a\u306e\u3067\/gitlab\u306b\u5909\u66f4\u3059\u308b\u3002<br \/>\n\/opt\/gitlab\/embedded\/service\/gitlab-rails\/config\/application.rb<br \/>\n\u306b\u4ee5\u4e0b\u3088\u3046\u306a\u3084\u308a\u65b9\u304c\u66f8\u3044\u3066\u3042\u308b\u3002\u3053\u308c\u306b\u5f93\u3048\u3070OK\u3060\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ vi \/opt\/gitlab\/embedded\/service\/gitlab-rails\/config\/application.rb\r\n\r\n\u5192\u982d\u7565\r\n    # Relative url support\r\n    # Uncomment and customize the last line to run in a non-root path\r\n    # WARNING: We recommend creating a FQDN to host GitLab in a root path instead of this.\r\n    # Note that following settings need to be changed for this to work.\r\n    # 1) In your application.rb file: config.relative_url_root = &quot;\/gitlab&quot;\r\n    # 2) In your gitlab.yml file: relative_url_root: \/gitlab\r\n    # 3) In your unicorn.rb: ENV&#x5B;'RAILS_RELATIVE_URL_ROOT'] = &quot;\/gitlab&quot;\r\n    # 4) In ..\/gitlab-shell\/config.yml: gitlab_url: &quot;http:\/\/127.0.0.1\/gitlab&quot;\r\n    # 5) In lib\/support\/nginx\/gitlab : do not use asset gzipping, remove block starting with &quot;location ~ ^\/(assets)\/&quot;\r\n    #\r\n    # To update the path, run: sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production\r\n    #\r\n    config.relative_url_root = &quot;\/gitlab&quot;\u3000\u3000&lt;= 1)\u306f\u3053\u3053\u306e\u3053\u3068\u3060\u304b\u3089\u30b3\u30e1\u30f3\u30c8\u3092\u5916\u3059\r\n<\/pre>\n<p>2) In your gitlab.yml file: relative_url_root: \/gitlab<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ vi \/var\/opt\/gitlab\/gitlab-rails\/etc\/gitlab.yml\r\n\r\n\u5192\u982d\u7565\r\n\u3000\u3000\u3000relative_url_root: \/gitlab  &lt;=\u3053\u3053\r\n<\/pre>\n<p>3) In your unicorn.rb: ENV[&#8216;RAILS_RELATIVE_URL_ROOT&#8217;] = &#8220;\/gitlab&#8221;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ vi \/var\/opt\/gitlab\/gitlab-rails\/etc\/unicorn.rb\r\n\r\n\u6700\u5f8c\u306b\u8ffd\u52a0\r\nENV&#x5B;'RAILS_RELATIVE_URL_ROOT'] = &quot;\/gitlab&quot;\r\n<\/pre>\n<p>4) In ..\/gitlab-shell\/config.yml: gitlab_url: &#8220;http:\/\/127.0.0.1\/gitlab&#8221;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ vi \/var\/opt\/gitlab\/gitlab-shell\/config.yml\r\n\r\ngitlab_rul: &quot;http:\/127.0.0.1:8080\/gitlab&quot;\r\n<\/pre>\n<p>5) In lib\/support\/nginx\/gitlab : do not use asset gzipping, remove block starting with &#8220;location ~ ^\/(assets)\/&#8221;<br \/>\n\u306f\u3084\u3089\u306a\u304f\u3066\u3082\u3088\u3044\u3088\u3046\u3060\u3002<\/p>\n<p>\u30b5\u30fc\u30d3\u30b9\u3092\u518d\u8d77\u52d5<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ gitlab-ctl stop\r\n$ gitlab-ctl start\r\n<\/pre>\n<p>\u3055\u3066\u3001\u3053\u308c\u3067\u8a2d\u5b9a\u306f\u7d42\u308f\u308a\u3002<br \/>\n\u30d6\u30e9\u30a6\u30b6\u3067http:\/\/\u30b5\u30fc\u30d0\/gitlab\u306b\u7e4b\u3044\u3067\u307f\u3088\u3046\u3002\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u306f\u305a\u3002<br \/>\n\u521d\u671f\u30e6\u30fc\u30b6\u306f\u4ee5\u4e0b\u306a\u306e\u3067\u3001\u3053\u308c\u3067\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nUsername: root\r\nPassword: 5iveL!fe\r\n<\/pre>\n<p>\u65b0\u3057\u3044\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u8a2d\u5b9a\u3092\u6c42\u3081\u3089\u308c\u308b\u306e\u3067\u8a2d\u5b9a\u3059\u308b\u3068\u3001\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u306b\u623b\u3055\u308c\u308b\u306e\u3067\u65b0\u3057\u3044\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u3082\u3046\u4e00\u5ea6\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3002<br \/>\n\u30ed\u30b0\u30a4\u30f3\u5f8c\u306b\u30e6\u30fc\u30b6\u540d\u3082root\u304b\u3089\u5909\u66f4\u3057\u3066\u304a\u304f\u3068\u3044\u3044\u3060\u308d\u3046\u3002<\/p>\n<p>\u4ee5\u4e0b\u304a\u307e\u3051\u3002<\/p>\n<p>\u6700\u65b0\u7248\u3067\u306f\u76f4\u3063\u3066\u3044\u308b\u3088\u3046\u3060\u304c7.2.2\u306e\u6642\u306f\/assets\u4e0b\u304c\/gitlab\u4e0b\u306b\u306a\u3089\u306a\u3044\u3088\u3046\u3067\u3042\u308b\u3002<br \/>\n\u305d\u306e\u305b\u3044\u3067\u3046\u3061\u306e\u3088\u3046\u306b\u30ea\u30d0\u30fc\u30b9\u30d7\u30ed\u30ad\u30b7\u3067\/gitlab\u306e\u30a2\u30af\u30bb\u30b9\u3060\u3051\u3092gitlab\u30b5\u30fc\u30d0\u306b\u632f\u308a\u5206\u3051\u3057\u3066\u3044\u308b\u3068assets\u4e0b\u304c\u6b63\u3057\u304f\u632f\u308a\u5206\u3051\u3089\u308c\u305a\u306b\u30a2\u30a4\u30b3\u30f3\u304c\u6b63\u3057\u304f\u8868\u793a\u3055\u308c\u306a\u3044\u3002<br \/>\n\u30b3\u30fc\u30c9\u3092\u76f4\u3057\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u306e\u3082\u3042\u308b\u304c\u9762\u5012\u306a\u306e\u3067\u4ee5\u4e0b\u3067\u5bfe\u51e6\u3059\u308b\u3002<\/p>\n<p>\/assets\u4e0b\u3082gitlab\u306e\u30b5\u30fc\u30d0\u306b\u632f\u308a\u5206\u3051\u3059\u308b\u3002<br \/>\nnginx\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n   location \/assets {\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header X-Forwarded-For $remote_addr;\r\n        proxy_set_header X-Forwarded-Server $host;\r\n        proxy_set_header Host $host;\r\n        proxy_pass http:\/\/&lt;gitlab\u30b5\u30fc\u30d0&gt;\/assets;\r\n  }\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5f79\u5272\u3054\u3068\u306b\u30b5\u30fc\u30d0\u3092\u5206\u3051\u308b\u3088\u3046\u306b\u30b5\u30fc\u30d0\u69cb\u6210\u306e\u898b\u76f4\u3057\u3092\u3057\u305f\u3002 \u305d\u306e\u4e00\u74b0\u3067GitLab\u3092\u5c02\u7528\u30b5\u30fc\u30d0\u306b\u7acb\u3066\u76f4\u3059\u3053\u3068\u306b\u3057\u305f\u3002 \u4ee5\u524d\u306fV6\u3092\u4f7f\u3063\u3066\u3044\u305f\u304c\u305b\u3063\u304b\u304f\u306a\u306e\u3067V7\u306b\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3002 \u7269\u51c4\u304f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u697d\u306b\u306a\u3063\u3066\u3044\u305f\u3002\u3042\u308a\u304c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-367","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=367"}],"version-history":[{"count":15,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/367\/revisions"}],"predecessor-version":[{"id":382,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/367\/revisions\/382"}],"wp:attachment":[{"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dracula.mydns.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}