1. 在Bitnami上下載 64 位的安裝包
https://bitnami.com/stack/gitlab
拷貝到Linux 上,chmod 改成可執行。然後以root權限執行安裝包。
使用的安裝包:bitnami-gitlab-8.5.7-0-linux-x64-installer.run
在 Ubuntu 14.04 x64和i386都試過, 安裝失敗,老報告權限問題,即使使用root權限,也沒啥用。
在 Red Hat 5.8 上安裝無問題。
2. Gitlab 啓動/關閉
根目錄下的 ctlscript.sh 是控制腳本,bitnami的風格啊!
./ctlscript.sh status
./ctlscript.sh start
./ctlscript.sh stop
3. SMTP 郵件發送設置
- 參考
修改 SMTP 郵件服務器設置,以 189 郵箱爲例子:
/opt/gitlab-8.5.7-0/apps/gitlab/htdocs/config/environments/production.rb
1 2 3 4 5 6 7 8 9 10 |
config.action_mailer.smtp_settings = { :address => "smtp.189.cn", :port => 25, :domain => "189.cn", :authentication => :plain, :user_name => "[email protected]", :password => "此處是密碼", :openssl_verify_mode => 'none', #:enable_starttls_auto => false } |
/opt/gitlab-8.5.7-0/apps/gitlab/htdocs/config/gitlab.yml
這邊email_from 要和smtp中賬號保持一致,126服務器的安全要求。
1 2 3 4 |
gitlab: ... ... email_from: [email protected] ... ... |
補充說明:如果賬號不一致,在管理員界面 Background Jobs 中 “重試” 就會看到失敗。
去服務器查看日誌,/opt/gitlab-8.5.7-0/apps/gitlab/htdocs/log/sidekiq.log 中能看到錯誤信息:
Net::SMTPFatalError: 553 Mail from must equal authorized user
據此也可以看出,gitlab 利用 gitlab_sidekiq 組件來生成後臺異步任務,發送郵件。失敗了,還能等段時間自動重試。高大上啊!!
4. 修改 uploads 文件夾權限
安裝完默認uploads文件夾權限沒有可執行權限,導致上傳的文件,訪問不了 403.
具體原因不瞭解,可能是 cgi 模塊 passenger 只能接受可執行的文件,然後纔會把靜態文件給apache。
PS:uploads 目錄的位置:/opt/gitlab-8.5.7-0/apps/gitlab/htdocs/public/uploads