Gitlab 安裝

1、Gitlab 安裝

git clone https://github.com/PX4/Firmware.githtml

 

1、安裝ssh服務
ps -e|grep ssh
sudo apt-get install openssh-server
sudo /etc/init.d/ssh startlinux

2、設置root密碼git

一、sudo passwd rootgithub

二、輸入sudo 密碼ajax

三、輸入新的 root帳號密碼shell

四、切換到rootubuntu

   Su rootapi

 

3、安裝gitlao整合包瀏覽器

一、下載服務器

https://bitnami.com/redirect/to/96764/bitnami-gitlab-8.5.1-0-linux-x64-installer.run

二、加入執行權限

chmod 777 bitnami-gitlab-8.5.7-0-linux-x64-installer.run

三、執行安裝

./bitnami-gitlab-8.5.7-0-linux-x64-installer.run

四、執行後就會彈出圖形化界面,一步步確認就行,以下  

 

       

 

 

 

 

五、輸入gitlan管理員帳號密碼

 

五、輸入gitlan服務器域名,這裏測試發現用域名,當用戶註冊後,收到的郵件連接沒法點開,將127.0.1.1改成虛擬機的本地ip地址 例如:192.168.61.128

這裏經過ifconfig命令獲取當前的ip地址

若是更改ip

 

//////

vi apps/gitlab/htdocs/config/gitlab.yml +474

 vi apps/gitlab/htdocs/config/gitlab.yml +32

 vi apps/gitlab/gitlab-shell/config.yml +16

             

      

六、第一次安裝好了就默認啓動了gitlab,若是要手動啓 動的話有兩種辦法
1.找到安裝好的路徑/opt/gitlab-8.5.7-0須要root 權限執行命令:

Sudo ./ctlscript.sh restart

 

          

七、window系統瀏覽器訪問

 

八、配置郵件服務器

一、./apps/gitlab/htdocs/config/environments/production.rb

#config.action_mailer.delivery_method = :sendmail

  # Defaults to:

  # # config.action_mailer.sendmail_settings = {

  # #   location: '/usr/sbin/sendmail',

  # #   arguments: '-i -t'

  # # }

  # Defaults to:

  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.163.com",

:port => 25,

:domain => "163.com",

:authentication => :plain,

:user_name => "liushuhe1990@163.com",

:password => "lshjn@52013140",

:enable_starttls_auto => true

   }

二、apps/gitlab/htdocs/config/gitlab.yml

    ## Email settings

     # Uncomment and set to false if you need to disable email sending from GitLab (default: true)

     #email_enabled: true

      # Email address used in the "From" field in mails sent by GitLab

     email_from: liushuhe1990@163.com

     email_display_name: GitLab

     email_reply_to: noreply@163.com

 

三、

九、./apps/gitlab/htdocs/config/environments/production.rb

2、GitLab配置ssh key

一、ssh-keygen -t rsa -C 'liushuhe1990@163.com'

二、cat ~/.ssh/id_rsa.pub

 

4、卸載

一、中止gitlab 進入opt/gitlab-8.5.1-0目錄

 ./ctlscript.sh stop

二、卸載gitlab(注意這裏寫的是gitlab-ce)

rpm -e gitlab-ce

一、查看gitlab進程

ps aux | grep gitlab

 

二、殺掉第一個進程(就是帶有好多.............的進程)

kill -9 18777

殺掉後,在ps aux | grep gitlab確認一遍,還有沒有gitlab的進程

五、刪除全部包含gitlab文件

find / -name gitlab | xargs rm -rf

 

3、git 出現錯誤 Could not resolve host: github.com

sudo vi /etc/hosts

i  啓動編輯模式

::1             localhost
192.30.255.112  github.com

而後添加github的地址

192.30.253.113    github.com

192.30.252.131 github.com

185.31.16.185 github.global.ssl.fastly.net

74.125.237.1 dl-ssl.google.com

173.194.127.200 groups.google.com

192.30.252.131 github.com

185.31.16.185 github.global.ssl.fastly.net

74.125.128.95 ajax.googleapis.com

 

一、開始須要咱們作的是先在咱們的ubuntu下安裝好samba:

安裝sambasudo apt-get install samba

安裝smbclientsudo apt-get install smbclient

二、修改配置文件

vi /etc/samba/smb.conf 編輯smb.conf 文件

在配置文件的最末尾加上:

[fwl]

   comment = my samba

   path = /

   browseable = yes

   read only = no

   guest ok = no

保存後從新啓動sambasudo /etc/init.d/samba restart

 

三、設置用戶和密碼

sudo smbpasswd -a fwl 接着俺提示輸入密碼。(前提是添加了此用戶:useradd fwl )

不然系統在沒有此用戶的前提下按默認操做是會報以下錯的:

增長samba用戶提示Failed to add entry for user

root@tyc-virtual-machine:/home#  smbpasswd -a fwl 

New SMB password:

Retype new SMB password:

Failed to add entry for user fwl .

解決辦法:

這是由於沒有加相應的系統帳號,因此會提示Failed to add entry for user的錯誤,只需增長相應的系統帳號share就能夠了:

root@tyc-virtual-machine:/home#  groupadd fwl -g 6000

[root@tyc-virtual-machine:/home# useradd fwl -u 6000 -g 6000 -s /sbin/nologin -d /dev/null

 

四、最後計算機下右鍵添加一個網絡位置

輸入 文件夾框 \\ip地址\share,按提示輸入用戶名密碼便可。

 

 

 

Ubuntu:下載

fwl@ubuntu:/work$ rm px4/ -rf

fwl@ubuntu:/work$ git clone git@192.168.1.103:liushuhe/px4.git

正克隆到 'px4'...

remote: Counting objects: 17053, done.

remote: Compressing objects: 100% (7635/7635), done.

remote: Total 17053 (delta 8581), reused 16881 (delta 8520)

接收對象中: 100% (17053/17053), 264.72 MiB | 21.39 MiB/s, 完成.

處理 delta 中: 100% (8581/8581), 完成.

檢查鏈接... 完成。

正在檢出文件: 100% (15080/15080), 完成.

Minigeiw32:下載