安装GEM

Note:As of bundler 1.5.2, you can invokebundle install -jN(whereNthe number of your processor cores) and enjoy the parallel gems installation with measurable difference in completion time (~60% faster). Check the number of your cores withnproc. For more information check thispost. First make sure you have bundler >= 1.5.2 (runbundle -v) as it addresses someissuesthat werefixedin 1.5.2.

Note:If you want to use HTTPS, seeUsing HTTPSfor the additional steps.

Note:Make sure your hostname can be resolved on the machine itself by either a proper DNS record or an additional line in /etc/hosts ("127.0.0.1 hostname"). This might be necessary for example if you set up gitlab behind a reverse proxy. If the hostname cannot be resolved, the final installation check will fail with "Check GitLab API access: FAILED. code: 401" and pushing commits will be rejected with "[remote rejected] master -> master (hook declined)".

初始化数据库和激活高级特性

Note:You can set the Administrator/root password by supplying it in environmental variableGITLAB_ROOT_PASSWORDas seen below. If you don't set the password (and it is set to the default one) please wait with exposing GitLab to the public internet until the installation is done and you've logged into the server the first time. During the first login you'll be forced to change the default password.

保护密码

Secure secrets.yml

Thesecrets.ymlfile stores encryption keys for sessions and secure variables. Backupsecrets.ymlsomeplace safe, but don't store it in the same place as your database backups. Otherwise your secrets are exposed if one of your backups is compromised.

Additional Markup Styles

Apart from the always supported markdown style there are other rich text files that GitLab can display. But you might have to install a dependency to do so. Please see thegithub-markup gem readmefor more information.

Troubleshooting

如果使用的是apache但是提示NGINX错误什么的话，执行

bundle exec unicorn_rails -c config/unicorn.rb -E production -D

"You appear to have cloned an empty repository."

If you see this message when attempting to clone a repository hosted by GitLab, this is likely due to an outdated Nginx or Apache configuration, or a missing or misconfiguredgitlab-git-http-serverinstance. Double-check that you'veinstalled Go,installed gitlab-git-http-server, and correctlyconfigured Nginx.