簡單幾步配置gitlab
之前配置gitlab需要很多步驟,要裝apache2、ruby、tomcat、mysql等一片東西。有沒有更簡單的方式呢?現在可以借助bitnami,簡化了很多。
可以參考vpsee寫的文章:http://www.vpsee.com/2012/11/install-gitlab-on-ubuntu-12-04/
cd /opt
wget https://bitnami.com/redirect/to/48156/bitnami-gitlab-7.6.2-0-linux-installer.run
./bitnami-gitlab-7.6.2-0-linux-x64-installer.run --apache_server_port 9000
步驟也可以參考:https://bitnami.com/stack/gitlab/README.txt
[root@test opt]# ./bitnami-gitlab-7.6.2-0-linux-x64-installer.run --apache_server_port 9000 The installer detects that exists a 'git' user in the system. This installer will change the configuration for this user. Do you want to continue the installation? [y/N]: y The installer detects that exists a 'gitlab_ci' user in the system. This installer will change the configuration for this user. Do you want to continue the installation? [y/N]: y ---------------------------------------------------------------------------- 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. GitLab : Y (Cannot be edited) GitLab CI [Y/n] :y Is the selection above correct? [Y/n]: y ---------------------------------------------------------------------------- Installation folder Please, choose a folder to install Bitnami Gitlab Stack Select a folder [/opt/gitlab-7.6.2-0]: ---------------------------------------------------------------------------- Create Admin account Bitnami Gitlab Stack admin user creation Email Address [user@example.com]: haochuang@uetest.com Login [user]: haochuang Password : Please confirm your password : Warning: Please use alphanumeric characters only Press [Enter] to continue: ---------------------------------------------------------------------------- Create Admin account Bitnami Gitlab Stack admin user creation Email Address [haochuang@uetest.com]: ${userEmail} Login [haochuang]: ${UserAccount} Password :${UserPasswd} 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]: ${ServerIP} 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] : 2 ---------------------------------------------------------------------------- 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. Username []: haochuang Password : Re-enter : SMTP Host []: smtp.exmail.qq.com SMTP Port []: 25 Secure connection [1] None [2] SSL [3] TLS Please choose an option [3] : 2 ---------------------------------------------------------------------------- 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://127.0.1.1:9000 from your browser. Press [Enter] to continue:
等待完成之后,打開 http://127.0.1.1:9000/,即可正常訪問。
之前我繞了彎路,參考了這里的問題解決辦法:https://community.bitnami.com/t/gitlab-http-port/20767
另外,在你開始安裝的時候,可以看到很多幫助信息:./bitnami-gitlab-7.6.2-0-linux-x64-installer.run --help
如果你已經安裝完成了,只是由於端口沖突,准備修改端口的話,也可以這么做:
1.停掉服務,修改如下配置文件:
/opt/gitlab-7.6.2-0/properties.ini: apache_server_port=9000 /opt/gitlab-7.6.2-0/apps/gitlab/conf/httpd-app.conf PassengerPreStart http://127.0.0.1:900012 /opt/gitlab-7.6.2-0/apps/gitlab/htdocs/config/gitlab.yml port: 9000 /opt/gitlab-7.6.2-0/apps/gitlab/gitlab-shell/config.yml http://yourIP:90006 /opt/gitlab-7.6.2-0/apps/gitlabci/gitlabci-runner/config.yml url: http://yourIP:90006 /opt/gitlab-7.6.2-0/apps/gitlabci/htdocs/config/application.yml 'http://yourIP:9000/' /opt/gitlab-7.6.2-0/apache2/conf/httpd.conf Listen 9000
2.重啟服務:
/opt/gitlab-7.6.2-0/ctlscript.sh restart
3.tingzhi停止服務:
/opt/gitlab-7.6.2-0/ctlscript.sh stop
4.卸載gitlab:
./opt/gitlab-7.6.2-0/uninstall
5.查看進程:
ps -ef |grep httpd
如果還有其他問題,請在這里找日志:
/opt/gitlab-7.6.2-0/apache2/logs,主要查看 error_log 日志,根據錯誤信息分析問題,並逐個解決。
--------------------------------
至於使用方面,其實很簡單。
給幾個常用命令,供參考
Git global setup
git config --global user.name "haochuang" git config --global user.email "haochuang@aol.com"
Create a new repository
mkdir hao-homepage cd tw-homepage git init touch README.md git add README.md git commit -m "first commit" git remote add origin git@serverip:haochuang/hao-homepage.git git push -u origin master
Push an existing Git repository
cd existing_git_repo git remote add origin git@serverip:haochuang/hao-homepage.git git push -u origin master
接下來,就可以歡天喜地的使用了:-)