第一步:(安装工具包)

  1. sudo yum install curl openssh-server postfix cronie
  2. sudo service postfix start
  3. sudo chkconfig postfix on
  4. sudo lokkit -s http -s ssh

第二步:(安装ruby,如果已安装则可跳过这个步骤)

  1. sudo yum install ruby ruby-irb

第三步:(下载并安装gitlab-ce-xx.rpm安装包)

  1. curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
  2. sudo yum install gitlab-ce

如果下载过于缓慢或下载失败,则可选择使用以下方式

http://pan.baidu.com/s/1kTzsCfX

如果已成功下载,则使用下面的命令安装

  1. rpm -i gitlab-ce-XXX.rpm

第四步:(修复软连接)

首先修复modprobe

  1. rm -f /sbin/modprobe
  2. ln -s /bin/true /sbin/modprobe

其次修复sysctl

  1. rm -f /sbin/sysctl
  2. ln -s /bin/true /sbin/sysctl

如果在配置使用过程中,出现了以下错误,一定要使用上述操作步骤进行修复

  1. error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
  2. error: "net.bridge.bridge-nf-call-iptables" is an unknown key
  3. error: "net.bridge.bridge-nf-call-arptables" is an unknown key
  4. error: permission denied on key 'net.ipv4.tcp_max_syn_backlog'
  5. error: permission denied on key 'net.core.netdev_max_backlog'
  6. error: permission denied on key 'net.core.wmem_default'
  7. error: permission denied on key 'net.core.rmem_default'
  8. error: permission denied on key 'net.core.rmem_max'
  9. error: permission denied on key 'net.core.wmem_max'
  10. error: permission denied on key 'net.ipv4.tcp_timestamps'
  11. error: permission denied on key 'net.ipv4.tcp_synack_retries'
  12. error: permission denied on key 'net.ipv4.tcp_syn_retries'
  13. error: permission denied on key 'net.ipv4.tcp_tw_recycle'
  14. error: permission denied on key 'net.ipv4.tcp_tw_reuse'
  15. error: permission denied on key 'net.ipv4.tcp_mem'
  16. error: permission denied on key 'net.ipv4.tcp_max_orphans'
  17. error: permission denied on key 'net.ipv4.ip_local_port_range'

第五步:(修改日志文件夹的访问权限)

  1. sudo chmod -R /var/log/gitlab

第六步:(配置gitlab.rb文件,主要看未注释掉的代码部分)

  1. sudo nano /etc/gitlab/gitlab.rb

修改后的文件如下

  1. ## Latest options listed at https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template
  2.  
  3. ## Url on which GitLab will be reachable.
  4. ## For more details on configuring external_url see:
  5. ## https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#configuring-the-external-url-for-gitlab
  6. external_url 'http://localhost'
  7.  
  8. ## Note: configuration settings below are optional.
  9. ## Uncomment and change the value.
  10. ############################
  11. # gitlab.yml configuration #
  12. ############################
  13.  
  14. # gitlab_rails['gitlab_ssh_host'] = 'ssh.host_example.com'
  15. # gitlab_rails['time_zone'] = 'UTC'
  16. # gitlab_rails['gitlab_email_enabled'] = true
  17. gitlab_rails['gitlab_email_from'] = 'xxxxxxxx@163.com'
  18. # gitlab_rails['gitlab_email_display_name'] = 'Example'
  19. # gitlab_rails['gitlab_email_reply_to'] = 'noreply@example.com'
  20. # gitlab_rails['gitlab_default_can_create_group'] = true
  21. # gitlab_rails['gitlab_username_changing_enabled'] = true
  22. # gitlab_rails['gitlab_default_theme'] =
  23. # gitlab_rails['gitlab_restricted_visibility_levels'] = nil # to restrict public and internal: ['public', 'internal']
  24. # gitlab_rails['gitlab_default_projects_features_issues'] = true
  25. # gitlab_rails['gitlab_default_projects_features_merge_requests'] = true
  26. # gitlab_rails['gitlab_default_projects_features_wiki'] = true
  27. # gitlab_rails['gitlab_default_projects_features_snippets'] = false
  28. # gitlab_rails['gitlab_default_projects_features_visibility_level'] = 'private'
  29. # gitlab_rails['gitlab_repository_downloads_path'] = 'tmp/repositories'
  30. # gitlab_rails['gravatar_plain_url'] = 'http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
  31. # gitlab_rails['gravatar_ssl_url'] = 'https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon'
  32. # gitlab_rails['webhook_timeout'] =
  33.  
  34. ## Reply by email
  35. # You need access to IMAP-enabled email account. For details
  36. # see http://doc.gitlab.com/ce/incoming_email/README.html
  37. # gitlab_rails['incoming_email_enabled'] = true
  38. # gitlab_rails['incoming_email_address'] = "incoming+%{key}@gitlab.example.com"
  39. # gitlab_rails['incoming_email_host'] = "imap.gmail.com" # IMAP server host
  40. # gitlab_rails['incoming_email_port'] = # IMAP server port
  41. # gitlab_rails['incoming_email_ssl'] = true # Whether the IMAP server uses SSL
  42. # gitlab_rails['incoming_email_start_tls'] = false # Whether the IMAP server uses StartTLS
  43. # gitlab_rails['incoming_email_email'] = "incoming@gitlab.example.com" # Email account username. Usually the full email address.
  44. # gitlab_rails['incoming_email_password'] = "password" # Email account password
  45. # gitlab_rails['incoming_email_mailbox_name'] = "inbox" # The name of the mailbox where incoming mail will end up.
  46. # gitlab_rails['incoming_email_log_directory'] = "/var/log/gitlab/mailroom"
  47.  
  48. ## For setting up LDAP
  49. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#setting-up-ldap-sign-in
  50. ## Be careful not to break the identation in the ldap_servers block. It is in
  51. ## yaml format and the spaces must be retained. Using tabs will not work.
  52.  
  53. # gitlab_rails['ldap_enabled'] = false
  54. # gitlab_rails['ldap_servers'] = YAML.load <<-'EOS' # remember to close this block with 'EOS' below
  55. # main: # 'main' is the GitLab 'provider ID' of this LDAP server
  56. # label: 'LDAP'
  57. # host: '_your_ldap_server'
  58. # port:
  59. # uid: 'sAMAccountName'
  60. # method: 'plain' # "tls" or "ssl" or "plain"
  61. # bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
  62. # password: '_the_password_of_the_bind_user'
  63. # active_directory: true
  64. # allow_username_or_email_login: false
  65. # block_auto_created_users: false
  66. # base: ''
  67. # user_filter: ''
  68. # ## EE only
  69. # group_base: ''
  70. # admin_group: ''
  71. # sync_ssh_keys: false
  72. #
  73. # secondary: # 'secondary' is the GitLab 'provider ID' of second LDAP server
  74. # label: 'LDAP'
  75. # host: '_your_ldap_server'
  76. # port:
  77. # uid: 'sAMAccountName'
  78. # method: 'plain' # "tls" or "ssl" or "plain"
  79. # bind_dn: '_the_full_dn_of_the_user_you_will_bind_with'
  80. # password: '_the_password_of_the_bind_user'
  81. # active_directory: true
  82. # allow_username_or_email_login: false
  83. # block_auto_created_users: false
  84. # base: ''
  85. # user_filter: ''
  86. # ## EE only
  87. # group_base: ''
  88. # admin_group: ''
  89. # sync_ssh_keys: false
  90. # EOS
  91.  
  92. ## Setting up Kerberos (EE only)
  93. ## See http://doc.gitlab.com/ee/integration/kerberos.html#http-git-access
  94. # gitlab_rails['kerberos_enabled'] = true
  95. # gitlab_rails['kerberos_keytab'] = /etc/http.keytab
  96. # gitlab_rails['kerberos_service_principal_name'] = HTTP/gitlab.example.com@EXAMPLE.COM
  97. # gitlab_rails['kerberos_use_dedicated_port'] = true
  98. # gitlab_rails['kerberos_port'] =
  99. # gitlab_rails['kerberos_https'] = true
  100.  
  101. ## For setting up omniauth
  102. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#omniauth-google-twitter-github-login
  103.  
  104. # gitlab_rails['omniauth_enabled'] = true
  105. # gitlab_rails['omniauth_allow_single_sign_on'] = false
  106. # gitlab_rails['omniauth_auto_sign_in_with_provider'] = 'saml'
  107. # gitlab_rails['omniauth_block_auto_created_users'] = true
  108. # gitlab_rails['omniauth_auto_link_ldap_user'] = false
  109. # gitlab_rails['omniauth_providers'] = [
  110. # {
  111. # "name" => "google_oauth2",
  112. # "app_id" => "YOUR APP ID",
  113. # "app_secret" => "YOUR APP SECRET",
  114. # "args" => { "access_type" => "offline", "approval_prompt" => "" }
  115. # }
  116. # ]
  117. #
  118. # If you setup bitbucket importer under omniauth providers you will need to add the keys
  119. # which will allow connection between bitbucket and gitlab.
  120. # For details see http://doc.gitlab.com/ce/integration/bitbucket.html
  121. # gitlab_rails['bitbucket'] = {
  122. # 'known_hosts_key' => 'bitbucket.org,207.223.240.182 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==',
  123. # 'private_key' => '-----BEGIN RSA PRIVATE KEY-----
  124. # MIIEowIBAAKCAQEAyXxYHwz2KjcwSjTREwlhYHqrf/8U0UM8ej3cqQ551gE4Wo3t
  125. # -----END RSA PRIVATE KEY-----',
  126. # 'public_key' => 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJfFgfDPYqN git@gitlab.example.com'
  127. # }
  128.  
  129. ## For setting up backups
  130. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#backups
  131.  
  132. # gitlab_rails['backup_path'] = "/var/opt/gitlab/backups"
  133. # gitlab_rails['backup_archive_permissions'] = # See: http://doc.gitlab.com/ce/raketasks/backup_restore.html#backup-archive-permissions
  134. # gitlab_rails['backup_pg_schema'] = 'public'
  135. # gitlab_rails['backup_keep_time'] =
  136. # gitlab_rails['backup_upload_connection'] = {
  137. # 'provider' => 'AWS',
  138. # 'region' => 'eu-west-1',
  139. # 'aws_access_key_id' => 'AKIAKIAKI',
  140. # 'aws_secret_access_key' => 'secret123'
  141. # }
  142. # gitlab_rails['backup_upload_remote_directory'] = 'my.s3.bucket'
  143. # gitlab_rails['backup_multipart_chunk_size'] =
  144.  
  145. ## For setting up different data storing directory
  146. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#storing-git-data-in-an-alternative-directory
  147. ## If you want to use a single non-default directory to store git data use
  148. ## a path that doesn't contain symlinks.
  149. # git_data_dir "/var/opt/gitlab/git-data"
  150.  
  151. # gitlab_rails['satellites_timeout'] =
  152.  
  153. ## GitLab Shell settings for GitLab
  154. # gitlab_rails['gitlab_shell_ssh_port'] =
  155. # gitlab_rails['git_max_size'] =
  156. # gitlab_rails['git_timeout'] =
  157.  
  158. ## Extra customization
  159. # gitlab_rails['extra_google_analytics_id'] = '_your_tracking_id'
  160. # gitlab_rails['extra_piwik_url'] = '_your_piwik_url'
  161. # gitlab_rails['extra_piwik_site_id'] = '_your_piwik_site_id'
  162. # gitlab_rails['extra_sign_in_text'] = '|
  163. # ![Company Logo](http://www.companydomain.com/logo.png)
  164. # [Learn more about CompanyName](http://www.companydomain.com/)'
  165.  
  166. # gitlab_rails['env'] = {
  167. # 'BUNDLE_GEMFILE' => "/opt/gitlab/embedded/service/gitlab-rails/Gemfile",
  168. # 'PATH' => "/opt/gitlab/bin:/opt/gitlab/embedded/bin:/bin:/usr/bin"
  169. # }
  170.  
  171. # gitlab_rails['rack_attack_git_basic_auth'] = {
  172. # 'enabled' => true,
  173. # 'ip_whitelist' => ["127.0.0.1"],
  174. # 'maxretry' => ,
  175. # 'findtime' => ,
  176. # 'bantime' =>
  177. # }
  178.  
  179. # We do not recommend changing these directories.
  180. # gitlab_rails['dir'] = "/var/opt/gitlab/gitlab-rails"
  181. # gitlab_rails['log_directory'] = "/var/log/gitlab/gitlab-rails"
  182.  
  183. ###############################
  184. # GitLab application settings #
  185. ###############################
  186.  
  187. # gitlab_rails['uploads_directory'] = "/var/opt/gitlab/gitlab-rails/uploads"
  188. # gitlab_rails['rate_limit_requests_per_period'] =
  189. # gitlab_rails['rate_limit_period'] =
  190.  
  191. # Change the initial default admin password.
  192. # Only applicable on inital setup, changing this setting after database is created and seeded
  193. # won't yield any change.
  194. # gitlab_rails['initial_root_password'] = "password"
  195.  
  196. ############################
  197. # GitLab database settings #
  198. ############################
  199. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/database.md#database-settings
  200. ## Only needed if you use an external database.
  201.  
  202. # gitlab_rails['db_adapter'] = "postgresql"
  203. # gitlab_rails['db_encoding'] = "unicode"
  204. # gitlab_rails['db_database'] = "gitlabhq_production"
  205. # gitlab_rails['db_pool'] =
  206. # gitlab_rails['db_username'] = "gitlab"
  207. # gitlab_rails['db_password'] = nil
  208. # gitlab_rails['db_host'] = nil
  209. # gitlab_rails['db_port'] =
  210. # gitlab_rails['db_socket'] = nil
  211. # gitlab_rails['db_sslmode'] = nil
  212. # gitlab_rails['db_sslrootcert'] = nil
  213.  
  214. #########################
  215. # GitLab redis settings #
  216. #########################
  217. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/redis.md#redis-settings
  218. ## Connect to your own redis instance.
  219.  
  220. # gitlab_rails['redis_host'] = "127.0.0.1"
  221. # gitlab_rails['redis_port'] = nil
  222. # gitlab_rails['redis_password'] = nil
  223. # gitlab_rails['redis_database'] =
  224. # gitlab_rails['redis_socket'] = "/var/opt/gitlab/redis/redis.socket"
  225.  
  226. ################################
  227. # GitLab email server settings #
  228. ################################
  229. # see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/smtp.md#smtp-settings
  230. # Use smtp instead of sendmail/postfix.
  231.  
  232. gitlab_rails['smtp_enable'] = true
  233. gitlab_rails['smtp_address'] = "smtp.163.com"
  234. gitlab_rails['smtp_port'] =
  235. gitlab_rails['smtp_user_name'] = "xxxxxxxx@163.com"
  236. gitlab_rails['smtp_password'] = "mjaiuhvi"
  237. gitlab_rails['smtp_domain'] = "163.com"
  238. gitlab_rails['smtp_authentication'] = "login"
  239. gitlab_rails['smtp_enable_starttls_auto'] = true
  240. gitlab_rails['smtp_tls'] = false
  241. gitlab_rails['smtp_openssl_verify_mode'] = 'none' # Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see http://api.rubyonrails.org/classes/ActionMailer/Base.html
  242. # gitlab_rails['smtp_ca_path'] = "/etc/ssl/certs"
  243. # gitlab_rails['smtp_ca_file'] = "/etc/ssl/certs/ca-certificates.crt"
  244.  
  245. ##########################
  246. # GitLab git http server #
  247. ##########################
  248. # see https://gitlab.com/gitlab-org/gitlab-git-http-server/blob/master/README.md
  249.  
  250. # gitlab_git_http_server['enable'] = true
  251. # gitlab_git_http_server['ha'] = false
  252. # gitlab_git_http_server['repo_root'] = "/var/opt/gitlab/git-data/repositories"
  253. # gitlab_git_http_server['listen_network'] = "unix"
  254. # gitlab_git_http_server['listen_umask'] =
  255. # gitlab_git_http_server['listen_addr'] = "/var/opt/gitlab/gitlab-git-http-server/socket"
  256. # gitlab_git_http_server['auth_backend'] = "http://localhost:8080"
  257. # gitlab_git_http_server['pprof_listen_addr'] = "''" # put an empty string on the command line
  258. # gitlab_git_http_server['dir'] = "/var/opt/gitlab/gitlab-git-http-server"
  259. # gitlab_git_http_server['log_dir'] = "/var/log/gitlab/gitlab-git-http-server"
  260.  
  261. ###############
  262. # GitLab user #
  263. ###############
  264. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#changing-the-name-of-the-git-user-group
  265. ## Modify default git user.
  266.  
  267. user['username'] = "gitlab"
  268. user['group'] = "gitlab"
  269. # user['uid'] = nil
  270. # user['gid'] = nil
  271. # # The shell for the git user
  272. #user['shell'] = "/bin/sh"
  273. # # The home directory for the git user
  274. #user['home'] = "/var/opt/gitlab"
  275. #user['git_user_name'] = "GitLab"
  276. user['git_user_email'] = "xxxxxxxx@163.com"
  277.  
  278. ##################
  279. # GitLab Unicorn #
  280. ##################
  281. ## Tweak unicorn settings.
  282.  
  283. # unicorn['worker_timeout'] =
  284. # unicorn['worker_processes'] =
  285.  
  286. ## Advanced settings
  287. # unicorn['listen'] = '127.0.0.1'
  288. # unicorn['port'] =
  289. # unicorn['socket'] = '/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket'
  290. # unicorn['pidfile'] = '/opt/gitlab/var/unicorn/unicorn.pid'
  291. # unicorn['tcp_nopush'] = true
  292. # unicorn['backlog_socket'] =
  293. # Make sure somaxconn is equal or higher then backlog_socket
  294. # unicorn['somaxconn'] =
  295. # We do not recommend changing this setting
  296. # unicorn['log_directory'] = "/var/log/gitlab/unicorn"
  297.  
  298. ## Only change these settings if you understand well what they mean
  299. ## see https://about.gitlab.com/2015/06/05/how-gitlab-uses-unicorn-and-unicorn-worker-killer/
  300. ## and https://github.com/kzk/unicorn-worker-killer
  301. # unicorn['worker_memory_limit_min'] = "200*(1024**2)"
  302. # unicorn['worker_memory_limit_max'] = "250*(1024**2)"
  303.  
  304. ##################
  305. # GitLab Sidekiq #
  306. ##################
  307.  
  308. # sidekiq['log_directory'] = "/var/log/gitlab/sidekiq"
  309. # sidekiq['shutdown_timeout'] =
  310.  
  311. ################
  312. # gitlab-shell #
  313. ################
  314.  
  315. # gitlab_shell['audit_usernames'] = false
  316. # gitlab_shell['log_level'] = 'INFO'
  317. # gitlab_shell['http_settings'] = { user: 'username', password: 'password', ca_file: '/etc/ssl/cert.pem', ca_path: '/etc/pki/tls/certs', self_signed_cert: false}
  318. # gitlab_shell['log_directory'] = "/var/log/gitlab/gitlab-shell/"
  319.  
  320. ## If enabled, git-annex needs to be installed on the server where gitlab is setup
  321. # For Debian and Ubuntu systems this can be done with: sudo apt-get install git-annex
  322. # For CentOS: sudo yum install epel-release && sudo yum install git-annex
  323. # gitlab_shell['git_annex_enabled'] = false
  324.  
  325. #####################
  326. # GitLab PostgreSQL #
  327. #####################
  328.  
  329. postgresql['enable'] = true
  330. # postgresql['listen_address'] = nil
  331. postgresql['port'] =
  332. postgresql['data_dir'] = "/var/opt/gitlab/postgresql/data"
  333. postgresql['shared_buffers'] = "10MB" # recommend value is / of total RAM, up to 14GB.
  334.  
  335. ## Advanced settings
  336. # postgresql['ha'] = false
  337. # postgresql['dir'] = "/var/opt/gitlab/postgresql"
  338. postgresql['dir'] = "/tmp"
  339. # postgresql['log_directory'] = "/var/log/gitlab/postgresql"
  340. # postgresql['username'] = "gitlab-psql"
  341. # postgresql['uid'] = nil
  342. # postgresql['gid'] = nil
  343. # postgresql['shell'] = "/bin/sh"
  344. postgresql['home'] = "/var/opt/gitlab/postgresql"
  345. # postgresql['user_path'] = "/opt/gitlab/embedded/bin:/opt/gitlab/bin:$PATH"
  346. postgresql['sql_user'] = "gitlab"
  347. postgresql['sql_ci_user'] = "gitlab_ci"
  348. postgresql['max_connections'] =
  349. # postgresql['md5_auth_cidr_addresses'] = []
  350. # postgresql['trust_auth_cidr_addresses'] = []
  351. # postgresql['shmmax'] = # or
  352. # postgresql['shmall'] = # or
  353. # postgresql['work_mem'] = "8MB"
  354. # postgresql['effective_cache_size'] = "1MB"
  355. # postgresql['checkpoint_segments'] =
  356. postgresql['checkpoint_timeout'] = "5min"
  357. # postgresql['checkpoint_completion_target'] = 0.9
  358. postgresql['checkpoint_warning'] = "60s"
  359.  
  360. ################
  361. # GitLab Redis #
  362. ################
  363. ## Can be disabled if you are using your own redis instance.
  364.  
  365. # redis['enable'] = true
  366. # redis['username'] = "gitlab-redis"
  367. # redis['uid'] = nil
  368. # redis['gid'] = nil
  369.  
  370. #####################
  371. # GitLab Web server #
  372. #####################
  373. ## see: https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/nginx.md#using-a-non-bundled-web-server
  374. ## When bundled nginx is disabled we need to add the external webserver user to the GitLab webserver group.
  375.  
  376. # web_server['external_users'] = []
  377. # web_server['username'] = 'gitlab-www'
  378. # web_server['group'] = 'gitlab-www'
  379. # web_server['uid'] = nil
  380. # web_server['gid'] = nil
  381. # web_server['shell'] = '/bin/false'
  382. # web_server['home'] = '/var/opt/gitlab/nginx'
  383.  
  384. ################
  385. # GitLab Nginx #
  386. ################
  387. ## see: https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/nginx.md
  388.  
  389. # nginx['enable'] = true
  390. # nginx['client_max_body_size'] = '250m'
  391. # nginx['redirect_http_to_https'] = false
  392. # nginx['redirect_http_to_https_port'] =
  393. # nginx['ssl_client_certificate'] = "/etc/gitlab/ssl/ca.crt" # Most root CA's are included by default
  394. # nginx['ssl_certificate'] = "/etc/gitlab/ssl/#{node['fqdn']}.crt"
  395. # nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/#{node['fqdn']}.key"
  396. # nginx['ssl_ciphers'] = "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256"
  397. # nginx['ssl_prefer_server_ciphers'] = "on"
  398. # nginx['ssl_protocols'] = "TLSv1 TLSv1.1 TLSv1.2" # recommended by https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html & https://cipherli.st/
  399. # nginx['ssl_session_cache'] = "builtin:1000 shared:SSL:10m" # recommended in http://nginx.org/en/docs/http/ngx_http_ssl_module.html
  400. # nginx['ssl_session_timeout'] = "5m" # default according to http://nginx.org/en/docs/http/ngx_http_ssl_module.html
  401. # nginx['ssl_dhparam'] = nil # Path to dhparams.pem, eg. /etc/gitlab/ssl/dhparams.pem
  402. # nginx['listen_addresses'] = ['*']
  403. # nginx['listen_port'] = nil # override only if you use a reverse proxy: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md#setting-the-nginx-listen-port
  404. # nginx['listen_https'] = nil # override only if your reverse proxy internally communicates over HTTP: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md#supporting-proxied-ssl
  405. # nginx['custom_gitlab_server_config'] = "location ^~ /foo-namespace/bar-project/raw/ {\n deny all;\n}\n"
  406. # nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/example.conf;"
  407. # nginx['proxy_read_timeout'] =
  408. # nginx['proxy_connect_timeout'] =
  409.  
  410. ## Advanced settings
  411. # nginx['dir'] = "/var/opt/gitlab/nginx"
  412. # nginx['log_directory'] = "/var/log/gitlab/nginx"
  413. # nginx['worker_processes'] =
  414. # nginx['worker_connections'] =
  415. # nginx['log_format'] = '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"'
  416. # nginx['sendfile'] = 'on'
  417. # nginx['tcp_nopush'] = 'on'
  418. # nginx['tcp_nodelay'] = 'on'
  419. # nginx['gzip'] = "on"
  420. # nginx['gzip_http_version'] = "1.0"
  421. # nginx['gzip_comp_level'] = ""
  422. # nginx['gzip_proxied'] = "any"
  423. # nginx['gzip_types'] = [ "text/plain", "text/css", "application/x-javascript", "text/xml", "application/xml", "application/xml+rss", "text/javascript", "application/json" ]
  424. # nginx['keepalive_timeout'] =
  425. # nginx['cache_max_size'] = '5000m'
  426.  
  427. ##################
  428. # GitLab Logging #
  429. ##################
  430. ## see: https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#logs
  431.  
  432. # logging['svlogd_size'] = * * # rotate after MB of log data
  433. # logging['svlogd_num'] = # keep rotated log files
  434. # logging['svlogd_timeout'] = * * # rotate after hours
  435. # logging['svlogd_filter'] = "gzip" # compress logs with gzip
  436. # logging['svlogd_udp'] = nil # transmit log messages via UDP
  437. # logging['svlogd_prefix'] = nil # custom prefix for log messages
  438. # logging['logrotate_frequency'] = "daily" # rotate logs daily
  439. # logging['logrotate_size'] = nil # do not rotate by size by default
  440. # logging['logrotate_rotate'] = # keep rotated logs
  441. # logging['logrotate_compress'] = "compress" # see 'man logrotate'
  442. # logging['logrotate_method'] = "copytruncate" # see 'man logrotate'
  443. # logging['logrotate_postrotate'] = nil # no postrotate command by default
  444. # Enterprise Edition only
  445. # logging['udp_log_shipping_host'] = nil # remote host to ship log messages to via UDP
  446. # logging['udp_log_shipping_port'] = # remote host to ship log messages to via UDP
  447.  
  448. #############
  449. # Logrotate #
  450. #############
  451. ## see: https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#logrotate
  452. ## You can disable built in logrotate feature.
  453.  
  454. # logrotate['enable'] = true
  455.  
  456. #############################
  457. # Users and groups accounts #
  458. #############################
  459. ## Should omnibus-gitlab package manage users and groups accounts.
  460. ## Only set if creating accounts manually
  461. ##
  462. #user['username'] = "gitlab"
  463. #user['group'] = "gitlab"
  464. # manage_accounts['enable'] = true
  465.  
  466. #######
  467. # Git #
  468. #######
  469. ## Advanced setting for configuring git system settings for omnibus-gitlab internal git
  470. ## For multiple options under one header use array of comma separated values, eg.
  471. ## { "receive" => ["fsckObjects = true"], "alias" => ["st = status", "co = checkout"] }
  472.  
  473. # omnibus_gitconfig['system'] = { "receive" => ["fsckObjects = true"] }
  474.  
  475. ############################################
  476. # Url on which GitLab CI will be reachable #
  477. ############################################
  478. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/gitlab-ci/README.md
  479.  
  480. # ci_external_url 'http://ci.example.com'
  481.  
  482. #################################
  483. # application.yml configuration #
  484. #################################
  485.  
  486. # gitlab_ci['gitlab_server'] = { "url" => 'http://gitlab.example.com', "app_id" => '', "app_secret" => 'QWERTY12345' }
  487.  
  488. # gitlab_ci['gitlab_ci_email_from'] = 'gitlab-ci@example.com'
  489. # gitlab_ci['gitlab_ci_support_email'] = 'gitlab-ci@example.com'
  490. # gitlab_ci['gitlab_ci_all_broken_builds'] = true
  491. # gitlab_ci['gitlab_ci_add_pusher'] = true
  492. # gitlab_ci['builds_directory'] = '/var/opt/gitlab/gitlab-ci/builds'
  493.  
  494. # gitlab_ci['gravatar_enabled'] = true
  495. # gitlab_ci['gravatar_plain_url'] = "http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm"
  496. # gitlab_ci['gravatar_ssl_url'] = "https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm"
  497.  
  498. ## For setting up backups
  499. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#backups
  500.  
  501. # gitlab_ci['backup_path'] = "/var/opt/gitlab/ci-backups"
  502. # gitlab_ci['backup_keep_time'] =
  503. # gitlab_ci['backup_upload_connection'] = {
  504. # 'provider' => 'AWS',
  505. # 'region' => 'eu-west-1',
  506. # 'aws_access_key_id' => 'AKIAKIAKI',
  507. # 'aws_secret_access_key' => 'secret123'
  508. # }
  509. # gitlab_ci['backup_upload_remote_directory'] = 'my.s3.bucket'
  510. # gitlab_ci['backup_multipart_chunk_size'] =
  511.  
  512. ###############################
  513. # GitLab CI database settings #
  514. ###############################
  515. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/database.md#database-settings
  516. ## Only needed if you use an external database.
  517.  
  518. # gitlab_ci['db_adapter'] = "postgresql"
  519. # gitlab_ci['db_encoding'] = "unicode"
  520. # gitlab_ci['db_database'] = "gitlab_ci_production"
  521. # gitlab_ci['db_pool'] =
  522. # gitlab_ci['db_username'] = "gitlab_ci"
  523. # gitlab_ci['db_password'] = nil
  524. # gitlab_ci['db_host'] = nil
  525. # gitlab_ci['db_port'] =
  526. # gitlab_ci['db_socket'] = nil
  527. # gitlab_ci['db_sslmode'] = nil
  528. # gitlab_ci['db_sslrootcert'] = nil
  529.  
  530. ############################
  531. # GitLab CI redis settings #
  532. ############################
  533. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/redis.md#redis-settings
  534. ## Connect to your own redis instance.
  535.  
  536. # gitlab_ci['redis_host'] = "127.0.0.1"
  537. # gitlab_ci['redis_port'] = nil
  538. # gitlab_ci['redis_socket'] = "/var/opt/gitlab/ci-redis/redis.socket"
  539.  
  540. ###################################
  541. # GitLab CI email server settings #
  542. ###################################
  543. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/smtp.md#smtp-settings
  544.  
  545. # gitlab_ci['smtp_enable'] = true
  546. # gitlab_ci['smtp_address'] = "smtp.server"
  547. # gitlab_ci['smtp_port'] =
  548. # gitlab_ci['smtp_user_name'] = "smtp user"
  549. # gitlab_ci['smtp_password'] = "smtp password"
  550. # gitlab_ci['smtp_domain'] = "example.com"
  551. # gitlab_ci['smtp_authentication'] = "login"
  552. # gitlab_ci['smtp_enable_starttls_auto'] = true
  553. # gitlab_ci['smtp_tls'] = false
  554. # gitlab_ci['smtp_openssl_verify_mode'] = false
  555.  
  556. #############
  557. # GitLab CI #
  558. #############
  559.  
  560. # gitlab_ci['schedule_builds_minute'] = ""
  561. # gitlab_ci['env'] = {
  562. # 'BUNDLE_GEMFILE' => "/opt/gitlab/embedded/service/gitlab-ci/Gemfile",
  563. # 'PATH' => "/opt/gitlab/bin:/opt/gitlab/embedded/bin:/bin:/usr/bin"
  564. # }
  565.  
  566. # gitlab_ci['username'] = "gitlab-ci"
  567. # gitlab_ci['uid'] = nil
  568. # gitlab_ci['gid'] = nil
  569.  
  570. #####################
  571. # GitLab CI Unicorn #
  572. #####################
  573. ## Tweak unicorn settings.
  574.  
  575. # ci_unicorn['worker_processes'] =
  576. # ci_unicorn['worker_timeout'] =
  577. ## Advanced settings
  578. # ci_unicorn['listen'] = '127.0.0.1'
  579. # ci_unicorn['port'] =
  580. # ci_unicorn['socket'] = '/var/opt/gitlab/gitlab-ci/sockets/gitlab.socket'
  581. # ci_unicorn['pidfile'] = '/opt/gitlab/var/ci-unicorn/unicorn.pid'
  582. # ci_unicorn['tcp_nopush'] = true
  583. # ci_unicorn['backlog_socket'] =
  584.  
  585. ###################
  586. # GitLab CI Redis #
  587. ###################
  588. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/redis.md
  589. ## You can turn off bundled redis if you want to use your own redis instanance
  590.  
  591. # ci_redis['enable'] = true
  592.  
  593. ###################
  594. # GitLab CI NGINX #
  595. ###################
  596. ## see https://gitlab.com/gitlab-org/omnibus-gitlab/tree/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/nginx.md
  597. ## You can tell the bundled NGINX that it should not serve up GitLab CI by setting ci_nginx['enable'] to false.
  598.  
  599. # ci_nginx['enable'] = false
  600. # ci_nginx['client_max_body_size'] = '250m'
  601. # ci_nginx['redirect_http_to_https'] = false
  602. # ci_nginx['redirect_http_to_https_port'] =
  603. # ci_nginx['ssl_certificate'] = "/etc/gitlab/ssl/#{node['fqdn']}.crt"
  604. # ci_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/#{node['fqdn']}.key"
  605. # ci_nginx['ssl_ciphers'] = "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256"
  606. # ci_nginx['ssl_prefer_server_ciphers'] = "on"
  607. # ci_nginx['ssl_protocols'] = "TLSv1 TLSv1.1 TLSv1.2" # recommended by https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html & https://cipherli.st/
  608. # ci_nginx['ssl_session_cache'] = "builtin:1000 shared:SSL:10m" # recommended in http://nginx.org/en/docs/http/ngx_http_ssl_module.html
  609. # ci_nginx['ssl_session_timeout'] = "5m" # default according to http://nginx.org/en/docs/http/ngx_http_ssl_module.html
  610. # ci_nginx['ssl_dhparam'] = nil # Path to ci_dhparams.pem, eg. /etc/gitlab/ssl/ci_dhparams.pem
  611. # ci_nginx['listen_addresses'] = ['*']
  612. # ci_nginx['listen_port'] = nil # override only if you use a reverse proxy: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md#setting-the-nginx-listen-port
  613. # ci_nginx['listen_https'] = nil # override only if your reverse proxy internally communicates over HTTP: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md#supporting-proxied-ssl
  614. # ci_nginx['custom_gitlab_ci_server_config'] = "location ^~ /foo-namespace/bar-project/raw/ {\n deny all;\n}\n"
  615. # ci_nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/example.conf;"
  616. # ci_nginx['resolver'] = "8.8.8.8 8.8.4.4"
  617.  
  618. ## Advanced settings
  619. # ci_nginx['dir'] = "/var/opt/gitlab/nginx"
  620. # ci_nginx['log_directory'] = "/var/log/gitlab/nginx"
  621. # ci_nginx['worker_processes'] =
  622. # ci_nginx['worker_connections'] =
  623. # ci_nginx['sendfile'] = 'on'
  624. # ci_nginx['tcp_nopush'] = 'on'
  625. # ci_nginx['tcp_nodelay'] = 'on'
  626. # ci_nginx['gzip'] = "on"
  627. # ci_nginx['gzip_http_version'] = "1.0"
  628. # ci_nginx['gzip_comp_level'] = ""
  629. # ci_nginx['gzip_proxied'] = "any"
  630. # ci_nginx['gzip_types'] = [ "text/plain", "text/css", "application/x-javascript", "text/xml", "application/xml", "application/xml+rss", "text/javascript", "application/json" ]
  631. # ci_nginx['keepalive_timeout'] =
  632. # ci_nginx['cache_max_size'] = '5000m'
  633.  
  634. #####################
  635. # GitLab Mattermost #
  636. #####################
  637.  
  638. # mattermost_external_url 'http://mattermost.example.com'
  639. #
  640. # mattermost['enable'] = false
  641. # mattermost['username'] = 'mattermost'
  642. # mattermost['group'] = 'mattermost'
  643. # mattermost['home'] = '/var/opt/gitlab/mattermost'
  644. # mattermost['database_name'] = 'mattermost_production'
  645.  
  646. # mattermost['log_file_directory'] = '/var/log/gitlab/mattermost'
  647. # mattermost['log_console_enable'] = true
  648. # mattermost['log_console_level'] = 'INFO'
  649. # mattermost['log_file_enable'] = false
  650. # mattermost['log_file_level'] = 'INFO'
  651. # mattermost['log_file_format'] = nil
  652.  
  653. # mattermost['service_site_name'] = "GitLab Mattermost"
  654. # mattermost['service_mode'] = 'beta'
  655. # mattermost['service_allow_testing'] = false
  656. # mattermost['service_use_ssl'] = false
  657. # mattermost['service_port'] = ""
  658. # mattermost['service_version'] = "developer"
  659. # mattermost['service_analytics_url'] = nil
  660. # mattermost['service_use_local_storage'] = true
  661. # mattermost['service_storage_directory'] = "/var/opt/gitlab/mattermost/data"
  662. # mattermost['service_allowed_login_attempts'] =
  663. # mattermost['service_disable_email_signup'] = true
  664.  
  665. # mattermost['sql_driver_name'] = 'mysql'
  666. # mattermost['sql_data_source'] = "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8"
  667. # mattermost['sql_data_source_replicas'] = ["mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8"]
  668. # mattermost['sql_max_idle_conns'] =
  669. # mattermost['sql_max_open_conns'] =
  670. # mattermost['sql_trace'] = false
  671.  
  672. # mattermost['oauth'] = {'gitlab' => {'Allow' => true, 'Secret' => "", 'Id' => "", "AuthEndpoint" => "aa", "TokenEndpoint" => "bb", "UserApiEndpoint" => "cc", "Scope" => "" }}
  673. # mattermost['aws'] = {'S3AccessKeyId' => '', 'S3SecretAccessKey' => '', 'S3Bucket' => 'aa', 'S3Region' => 'bb'}
  674. # mattermost['image_thumbnail_width'] =
  675. # mattermost['image_thumbnail_height'] =
  676. # mattermost['image_preview_width'] =
  677. # mattermost['image_preview_height'] =
  678. # mattermost['image_profile_width'] =
  679. # mattermost['image_profile_height'] =
  680. # mattermost['image_initial_font'] = 'luximbi.ttf'
  681.  
  682. # mattermost['email_by_pass_email'] = true
  683. # mattermost['email_smtp_username'] = nil
  684. # mattermost['email_smtp_password'] = nil
  685. # mattermost['email_smtp_server'] = nil
  686. # mattermost['email_use_tls'] = false
  687. # mattermost['email_use_start_tls'] = false
  688. # mattermost['email_feedback_email'] = nil
  689. # mattermost['email_feedback_name'] = nil
  690. # mattermost['email_apple_push_server'] = nil
  691. # mattermost['email_apple_push_cert_public'] = nil
  692. # mattermost['email_apple_push_cert_private'] = nil
  693.  
  694. # mattermost['ratelimit_use_rate_limiter'] = true
  695. # mattermost['ratelimit_per_sec'] =
  696. # mattermost['ratelimit_memory_store_size'] =
  697. # mattermost['ratelimit_vary_by_remote_addr'] = true
  698. # mattermost['ratelimit_vary_by_header'] = nil
  699.  
  700. # mattermost['privacy_show_email_address'] = true
  701. # mattermost['privacy_show_phone_number'] = true
  702. # mattermost['privacy_show_skype_id'] = true
  703. # mattermost['privacy_show_full_name'] = true
  704.  
  705. # mattermost['team_max_users_per_team'] =
  706. # mattermost['team_allow_public_link'] = true
  707. # mattermost['team_allow_valet_default'] = false
  708. # mattermost['team_terms_link'] = '/static/help/configure_links.html'
  709. # mattermost['team_privacy_link'] = '/static/help/configure_links.html'
  710. # mattermost['team_about_link'] = '/static/help/configure_links.html'
  711. # mattermost['team_help_link'] = '/static/help/configure_links.html'
  712. # mattermost['team_report_problem_link'] = '/static/help/configure_links.html'
  713. # mattermost['team_tour_link'] = '/static/help/configure_links.html'
  714. # mattermost['team_default_color'] = '#2389D7'
  715. # mattermost['team_disable_team_creation'] = true
  716. # mattermost['team_restrict_creation_to_domains'] = "gmail.com"
  717.  
  718. ####################
  719. # Mattermost NGINX #
  720. ####################
  721.  
  722. # mattermost_nginx['enable'] = false
  723. # mattermost_nginx['client_max_body_size'] = '250m'
  724. # mattermost_nginx['redirect_http_to_https'] = false
  725. # mattermost_nginx['redirect_http_to_https_port'] =
  726. # mattermost_nginx['ssl_certificate'] = "/etc/gitlab/ssl/#{node['fqdn']}.crt"
  727. # mattermost_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/#{node['fqdn']}.key"
  728. # mattermost_nginx['ssl_ciphers'] = "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256"
  729. # mattermost_nginx['ssl_prefer_server_ciphers'] = "on"
  730. # mattermost_nginx['ssl_protocols'] = "TLSv1 TLSv1.1 TLSv1.2" # recommended by https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html & https://cipherli.st/
  731. # mattermost_nginx['ssl_session_cache'] = "builtin:1000 shared:SSL:10m" # recommended in http://nginx.org/en/docs/http/ngx_http_ssl_module.html
  732. # mattermost_nginx['ssl_session_timeout'] = "5m" # default according to http://nginx.org/en/docs/http/ngx_http_ssl_module.html
  733. # mattermost_nginx['ssl_dhparam'] = nil # Path to ci_dhparams.pem, eg. /etc/gitlab/ssl/ci_dhparams.pem
  734. # mattermost_nginx['listen_addresses'] = ['*']
  735. # mattermost_nginx['listen_port'] = nil # override only if you use a reverse proxy: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md#setting-the-nginx-listen-port
  736. # mattermost_nginx['listen_https'] = nil # override only if your reverse proxy internally communicates over HTTP: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md#supporting-proxied-ssl
  737. # mattermost_nginx['custom_gitlab_mattermost_server_config'] = "location ^~ /foo-namespace/bar-project/raw/ {\n deny all;\n}\n"
  738. # mattermost_nginx['custom_nginx_config'] = "include /etc/nginx/conf.d/example.conf;"
  739.  
  740. ## Advanced settings
  741. # mattermost_nginx['dir'] = "/var/opt/gitlab/nginx"
  742. # mattermost_nginx['log_directory'] = "/var/log/gitlab/nginx"
  743. # mattermost_nginx['worker_processes'] =
  744. # mattermost_nginx['worker_connections'] =
  745. # mattermost_nginx['sendfile'] = 'on'
  746. # mattermost_nginx['tcp_nopush'] = 'on'
  747. # mattermost_nginx['tcp_nodelay'] = 'on'
  748. # mattermost_nginx['gzip'] = "on"
  749. # mattermost_nginx['gzip_http_version'] = "1.0"
  750. # mattermost_nginx['gzip_comp_level'] = ""
  751. # mattermost_nginx['gzip_proxied'] = "any"
  752. # mattermost_nginx['gzip_types'] = [ "text/plain", "text/css", "application/x-javascript", "text/xml", "application/xml", "application/xml+rss", "text/javascript", "application/json" ]
  753. # mattermost_nginx['keepalive_timeout'] =
  754. # mattermost_nginx['cache_max_size'] = '5000m'

注:在这里唯一需要修改的就是把文件里xxxxxxxx@163.com这个邮件地址改为自己真实可用的邮箱地址即可,好像一共有三处;其次别忘了在这里修改自己的邮箱密码,如果是163邮箱,录入的密码不是真实的邮箱密码,而是代理密码,即一个加密后的密码串,具体情况自己可登录163邮箱查看。

  1. gitlab_rails['smtp_user_name'] = "xxxxxxxx@163.com"
  2. gitlab_rails['smtp_password'] = "mjaiuhvi"

第七步:(修改PostgreSQL的配置文件)

在这里需要依次修改两个文件(如果你需要远程访问PostgreSQL数据库,需要再额外的修改postgresql.conf文件),分别为pg_hba.conf与postgresql.conf文件

  1. sudo nano /var/opt/gitlab/postgresql/data/pg_hba.conf
  2. sudo nano /var/opt/gitlab/postgresql/data/postgresql.conf

1)配置待访问的主机IP(客户端)

  1. # This file is managed by gitlab-ctl. Manual changes will be
  2. # erased! To change the contents below, edit /etc/gitlab/gitlab.rb
  3. # and run `sudo gitlab-ctl reconfigure`.
  4.  
  5. # PostgreSQL Client Authentication Configuration File
  6. # ===================================================
  7. #
  8. # Refer to the "Client Authentication" section in the
  9. # PostgreSQL documentation for a complete description
  10. # of this file. A short synopsis follows.
  11. #
  12. # This file controls: which hosts are allowed to connect, how clients
  13. # are authenticated, which PostgreSQL user names they can use, which
  14. # databases they can access. Records take one of these forms:
  15. #
  16. # local DATABASE USER METHOD [OPTION]
  17. # host DATABASE USER CIDR-ADDRESS METHOD [OPTION]
  18. # hostssl DATABASE USER CIDR-ADDRESS METHOD [OPTION]
  19. # hostnossl DATABASE USER CIDR-ADDRESS METHOD [OPTION]
  20. #
  21. # (The uppercase items must be replaced by actual values.)
  22. #
  23. # The first field is the connection type: "local" is a Unix-domain socket,
  24. # "host" is either a plain or SSL-encrypted TCP/IP socket, "hostssl" is an
  25. # SSL-encrypted TCP/IP socket, and "hostnossl" is a plain TCP/IP socket.
  26. #
  27. # DATABASE can be "all", "sameuser", "samerole", a database name, or
  28. # a comma-separated list thereof.
  29. #
  30. # USER can be "all", a user name, a group name prefixed with "+", or
  31. # a comma-separated list thereof. In both the DATABASE and USER fields
  32. # you can also write a file name prefixed with "@" to include names from
  33. # a separate file.
  34. #
  35. # CIDR-ADDRESS specifies the set of hosts the record matches.
  36. # It is made up of an IP address and a CIDR mask that is an integer
  37. # (between and (IPv4) or (IPv6) inclusive) that specifies
  38. # the number of significant bits in the mask. Alternatively, you can write
  39. # an IP address and netmask in separate columns to specify the set of hosts.
  40. #
  41. # METHOD can be "trust", "reject", "md5", "crypt", "password", "gss", "sspi",
  42. # "krb5", "ident", "pam" or "ldap". Note that "password" sends passwords
  43. # in clear text; "md5" is preferred since it sends encrypted passwords.
  44. #
  45. # OPTION is the ident map or the name of the PAM service, depending on METHOD.
  46. #
  47. # Database and user names containing spaces, commas, quotes and other special
  48. # characters must be quoted. Quoting one of the keywords "all", "sameuser" or
  49. # "samerole" makes the name lose its special character, and just match a
  50. # database or username with that name.
  51. #
  52. # This file is read on server startup and when the postmaster receives
  53. # a SIGHUP signal. If you edit the file on a running system, you have
  54. # to SIGHUP the postmaster for the changes to take effect. You can use
  55. # "pg_ctl reload" to do that.
  56.  
  57. # Put your actual configuration here
  58. # ----------------------------------
  59. #
  60. # If you want to allow non-local connections, you need to add more
  61. # "host" records. In that case you will also need to make PostgreSQL listen
  62. # on a non-local interface via the listen_addresses configuration parameter,
  63. # or via the -i or -h command line switches.
  64. #
  65.  
  66. # TYPE DATABASE USER CIDR-ADDRESS METHOD
  67.  
  68. # "local" is for Unix domain socket connections only
  69. local all all trust
  70. host all all 192.168.30.0/ trust
  71. host all all 192.168.10.0/ trust
  72. #map=gitlab

如果希望某个IP段的主机也可以访问数据库,只需再增加这个段就可以了,例如192.168.10.0~192.168.10.255,就可以写成以下的方式

  1. host all all 192.168.10.0/ trust

2)启用监听所有客户端

  1. # This file is managed by gitlab-ctl. Manual changes will be
  2. # erased! To change the contents below, edit /etc/gitlab/gitlab.rb
  3. # and run `sudo gitlab-ctl reconfigure`.
  4.  
  5. # -----------------------------
  6. # PostgreSQL configuration file
  7. # -----------------------------
  8. #
  9. # This file consists of lines of the form:
  10. #
  11. # name = value
  12. #
  13. # (The "=" is optional.) Whitespace may be used. Comments are introduced with
  14. # "#" anywhere on a line. The complete list of parameter names and allowed
  15. # values can be found in the PostgreSQL documentation.
  16. #
  17. # The commented-out settings shown in this file represent the default values.
  18. # Re-commenting a setting is NOT sufficient to revert it to the default value;
  19. # you need to reload the server.
  20. #
  21. # This file is read on server startup and when the server receives a SIGHUP
  22. # signal. If you edit the file on a running system, you have to SIGHUP the
  23. # server for the changes to take effect, or use "pg_ctl reload". Some
  24. # parameters, which are marked below, require a server shutdown and restart to
  25. # take effect.
  26. #
  27. # Any parameter can also be given as a command-line option to the server, e.g.,
  28. # "postgres -c log_connections=on". Some parameters can be changed at run time
  29. # with the "SET" SQL command.
  30. #
  31. # Memory units: kB = kilobytes Time units: ms = milliseconds
  32. # MB = megabytes s = seconds
  33. # GB = gigabytes min = minutes
  34. # h = hours
  35. # d = days
  36.  
  37. #------------------------------------------------------------------------------
  38. # FILE LOCATIONS
  39. #------------------------------------------------------------------------------
  40.  
  41. # The default values of these variables are driven from the -D command-line
  42. # option or PGDATA environment variable, represented here as ConfigDir.
  43.  
  44. #data_directory = 'ConfigDir' # use data in another directory
  45. # (change requires restart)
  46. #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file
  47. # (change requires restart)
  48. #ident_file = 'ConfigDir/pg_ident.conf' # ident configuration file
  49. # (change requires restart)
  50.  
  51. # If external_pid_file is not explicitly set, no extra PID file is written.
  52. #external_pid_file = '(none)' # write an extra PID file
  53. # (change requires restart)
  54.  
  55. #------------------------------------------------------------------------------
  56. # CONNECTIONS AND AUTHENTICATION
  57. #------------------------------------------------------------------------------
  58.  
  59. # - Connection Settings -
  60.  
  61. listen_addresses = '*' # what IP address(es) to listen on;
  62. # comma-separated list of addresses;
  63. # defaults to 'localhost', '*' = all
  64. # (change requires restart)
  65. port = # (change requires restart)
  66. max_connections = # (change requires restart)
  67. # Note: Increasing max_connections costs ~ bytes of shared memory per
  68. # connection slot, plus lock space (see max_locks_per_transaction).
  69. #superuser_reserved_connections = # (change requires restart)
  70. unix_socket_directory = '/var/opt/gitlab/postgresql' # (change requires restart)
  71. #unix_socket_group = '' # (change requires restart)
  72. #unix_socket_permissions = # begin with to use octal notation
  73. # (change requires restart)
  74. #bonjour = off # advertise server via Bonjour
  75. # (change requires restart)
  76. #bonjour_name = '' # defaults to the computer name
  77. # (change requires restart)
  78.  
  79. # - Security and Authentication -
  80.  
  81. #authentication_timeout = 1min # 1s-600s
  82. #ssl = off # (change requires restart)
  83. #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
  84. # (change requires restart)
  85. #ssl_renegotiation_limit = 512MB # amount of data between renegotiations
  86. #password_encryption = on
  87. #db_user_namespace = off
  88.  
  89. # Kerberos and GSSAPI
  90. #krb_server_keyfile = ''
  91. #krb_srvname = 'postgres' # (Kerberos only)
  92. #krb_caseins_users = off
  93.  
  94. # - TCP Keepalives -
  95. # see "man 7 tcp" for details
  96.  
  97. #tcp_keepalives_idle = # TCP_KEEPIDLE, in seconds;
  98. # selects the system default
  99. #tcp_keepalives_interval = # TCP_KEEPINTVL, in seconds;
  100. # selects the system default
  101. #tcp_keepalives_count = # TCP_KEEPCNT;
  102. # selects the system default
  103.  
  104. #------------------------------------------------------------------------------
  105. # RESOURCE USAGE (except WAL)
  106. #------------------------------------------------------------------------------
  107.  
  108. # - Memory -
  109.  
  110. shared_buffers = 10MB # min 128kB
  111. # (change requires restart)
  112. #temp_buffers = 8MB # min 800kB
  113. #max_prepared_transactions = # zero disables the feature
  114. # (change requires restart)
  115. # Note: Increasing max_prepared_transactions costs ~ bytes of shared memory
  116. # per transaction slot, plus lock space (see max_locks_per_transaction).
  117. # It is not advisable to set max_prepared_transactions nonzero unless you
  118. # actively intend to use prepared transactions.
  119. work_mem = 8MB # min 64kB
  120. #maintenance_work_mem = 16MB # min 1MB
  121. #max_stack_depth = 2MB # min 100kB
  122.  
  123. # - Kernel Resource Usage -
  124.  
  125. #max_files_per_process = # min
  126. # (change requires restart)
  127. #shared_preload_libraries = '' # (change requires restart)
  128.  
  129. # - Cost-Based Vacuum Delay -
  130.  
  131. #vacuum_cost_delay = 0ms # - milliseconds
  132. #vacuum_cost_page_hit = # - credits
  133. #vacuum_cost_page_miss = # - credits
  134. #vacuum_cost_page_dirty = # - credits
  135. #vacuum_cost_limit = # - credits
  136.  
  137. # - Background Writer -
  138.  
  139. #bgwriter_delay = 200ms # -10000ms between rounds
  140. #bgwriter_lru_maxpages = # - max buffers written/round
  141. #bgwriter_lru_multiplier = 2.0 # -10.0 multipler on buffers scanned/round
  142.  
  143. # - Asynchronous Behavior -
  144.  
  145. #effective_io_concurrency = # -. disables prefetching
  146.  
  147. #------------------------------------------------------------------------------
  148. # WRITE AHEAD LOG
  149. #------------------------------------------------------------------------------
  150.  
  151. # - Settings -
  152.  
  153. #wal_level = minimal # minimal, archive, or hot_standby
  154. # (change requires restart)
  155. #fsync = on # turns forced synchronization on or off
  156. #synchronous_commit = on # synchronization level; on, off, or local
  157. #wal_sync_method = fsync # the default is the first option
  158. # supported by the operating system:
  159. # open_datasync
  160. # fdatasync (default on Linux)
  161. # fsync
  162. # fsync_writethrough
  163. # open_sync
  164. #full_page_writes = on # recover from partial page writes
  165. #wal_buffers = - # min 32kB, - sets based on shared_buffers
  166. # (change requires restart)
  167. #wal_writer_delay = 200ms # - milliseconds
  168.  
  169. #commit_delay = # range -, in microseconds
  170. #commit_siblings = # range -
  171.  
  172. # - Checkpoints -
  173.  
  174. checkpoint_segments = # in logfile segments, min , 16MB each, default
  175. checkpoint_timeout = 5min # range 30s-1h, default 5min
  176. checkpoint_completion_target = 0.9 # checkpoint target duration, 0.0 - 1.0, default 0.5
  177. checkpoint_warning = 60s # disables, default 30s
  178.  
  179. # - Archiving -
  180.  
  181. #archive_mode = off # allows archiving to be done
  182. # (change requires restart)
  183. #archive_command = '' # command to use to archive a logfile segment
  184. #archive_timeout = # force a logfile segment switch after this
  185. # number of seconds; disables
  186.  
  187. #------------------------------------------------------------------------------
  188. # REPLICATION
  189. #------------------------------------------------------------------------------
  190.  
  191. # - Master Server -
  192.  
  193. # These settings are ignored on a standby server
  194.  
  195. #max_wal_senders = # max number of walsender processes
  196. # (change requires restart)
  197. #wal_sender_delay = 1s # walsender cycle time, - milliseconds
  198. #wal_keep_segments = # in logfile segments, 16MB each; disables
  199. #vacuum_defer_cleanup_age = # number of xacts by which cleanup is delayed
  200. #replication_timeout = 60s # in milliseconds; disables
  201. #synchronous_standby_names = '' # standby servers that provide sync rep
  202. # comma-separated list of application_name
  203. # from standby(s); '*' = all
  204.  
  205. # - Standby Servers -
  206.  
  207. # These settings are ignored on a master server
  208.  
  209. #hot_standby = off # "on" allows queries during recovery
  210. # (change requires restart)
  211. #max_standby_archive_delay = 30s # max delay before canceling queries
  212. # when reading WAL from archive;
  213. # - allows indefinite delay
  214. #max_standby_streaming_delay = 30s # max delay before canceling queries
  215. # when reading streaming WAL;
  216. # - allows indefinite delay
  217. #wal_receiver_status_interval = 10s # send replies at least this often
  218. # disables
  219. #hot_standby_feedback = off # send info from standby to prevent
  220. # query conflicts
  221.  
  222. #------------------------------------------------------------------------------
  223. # QUERY TUNING
  224. #------------------------------------------------------------------------------
  225.  
  226. # - Planner Method Configuration -
  227.  
  228. #enable_bitmapscan = on
  229. #enable_hashagg = on
  230. #enable_hashjoin = on
  231. #enable_indexscan = on
  232. #enable_material = on
  233. #enable_mergejoin = on
  234. #enable_nestloop = on
  235. #enable_seqscan = on
  236. #enable_sort = on
  237. #enable_tidscan = on
  238.  
  239. # - Planner Cost Constants -
  240.  
  241. #seq_page_cost = 1.0 # measured on an arbitrary scale
  242. #random_page_cost = 4.0 # same scale as above
  243. #cpu_tuple_cost = 0.01 # same scale as above
  244. #cpu_index_tuple_cost = 0.005 # same scale as above
  245. #cpu_operator_cost = 0.0025 # same scale as above
  246. effective_cache_size = 2048MB # Default 128MB
  247.  
  248. # - Genetic Query Optimizer -
  249.  
  250. #geqo = on
  251. #geqo_threshold =
  252. #geqo_effort = # range -
  253. #geqo_pool_size = # selects default based on effort
  254. #geqo_generations = # selects default based on effort
  255. #geqo_selection_bias = 2.0 # range 1.5-2.0
  256. #geqo_seed = 0.0 # range 0.0-1.0
  257.  
  258. # - Other Planner Options -
  259.  
  260. #default_statistics_target = # range -
  261. #constraint_exclusion = partition # on, off, or partition
  262. #cursor_tuple_fraction = 0.1 # range 0.0-1.0
  263. #from_collapse_limit =
  264. #join_collapse_limit = # disables collapsing of explicit
  265. # JOIN clauses
  266.  
  267. #------------------------------------------------------------------------------
  268. # ERROR REPORTING AND LOGGING
  269. #------------------------------------------------------------------------------
  270.  
  271. # - Where to Log -
  272.  
  273. #log_destination = 'stderr' # Valid values are combinations of
  274. # stderr, csvlog, syslog, and eventlog,
  275. # depending on platform. csvlog
  276. # requires logging_collector to be on.
  277.  
  278. # This is used when logging to stderr:
  279. #logging_collector = off # Enable capturing of stderr and csvlog
  280. # into log files. Required to be on for
  281. # csvlogs.
  282. # (change requires restart)
  283.  
  284. # These are only used if logging_collector is on:
  285. #log_directory = 'pg_log' # directory where log files are written,
  286. # can be absolute or relative to PGDATA
  287. #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
  288. # can include strftime() escapes
  289. #log_file_mode = # creation mode for log files,
  290. # begin with to use octal notation
  291. #log_truncate_on_rotation = off # If on, an existing log file with the
  292. # same name as the new log file will be
  293. # truncated rather than appended to.
  294. # But such truncation only occurs on
  295. # time-driven rotation, not on restarts
  296. # or size-driven rotation. Default is
  297. # off, meaning append to existing files
  298. # in all cases.
  299. #log_rotation_age = 1d # Automatic rotation of logfiles will
  300. # happen after that time. disables.
  301. #log_rotation_size = 10MB # Automatic rotation of logfiles will
  302. # happen after that much log output.
  303. # disables.
  304.  
  305. # These are relevant when logging to syslog:
  306. #syslog_facility = 'LOCAL0'
  307. #syslog_ident = 'postgres'
  308.  
  309. #silent_mode = off # Run server silently.
  310. # DO NOT USE without syslog or
  311. # logging_collector
  312. # (change requires restart)
  313.  
  314. # - When to Log -
  315.  
  316. #client_min_messages = notice # values in order of decreasing detail:
  317. # debug5
  318. # debug4
  319. # debug3
  320. # debug2
  321. # debug1
  322. # log
  323. # notice
  324. # warning
  325. # error
  326.  
  327. #log_min_messages = warning # values in order of decreasing detail:
  328. # debug5
  329. # debug4
  330. # debug3
  331. # debug2
  332. # debug1
  333. # info
  334. # notice
  335. # warning
  336. # error
  337. # log
  338. # fatal
  339. # panic
  340.  
  341. #log_min_error_statement = error # values in order of decreasing detail:
  342. # debug5
  343. # debug4
  344. # debug3
  345. # debug2
  346. # debug1
  347. # info
  348. # notice
  349. # warning
  350. # error
  351. # log
  352. # fatal
  353. # panic (effectively off)
  354.  
  355. #log_min_duration_statement = - # - is disabled, logs all statements
  356. # and their durations, > logs only
  357. # statements running at least this number
  358. # of milliseconds
  359.  
  360. # - What to Log -
  361.  
  362. #debug_print_parse = off
  363. #debug_print_rewritten = off
  364. #debug_print_plan = off
  365. #debug_pretty_print = on
  366. #log_checkpoints = off
  367. #log_connections = off
  368. #log_disconnections = off
  369. #log_duration = off
  370. #log_error_verbosity = default # terse, default, or verbose messages
  371. #log_hostname = off
  372. #log_line_prefix = '' # special values:
  373. # %a = application name
  374. # %u = user name
  375. # %d = database name
  376. # %r = remote host and port
  377. # %h = remote host
  378. # %p = process ID
  379. # %t = timestamp without milliseconds
  380. # %m = timestamp with milliseconds
  381. # %i = command tag
  382. # %e = SQL state
  383. # %c = session ID
  384. # %l = session line number
  385. # %s = session start timestamp
  386. # %v = virtual transaction ID
  387. # %x = transaction ID ( if none)
  388. # %q = stop here in non-session
  389. # processes
  390. # %% = '%'
  391. # e.g. '<%u%%%d> '
  392. #log_lock_waits = off # log lock waits >= deadlock_timeout
  393. #log_statement = 'none' # none, ddl, mod, all
  394. #log_temp_files = - # log temporary files equal or larger
  395. # than the specified size in kilobytes;
  396. # - disables, logs all temp files
  397. #log_timezone = '(defaults to server environment setting)'
  398.  
  399. #------------------------------------------------------------------------------
  400. # RUNTIME STATISTICS
  401. #------------------------------------------------------------------------------
  402.  
  403. # - Query/Index Statistics Collector -
  404.  
  405. #track_activities = on
  406. #track_counts = on
  407. #track_functions = none # none, pl, all
  408. #track_activity_query_size = # (change requires restart)
  409. #update_process_title = on
  410. #stats_temp_directory = 'pg_stat_tmp'
  411.  
  412. # - Statistics Monitoring -
  413.  
  414. #log_parser_stats = off
  415. #log_planner_stats = off
  416. #log_executor_stats = off
  417. #log_statement_stats = off
  418.  
  419. #------------------------------------------------------------------------------
  420. # AUTOVACUUM PARAMETERS
  421. #------------------------------------------------------------------------------
  422.  
  423. #autovacuum = on # Enable autovacuum subprocess? 'on'
  424. # requires track_counts to also be on.
  425. #log_autovacuum_min_duration = - # - disables, logs all actions and
  426. # their durations, > logs only
  427. # actions running at least this number
  428. # of milliseconds.
  429. #autovacuum_max_workers = # max number of autovacuum subprocesses
  430. # (change requires restart)
  431. #autovacuum_naptime = 1min # time between autovacuum runs
  432. #autovacuum_vacuum_threshold = # min number of row updates before
  433. # vacuum
  434. #autovacuum_analyze_threshold = # min number of row updates before
  435. # analyze
  436. #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
  437. #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
  438. #autovacuum_freeze_max_age = # maximum XID age before forced vacuum
  439. # (change requires restart)
  440. #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
  441. # autovacuum, in milliseconds;
  442. # - means use vacuum_cost_delay
  443. #autovacuum_vacuum_cost_limit = - # default vacuum cost limit for
  444. # autovacuum, - means use
  445. # vacuum_cost_limit
  446.  
  447. #------------------------------------------------------------------------------
  448. # CLIENT CONNECTION DEFAULTS
  449. #------------------------------------------------------------------------------
  450.  
  451. # - Statement Behavior -
  452.  
  453. #search_path = '"$user",public' # schema names
  454. #default_tablespace = '' # a tablespace name, '' uses the default
  455. #temp_tablespaces = '' # a list of tablespace names, '' uses
  456. # only default tablespace
  457. #check_function_bodies = on
  458. #default_transaction_isolation = 'read committed'
  459. #default_transaction_read_only = off
  460. #default_transaction_deferrable = off
  461. #session_replication_role = 'origin'
  462. #statement_timeout = # in milliseconds, is disabled
  463. #vacuum_freeze_min_age =
  464. #vacuum_freeze_table_age =
  465. #bytea_output = 'hex' # hex, escape
  466. #xmlbinary = 'base64'
  467. #xmloption = 'content'
  468.  
  469. # - Locale and Formatting -
  470.  
  471. datestyle = 'iso, mdy'
  472. #intervalstyle = 'postgres'
  473. #timezone = '(defaults to server environment setting)'
  474. #timezone_abbreviations = 'Default' # Select the set of available time zone
  475. # abbreviations. Currently, there are
  476. # Default
  477. # Australia
  478. # India
  479. # You can create your own file in
  480. # share/timezonesets/.
  481. #extra_float_digits = # min -, max
  482. #client_encoding = sql_ascii # actually, defaults to database
  483. # encoding
  484.  
  485. # These settings are initialized by initdb, but they can be changed.
  486. lc_messages = 'C' # locale for system error message
  487. # strings
  488. lc_monetary = 'C' # locale for monetary formatting
  489. lc_numeric = 'C' # locale for number formatting
  490. lc_time = 'C' # locale for time formatting
  491.  
  492. # default configuration for text search
  493. default_text_search_config = 'pg_catalog.english'
  494.  
  495. # - Other Defaults -
  496.  
  497. #dynamic_library_path = '$libdir'
  498. #local_preload_libraries = ''
  499.  
  500. #------------------------------------------------------------------------------
  501. # LOCK MANAGEMENT
  502. #------------------------------------------------------------------------------
  503.  
  504. #deadlock_timeout = 1s
  505. #max_locks_per_transaction = # min
  506. # (change requires restart)
  507. # Note: Each lock table slot uses ~ bytes of shared memory, and there are
  508. # max_locks_per_transaction * (max_connections + max_prepared_transactions)
  509. # lock table slots.
  510. #max_pred_locks_per_transaction = # min
  511. # (change requires restart)
  512.  
  513. #------------------------------------------------------------------------------
  514. # VERSION/PLATFORM COMPATIBILITY
  515. #------------------------------------------------------------------------------
  516.  
  517. # - Previous PostgreSQL Versions -
  518.  
  519. #array_nulls = on
  520. #backslash_quote = safe_encoding # on, off, or safe_encoding
  521. #default_with_oids = off
  522. #escape_string_warning = on
  523. #lo_compat_privileges = off
  524. #quote_all_identifiers = off
  525. #sql_inheritance = on
  526. #standard_conforming_strings = on
  527. #synchronize_seqscans = on
  528.  
  529. # - Other Platforms and Clients -
  530.  
  531. #transform_null_equals = off
  532.  
  533. #------------------------------------------------------------------------------
  534. # ERROR HANDLING
  535. #------------------------------------------------------------------------------
  536.  
  537. #exit_on_error = off # terminate session on any error?
  538. #restart_after_crash = on # reinitialize after backend crash?
  539.  
  540. #------------------------------------------------------------------------------
  541. # CUSTOMIZED OPTIONS
  542. #------------------------------------------------------------------------------
  543.  
  544. #custom_variable_classes = '' # list of custom variable class names

在这个文件中主要是修改63行的listen_addresses = ''为listen_addresses = '*',这样就可以监听所有端口了。

最后一步:(启用所有配置并启动)

sudo gitlab-ctl reconfigure
sudo gitlab-ctl start

访问http://localhost即可。

gitlab默认的数据库为gitlabhq_production,数据库登录用户名为gitlab-psql,数据库密码为空;

gitlab的用户信息分别保存在namespaces表与users表中。

GitLab在Centos下的安装步骤的更多相关文章

  1. CentOS下一键安装Openstack

    CentOS下一键安装Openstack 系统环境:Oracle VirtualBox 4.38CentOS-6.5-x86_64-bin-DVD1.iso 安装前需要修改 /etc/hosts文件, ...

  2. centOS下yum安装配置samba

     centOS下yum安装配置samba 2010-03-29 15:46:00 标签:samba yum centOS 安装 休闲 注意:本文的原则是只将文件共享应用于内网服务器,并让将要被共享的目 ...

  3. CentOS下Mysql安装教程

    CentOS下Mysql安装教程 本人学习Linux时使用的是CentOs5.5版本,在该环境中,Mysql的安装方法有很多种,下面我只讲我这次成功了的方法,作为一个记录,供大家参考,同时给自己做一个 ...

  4. CentOS下php安装mcrypt扩展

    CentOS下php安装mcrypt扩展 Posted on 2012-09-12 15:27 C'est la vie 阅读(48294) 评论(3) 编辑 收藏 (以下步骤均为本人实际操作,可能与 ...

  5. 转:在CentOS下编译安装GCC

    转:https://teddysun.com/432.html 在CentOS下编译安装GCC 技术  秋水逸冰  发布于: 2015-09-02  更新于: 2015-09-02  6519 次围观 ...

  6. CentOS 下 redis 安装与配置

    CentOS 下 redis 安装与配置   1.到官网上找到合适版本下载解压安装 [root@java src]# wget -c http://redis.googlecode.com/files ...

  7. centos下编译安装lnmp

    centos下编译安装lnmp 本文以centos为背景在其中编译安装nginx搭建lnmp环境. 编译安装nginx时,需要事先安装 开发包组"Development Tools" ...

  8. mac和centos下git安装

    mac下面的git安装,这篇文章写的很详细了http://www.cnblogs.com/ccdev/archive/2012/09/12/2682098.html 谈谈centos下的安装.我用的是 ...

  9. centos下apache安装后无法访问

    2013.11.28遇到的问题: -------------------------------------- 一.centos下apache安装后无法访问 得查一下防火墙的问题 iptables添加 ...

随机推荐

  1. VS工具--GhostDoc

    一.介绍:    GhostDoc是Visual Studio的一个免费插件,可以帮助开发人员编写XML格式的注释文档.    C#中XML格式的文档注释好处多多:Visual Studio会在很多地 ...

  2. How to fix the conflict between ROS Python and Conda

    Problem: Ever since I have installed Conda, ROS does not seem to work. And predictably it is because ...

  3. XAF视频教程来啦,已出15课

    第一到第七课在这里: http://www.cnblogs.com/foreachlife/p/xafvideo_1_6.html 视频地址:http://i.youku.com/i/UMTI5OTE ...

  4. java学习笔记----枚举测试题

    定义义一个交通灯枚举类,包含红灯.绿灯.黄灯,需要有获得下一个灯的方法,并实现红灯出现5秒之后变成绿灯,绿灯3秒之后变成黄灯,黄灯2秒之后变成红灯,如此循环 public class Test5 { ...

  5. Java 中如何原样输出转义符号

    Java 中的转义字符有好几种,常见的有: 八进制转义字符,格式:\ + 1到3位八进制数字,如\1, \20,范围为 \0 ~ \377,即最大值为255. Unicode转义字符,格式:\u + ...

  6. SCOI2005栅栏

    Description 农夫约翰打算建立一个栅栏将他的牧场给围起来,因此他需要一些特定规格的木材.于是农夫约翰到木材店购买木材.可是木材店老板说他这里只剩下少部分大规格的木板了.不过约翰可以购买这些木 ...

  7. OneSQL安装

    下载 www.onexsoft.com -> 下载 -> OneSQL 安装 yum install onesql-<version>.rpm 配置 进入安装目录 cd /us ...

  8. mysql安装innodb插件

    可以用 show engines;或者show plugins;来查看mysql> show plugins;+------------+--------+----------------+-- ...

  9. DTD的作用

    在介绍DTD的作用之前先介绍一下SGML:SGML SGML(Standard Generalized Markup Language,标准通用标记语言),是一种定义电子文档结构和描述其内容的国际标准 ...

  10. Ubuntu Server 安装桌面untiy

    1.安装 sudo apt-get install ubuntu-desktop sudo apt-get install unity sudo apt-get install unity-commo ...