zoukankan      html  css  js  c++  java
  • 简单几步配置gitlab

    简单几步配置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

    接下来,就可以欢天喜地的使用了:-)

  • 相关阅读:
    [CAMCOCO][C#]我的系统架构.服务器端.(一)
    开博啦,加油!!
    Django RestFul framework Serializer序列化器的使用(定义)
    Django项目快速搭建
    Django简介
    python搭建虚拟环境
    大专生自学web前端前前后后
    实现资源国际化
    利用ajax实现页面动态修改
    七牛使用
  • 原文地址:https://www.cnblogs.com/haochuang/p/4221860.html
Copyright © 2011-2022 走看看