postfix 郵件服務(wù)
1.安裝postfix
yum -y install policycoreutils openssh-server openssh-clients postfix
2.設(shè)置postfix服務(wù)開機啟動
systemctl enable postfix
3.啟動postfix服務(wù)
systemctl start postfix
3 如果失敗,報錯 postfix: fatal: parameter inet_interfaces: no local interface found for ::1
3.1 打開postfix配置
vi /etc/postfix/main.cf
3.2 修改postfix配置
原本是:inet_interfaces = localhost
修改成:inet_interfaces = all
3.3 重新啟動postfix
service postfix start
gitlab部署
4.下載gitlab安裝包
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm
5.安裝gitlab安裝包
rpm -i gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm
6.修改gitlab配置文件指定服務(wù)器ip
vim /etc/gitlab/gitlab.rb

gitlab.rb
如果只想本地訪問則192.168.x.x,如果外網(wǎng)訪問則填寫服務(wù)器IP地址或域名即可,
7.自定義端口
默認(rèn)端口是8080,因為同臺服務(wù)器下可能會有tomcat,必須保證端口不沖突。如果8080端口沒被其他服務(wù)使用,則跳過這一步。
修改端口gitlab
7.1 vim /var/opt/gitlab/nginx/conf/gitlab-http.conf

gitlab-http.conf
7.2 修改上圖中80,設(shè)置新的端口,保存退出。
8.重置gitlab配置
gitlab-ctl reconfigure
9.重啟gitlab
gitlab-ctl restart
10.訪問gitlab
瀏覽器中輸入 IP:端口 ,具體根據(jù)自己所設(shè)置的。
如:192.168.1.101:8099

gitlab.png
管理員初始賬號:root
管理員初始密碼:5iveL!fe
注意:服務(wù)器內(nèi)存至少2G,比較多人說至少需要4G(我租了的阿里云的2GECS可以跑得起來)這還是服務(wù)器只有g(shù)itlab的情況,gitlab比較吃內(nèi)存。
如果內(nèi)存不足,會報500 502等各種錯誤。
附錄:GitLab的命令
語法: gitlab-ctl [command]
| command | 含義 |
|---|---|
| start | 啟動所有服務(wù) |
| stop | 關(guān)閉所有服務(wù) |
| restart | 重啟所有服務(wù) |
| status | 查看所有服務(wù)狀態(tài) |
| tail | 查看日志信息 |
| service-list | 列舉所有啟動服務(wù) |
| graceful-kill | 平穩(wěn)停止一個服務(wù) |