{"id":1012,"date":"2023-03-12T19:15:18","date_gmt":"2023-03-12T19:15:18","guid":{"rendered":"https:\/\/ptak.wtf\/?p=1012"},"modified":"2023-08-24T09:12:52","modified_gmt":"2023-08-24T09:12:52","slug":"install-gitlab-ce-omnibus-on-plesk-obsidian-18-0-49-debian-11-6","status":"publish","type":"post","link":"https:\/\/ptak.wtf\/?p=1012","title":{"rendered":"Install GitLab-CE (Omnibus) on Plesk Obsidian 18.0.49 (Debian 11.6)"},"content":{"rendered":"<h2>1. RTFM<\/h2>\n<pre><a href=\"https:\/\/docs.gitlab.com\/omnibus\/\">https:\/\/docs.gitlab.com\/omnibus\/<\/a><\/pre>\n<h2>2. Create a Subdomain for your GitLab<\/h2>\n<ul>\n<li>Plesk &gt; Domains &gt; Add Subdomain &gt;<span style=\"color: #0000ff;\"><em> gitlab.mydomain.com<\/em><\/span><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1013 size-large\" src=\"https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab01-1024x255.png\" alt=\"\" width=\"1024\" height=\"255\" srcset=\"https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab01-1024x255.png 1024w, https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab01-300x75.png 300w, https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab01-768x191.png 768w, https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab01-1536x383.png 1536w, https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab01.png 1570w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h2>3. Add additional configuration to your subdomain<\/h2>\n<ul>\n<li>Plesk &gt; <span style=\"color: #0000ff;\"><em>gitlab.mydomain.com <\/em><\/span>&gt; Hosting &amp; DNS &gt; Apache &amp; nginx Settings<\/li>\n<\/ul>\n<h3>3.1 Additional directives for HTTP<\/h3>\n<pre>RewriteEngine On\r\nRewriteCond %{HTTPS} !=on\r\nRewriteCond %{REQUEST_URI} !^\/.well-known\/.*\r\nRewriteRule ^\/(.*) https:\/\/%{HTTP_HOST}\/$1 [last,redirect=301]\r\n<\/pre>\n<h3>3.2 Additional directives for HTTPS<\/h3>\n<pre>DocumentRoot \/opt\/gitlab\/embedded\/service\/gitlab-rails\/public\r\n\r\nProxyRequests Off\r\nProxyPreserveHost On\r\nProxyPass \/ http:\/\/127.0.0.1:8181\/ nocanon\r\n\r\n<span style=\"color: #008000;\"># Ensure that encoded slashes are not decoded but left in their encoded state.\r\n# http:\/\/doc.gitlab.com\/ce\/api\/projects.html#get-single-project<\/span>\r\nAllowEncodedSlashes NoDecode\r\n\r\n&lt;Location \/&gt;\r\n<span style=\"color: #008000;\"># New authorization commands for apache 2.4 and up\r\n# http:\/\/httpd.apache.org\/docs\/2.4\/upgrading.html#access<\/span>\r\nRequire all granted\r\n<span style=\"color: #008000;\"># Allow forwarding to gitlab-workhorse\r\n<\/span>ProxyPassReverse \/\r\n&lt;\/Location&gt;\r\n<span style=\"color: #008000;\"># Apache equivalent of nginx try files\r\n# http:\/\/serverfault.com\/questions\/290784\/what-is-apaches-equivalent-of-nginxs-try-files\r\n# http:\/\/stackoverflow.com\/questions\/10954516\/apache2-proxypass-for-rails-app-gitlab<\/span>\r\nRewriteEngine on\r\n\r\n<span style=\"color: #008000;\"># Forward all requests to gitlab-workhorse except existing files like error documents\r\n# and except the Let's Encrypt challenge<\/span>\r\n\r\nRewriteCond %{DOCUMENT_ROOT}\/%{REQUEST_FILENAME} !-f [OR]\r\nRewriteCond %{REQUEST_URI} ^\/uploads\/.*\r\nRewriteCond %{REQUEST_URI} !^\/.well-known\/acme-challenge\/[0-9a-zA-Z_-]+$ [NC]\r\nRewriteRule .* http:\/\/127.0.0.1:8181%{REQUEST_URI} [P,QSA,NE]\r\nRequestHeader set X_FORWARDED_PROTO 'https'\r\nRequestHeader set X-Forwarded-Ssl on\r\n\r\n<span style=\"color: #008000;\"># needed for downloading attachments<\/span>\r\nDocumentRoot \/opt\/gitlab\/embedded\/service\/gitlab-rails\/public\r\n\r\n<span style=\"color: #008000;\"># Set up apache error documents, if back end goes down (i.e. 503 error) then a \r\n# maintenance\/deploy page is thrown up.<\/span>\r\nErrorDocument 404 \/404.html\r\nErrorDocument 422 \/422.html\r\nErrorDocument 500 \/500.html\r\nErrorDocument 502 \/502.html\r\nErrorDocument 503 \/503.html\r\n\r\n<span style=\"color: #008000;\"># It is assumed that the log directory is in \/var\/log\/httpd.\r\n# For Debian distributions you might want to change this to \/var\/log\/apache2.<\/span>\r\nLogFormat \"%{X-Forwarded-For}i %l %u %t \\\"%r\\\" %&gt;s %b\" common_forwarded\r\nErrorLog \/var\/log\/apache2\/gitlab_error.log\r\nCustomLog \/var\/log\/apache2\/gitlab_forwarded.log common_forwarded\r\nCustomLog \/var\/log\/apache2\/gitlab_access.log combined env=!dontlog\r\nCustomLog \/var\/log\/apache2\/gitlab.log combined<\/pre>\n<h3>3.3 nginx Settings<\/h3>\n<ul>\n<li>Proxy Mode <span style=\"color: #008000;\"><strong>enabled<\/strong><\/span><\/li>\n<li>Smart static files processing <span style=\"color: #ff0000;\"><strong>disabled<\/strong><\/span><\/li>\n<\/ul>\n<h2>4. Install Let&#8217;s Encrypt Certificates<\/h2>\n<ul>\n<li>Domains &gt; <span style=\"color: #0000ff;\"><em>gitlab.mydomain.com<\/em><\/span> &gt; Dashboard &gt; Security &gt; SSL\/TSL Certificates<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1020\" src=\"https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab02-1024x363.png\" alt=\"\" width=\"1024\" height=\"363\" srcset=\"https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab02-1024x363.png 1024w, https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab02-300x106.png 300w, https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab02-768x272.png 768w, https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab02.png 1225w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<h2>5. Add the GiLab reposity by script<\/h2>\n<p>Installation instructions:&nbsp;<a href=\"https:\/\/docs.gitlab.com\/omnibus\/installation\/\">https:\/\/docs.gitlab.com\/omnibus\/installation\/<\/a><br \/>\nInstallation script: <a href=\"https:\/\/packages.gitlab.com\/gitlab\/gitlab-ce\/install\">https:\/\/packages.gitlab.com\/gitlab\/gitlab-ce\/install<\/a><\/p>\n<pre>curl -s https:\/\/packages.gitlab.com\/install\/repositories\/gitlab\/gitlab-ce\/script.deb.sh | sudo bash<\/pre>\n<h2>6. Install the GitLab package<\/h2>\n<p>(and ensure your URL starts with https)<\/p>\n<pre>EXTERNAL_URL=\"https:\/\/<span style=\"color: #0000ff;\">gitlab.mydomain.com<\/span>\" apt-get install gitlab-ce<\/pre>\n<h2>7. Edit the <span style=\"color: #008000;\">\/etc\/gitlab\/gitlab.rb<\/span><\/h2>\n<p>(and check\/alter\/add the following lines using vi, vim or nano)<\/p>\n<ul>\n<li>Find your<em><span style=\"color: #0000ff;\"> plesk_user<\/span><\/em>: Plesk &gt; Domains &gt; <span style=\"color: #0000ff;\"><em>gitlab.mydomain.com<\/em><\/span> &gt; Dashboard &gt; Connection Info<\/li>\n<\/ul>\n<pre>external_url 'https:\/\/<span style=\"color: #0000ff;\">gitlab.mydomain.com<\/span>'\r\nnginx['enable'] = false\r\nweb_server['external_users'] = ['www-data', '<span style=\"color: #0000ff;\">plesk_user<\/span>']\r\nweb_server['group'] = 'psacln'\r\ngitlab_workhorse['listen_network'] = \"tcp\"\r\ngitlab_workhorse['listen_addr'] = \"127.0.0.1:8181\"<\/pre>\n<h2>8. Apply changes<\/h2>\n<pre>sudo gitlab-ctl reconfigure\r\nsudo gitlab<span class=\"pun\">-<\/span><span class=\"pln\">ctl restart<\/span><\/pre>\n<h2>9. Get the status of your gitlab installation<\/h2>\n<p>Usage instructions: <a href=\"https:\/\/docs.gitlab.com\/ee\/update\/package\/#get-the-status-of-a-gitlab-installation\">https:\/\/docs.gitlab.com\/ee\/update\/package\/#get-the-status-of-a-gitlab-installation<\/a><\/p>\n<pre>sudo gitlab-ctl status\r\nsudo gitlab-rake gitlab:check SANITIZE=true<\/pre>\n<h2>10. get <span style=\"color: #ff0000;\">or<\/span> set your gitlab-ce root password<\/h2>\n<pre>sudo cat \/etc\/gitlab\/initial_root_password\r\n\r\nsudo gitlab-rake \"gitlab:password:reset[root]\"<\/pre>\n<h2>11. login as root<\/h2>\n<p>(an configure, manage, administrate, use your installtion)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1024\" src=\"https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab03-1024x459.png\" alt=\"\" width=\"1024\" height=\"459\" srcset=\"https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab03-1024x459.png 1024w, https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab03-300x135.png 300w, https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab03-768x344.png 768w, https:\/\/ptak.wtf\/wp-content\/uploads\/2023\/03\/gitlab03.png 1164w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. RTFM https:\/\/docs.gitlab.com\/omnibus\/ 2. Create a Subdomain for your GitLab Plesk &gt; Domains &gt; Add Subdomain &gt; gitlab.mydomain.com 3. Add additional configuration to your subdomain Plesk &gt; gitlab.mydomain.com &gt; Hosting &amp; DNS &gt; Apache &amp; nginx Settings 3.1 Additional directives for HTTP RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{REQUEST_URI} !^\/.well-known\/.* RewriteRule ^\/(.*) https:\/\/%{HTTP_HOST}\/$1 [last,redirect=301] 3.2 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1024,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1012","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-geeky"],"_links":{"self":[{"href":"https:\/\/ptak.wtf\/index.php?rest_route=\/wp\/v2\/posts\/1012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ptak.wtf\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ptak.wtf\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ptak.wtf\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ptak.wtf\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1012"}],"version-history":[{"count":19,"href":"https:\/\/ptak.wtf\/index.php?rest_route=\/wp\/v2\/posts\/1012\/revisions"}],"predecessor-version":[{"id":1064,"href":"https:\/\/ptak.wtf\/index.php?rest_route=\/wp\/v2\/posts\/1012\/revisions\/1064"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ptak.wtf\/index.php?rest_route=\/wp\/v2\/media\/1024"}],"wp:attachment":[{"href":"https:\/\/ptak.wtf\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ptak.wtf\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ptak.wtf\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}