2015年5月7日 星期四

Setup GitLab on CentOS 7 (7th April 2016)


Download CentOS 7 Minimal ISO
https://www.centos.org/download/
http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1511.iso

Setup gitlab

Setup network card
vim  /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.32.29.150
NETMASK=255.255.255.0
GATEWAY=10.32.29.1
MTU=1500
IPV6INIT=no
PEERDNS=no

Restart eth0
ifdown eth0
ifup eth0

Turn off and disable firewall on CentOS 6.5
Type the following two commands (you must login as the root user):
# /etc/init.d/iptables save
# /etc/init.d/iptables stop
Turn off firewall on boot:
# chkconfig iptables off

Turn off CentOS 7 Firewall
http://www.liquidweb.com/kb/how-to-stop-and-disable-firewalld-on-centos-7/
systemctl disable firewalld
systemctl stop firewalld

Setup proxy server for the current shell
vi ~/.bash_profile
http_proxy=http://10.23.31.130:8080

Configure YUM to use proxy
vim /etc/yum.conf
proxy=http://10.23.31.130:8080
Clear the yum cache
yum clean all

Install by YUM
yum install curl
curl --proxy http://10.23.31.130:8080 -O https://downloads-packages.s3.amazonaws.com/centos-7.0.1406/gitlab-7.8.4_omnibus.1-1.el7.x86_64.rpm
sudo yum -y install openssh-server
sudo yum -y install postfix
sudo service postfix start
sudo chkconfig postfix on
sudo rpm -ivh gitlab-7.8.4_omnibus.1-1.el7.x86_64.rpm

Change config public URL
這個設定檔的內容,裡面有一行 external_url 的設定改成要對外開放 web 的 url ,例如我只想內部使用也許改成 http://192.168.0.10 這樣子。
vi /etc/gitlab/gitlab.rb
http://192.168.0.10

Configure and run gitlab
sudo gitlab-ctl reconfigure

CentOS7


1. 關閉及停止使用 Firewalld:
systemctl status firewalld
systemctl disable firewalld (Loaded: loaded, Active: active)
systemctl mask firewalld (Loaded: masked, Active: active)
systemctl stop firewalld (Loaded: masked, Active: inactive)
sudo reboot -h now

2. 安裝 iptables
yum install iptables-services

3. 啟動及設定開機執行 iptables
systemctl status iptables.service
systemctl enable iptables
systemctl start iptables

現在已經可以用 iptables, 增加及剛除 rules 的方法跟以前 Centos 5, 6 相同.

如果上述命令沒有 lokkit,可以自己用 yum install lokkit 安裝。事實上 lokkit 也只是設定 iptables 把 http 和 ssh 打開,如果原本就有開了也不用執行或手動自己設定 iptables 也可以。
sudo lokkit -s http -s ssh


usermod -s /bin/bash git

Login the web using
root
5iveL!fe

Maintainance:
gitlab-ctl stop
gitlab-ctl start

Gitlab data path:
/var/opt/gitlab

Gitlab backup and restore
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/raketasks/backup_restore.md
sudo gitlab-rake gitlab:backup:create
sudo gitlab-rake gitlab:backup:restore

1 則留言:

2023 Promox on Morefine N6000 16GB 512GB

2023 Promox on Morefine N6000 16GB 512GB Software Etcher 100MB (not but can be rufus-4.3.exe 1.4MB) Proxmox VE 7.4 ISO Installer (1st ISO re...