(2)Next download and install the gpg key.
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
sudo wget-O /etc/pki/rpm-gpg/RPM-GPG-KEY-puiashttp://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias
sudo rpm--import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias
(3)Verify that the key got installedsuccessfully:
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
sudo rpm-qa gpg*
gpg-pubkey-41a40948-4ce19266
(4)Verify that the EPEL and PUIASComputational repositories are enabled as shown below:
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
sudo yumrepolist
repoid repo name status
PUIAS_6_computational PUIAS computational Base 6 - x86_64 2,018
base CentOS-6 - Base 4,802
epel Extra Packages forEnterprise Linux 6 - x86_64 7,879
extras CentOS-6 - Extras 12
updates CentOS-6 - Updates 814
repolist:15,525
(5)If you can't see them listed, use thefolowing command (from yum-utils package) to enable them:
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
sudoyum-config-manager --enable epel --enable PUIAS_6_computational
Now we want all logging of the system to be forwarded toa central email address:
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
su -
echoadminlogs@example.com > /root/.forward
chown root/root/.forward
chmod 600/root/.forward
restorecon/root/.forward
GitLab Shell is a ssh access and repository managementsoftware developed specially for GitLab.
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
# Firstlogin as root
su -
# Switchto right version
gitcheckout v1.8.0
cpconfig.yml.example config.yml
# Editconfig and replace gitlab_url with something like 'http://domain.com/'
#
# Note,'gitlab_url' is used by gitlab-shell to access GitLab API. Since
# 1. the whole communication is locally
# 2. next steps will explain how to exposeGitLab over HTTPS with custom cert
# it's agood solution is to set gitlab_url as "http://localhost:8080/"
# Do setup
./bin/install
4.3 选择数据库
4.3.1 MySQL(建议)
Create a new user and database for GitLab:
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
# Login toMySQL
mysql -uroot -p
# Type thedatabase root password
# Create auser for GitLab. (change supersecret to a real password)
CREATEUSER 'gitlab'@'localhost' IDENTIFIED BY 'supersecret';
# Createthe GitLab production database
CREATEDATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8`COLLATE `utf8_unicode_ci`;
# Grantthe GitLab user necessary permissopns on the table.
GRANTSELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON`gitlabhq_production`.* TO 'gitlab'@'localhost';
# Quit thedatabase session
\q
Try connecting to the new database with the new user:
mysql -ugitlab -p -D gitlabhq_production
# Type thepassword you replaced supersecret with earlier
# Quit thedatabase session
\q
参考https://github.com/lubia/gitlab-recipes/tree/master/install/centos#6-gitlab
确认是否安装成功完成:
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
su - git
cd gitlab/
bundleexec rake gitlab:check RAILS_ENV=production
Do not care about it if you are sure that you have downloaded the up-to-date filefrom https://raw.github.com/gitlabhq/gitlab-recipes/master/init/sysvinit/centos/gitlab-unicorn andsaved it to /etc/init.d/gitlab.
If all other items are green, then congratulations on successfully installingGitLab! However there are still a few steps left.
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
su -
yum -yinstall nginx
chkconfignginx on
mkdir/etc/nginx/sites-{available,enabled}
wget -O/etc/nginx/sites-available/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/master/web-server/nginx/gitlab-ssl
ln -sf/etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
Edit /etc/nginx/nginx.conf and replace include /etc/nginx/conf.d/*.conf; with include /etc/nginx/sites-enabled/*;
Edit /etc/nginx/sites-available/gitlab and replace git.example.com with your FQDN.
Add nginx user to git group.
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
usermod -a-G git nginx
chmod g+rx/home/git/
Note: Don't forget to add a SSL certificate or generate aSelf Signed Certificate
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
cd/etc/nginx
opensslreq -new -x509 -nodes -days 3560 -out gitlab.crt -keyout gitlab.key
vi/etc/nginx/site-available/gitlab
让nginx监听80端口,root目录是gitlab的网站,这样可以通过机器ip:80来访问。
[plain] view plaincopyprint?在CODE上查看代码片派生到我的代码片
service nginx restart