注:我使用的是gitlab installer, 這裏有經過.deb包的方式:http://my.oschina.net/u/160089/blog/421168
環境:ubuntu14.04.3 LTS + Gitlab 8.1.4
首先下載run文件:https://bitnami.com/stack/gitlab/installer#, 最好用md5sum校驗一下文件是否損壞。 html
md5sum bitnami-gitlab-8.1.4-1-linux-x64-installer.run chmod +x bitnami-gitlab-8.1.4-1-linux-x64-installer.run ./bitnami-gitlab-8.1.4-1-linux-x64-installer.run
一路點下一步就好了。。
但每每咱們的目標服務器是沒有圖形界面的。。
經過執行./bitnami-gitlab-8.1.4-1-linux-x64-installer.run --help能夠看到安裝時有不少可選參數,
其中--mode text就是在命令行下安裝gitlab
切換到root用戶,su - root java
./bitnami-gitlab-8.1.4-1-linux-x64-installer.run --mode text除了指定--mode還有不少其它選項,好比指定端口號:--apache_server_port 9000 (默認爲80端口,裝好後能夠更改,但很麻煩)
root@cyper-ubuntu:/home/cyper/Downloads# ./bitnami-gitlab-8.1.4-1-linux-x64-installer.run ------------------------------------------------------------- Welcome to the Bitnami Gitlab Stack Setup Wizard. ------------------------------------------------------------------- Select the components you want to install; clear the components you do not want to install. Click Next when you are ready to continue. PhpPgAdmin [Y/n] :y GitLab : Y (Cannot be edited) Is the selection above correct? [Y/n]: y ---------------------------------------------------------------------------- Installation folder Please, choose a folder to install Bitnami Gitlab Stack Select a folder [/opt/gitlab-8.1.4-1]: ---------------------------------------------------------------------------- Create Admin account Bitnami Gitlab Stack admin user creation Email Address [user@example.com]: 2386119594@qq.com Login [user]: gitlab Password : Please confirm your password : ---------------------------------------------------------------------------- Hostname that will be used to create internal URLs. If this value is incorrect, you may be unable to access your Gitlab installation from other computers. It is advisable to use a Domain instead of an IP address for compatibility with different browsers. Domain [127.0.1.1]: 172.168.1.103 Do you want to configure mail support? [y/N]: y ---------------------------------------------------------------------------- Configure SMTP Settings This is required so your application can send notifications via email. Default email provider: [1] GMail [2] Custom Please choose an option [1] : 1 ---------------------------------------------------------------------------- Configure SMTP Settings This data is stored in the application configuration files and may be visible to others. For this reason, it is recommended that you do not use your personal account credentials. GMail address []: cyperxxxx@gmail.com GMail password : Re-enter : ---------------------------------------------------------------------------- Setup is now ready to begin installing Bitnami Gitlab Stack on your computer. Do you want to continue? [Y/n]: y ---------------------------------------------------------------------------- Please wait while Setup installs Bitnami Gitlab Stack on your computer. Installing 0% ______________ 50% ______________ 100% ######################################### ---------------------------------------------------------------------------- Setup has finished installing Bitnami Gitlab Stack on your computer. Info: To access the Bitnami Gitlab Stack, go to http://172.168.1.103:80 from your browser. Press [Enter] to continue: root@cyper-ubuntu:/home/cyper/Downloads#
安裝時會選擇安裝目錄,默認爲/opt/gitlab-8.1.4-1,smtp設置我選擇的默認的gmail (稍後能夠在配置文件production.rb中修改)。 linux
smtp相關的配置文件在:
properties.ini
以及
apps/gitlab/htdocs/config/environments/production.rb (以這個rb文件爲準) git
# config.action_mailer.delivery_method = :sendmail # Defaults to: # # config.action_mailer.sendmail_settings = { # # location: '/usr/sbin/sendmail', # # arguments: '-i -t' # # } config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => "587", :domain => "smtp.gmail.com", :authentication => :plain, :user_name => "cyperxxxx@gmail.com", :password => "secret", :enable_starttls_auto => true }
能夠經過tail來監控日誌:
find . -name production.log
tail -f apps/gitlab/htdocs/log/*.log
#禁用gravatar
vi apps/gitlab/htdocs/config/gitlab.yml
shell
## Gravatar ## For Libravatar see: http://doc.gitlab.com/ce/customization/libravatar.html gravatar: enabled: true # Use user avatar image from Gravatar.com (default: true) # gravatar urls: possible placeholders: %{hash} %{size} %{email} # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=identicon
把true改成false apache
#重啓➜ mygit $ git clone git@172.168.1.103:uniquejava/test.git Cloning into 'test'... warning: You appear to have cloned an empty repository. Checking connectivity... done. ➜ mygit $
#來張圖: ubuntu
1. 註冊新用戶能收到激活郵件 (不過在垃圾箱。。)