posir 发表于 2018-1-10 23:18:37

一只野生的程序猿

  实验测试环境:
  * centos 6.5_X86_64 最小化安装
  * 关闭了iptables 和selinux
  * CPU:4内存:8G
  1.安装centos6.5,使用最小化安装
  关闭iptables,清除iptables规则;并关闭selinux
  #service iptables stop
  #iptables -F
  #iptables -X
  #service iptables save
  #chkconfig iptables off
  #sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  2.精简化启动项
  一般情况下,服务器刚装完系统后有必要保留的开机自启动服务只有5个,具体如下:
  sshd :远程连接ssh,不多说;
  rsyslog:日志相关文件,这是操作系统提供的一种机制
  network:服务器要联网,必须开启这个服务啊
  crond:这个服务主要用来执行系统及用户配置的任务计划,有周期性执行的任务的时候必须开启,生产环境下必须开启这个服务
  sysstat:服务器性能检测工具,收集服务器运行数据,判断运行是否正常
  操作命令如下:
  # LANG=en
  # for root in `chkconfig --list|grep 3:on|awk '{print $1}'`;do chkconfig --level 3 $root off;done
  # for root in crond network rsyslog sshd sysstat;do chkconfig --level 3 $root on;done
  # chkconfig --list|grep 3:on
  crond            0:off    1:off    2:on    3:on    4:on    5:on    6:off
  network            0:off    1:off    2:on    3:on    4:on    5:on    6:off
  rsyslog            0:off    1:off    2:on    3:on    4:on    5:on    6:off
  sshd               0:off    1:off    2:on    3:on    4:on    5:on    6:off
  sysstat            0:off    1:on   2:on    3:on    4:on    5:on    6:off
  注意:sysstat服务在服务器中很可能没有,如果系统提示,我们只需把这个服务在这条命令中去掉就可以了
  接下来我们重启服务器就可以了,重启的过程中,你会发现速度非常快;
  3.安装gitlab所需依赖:
  #yum install wget curl vim net-tools postfix policycoreutils openssh-server openssl-clients -y
  #chkconfig postfix on
  #chkconfig sshd on
  4.添加GitLab仓库,并安装到服务器上
  #curl -sS http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh | sudo bash
  #yum install gitlab-ce -y
  可能要等待的时间比较长,可以使用这条命令,直接扔在后台下载
  #nohup yum install gitlab-ce -y &
  如果你不习惯使用命令管道的安装方式, 你可以在这里下载 安装脚本 或者 手动下载您使用的系统
  相应的安装包(RPM/Deb) 然后安装
  #curl -LJO https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-XXX.rpm
  #rpm -i gitlab-ce-XXX.rpm
  5.启动gitlab
  #gitlab-ctl reconfigure
  注意事项以及异常故障排查:
  1.按照该方式,我安装了一个确实没问题,只不过是英文版。没有经过汉化。
  2.默认安装登录需要重置root密码。可以自己单独设置一个复杂密码后登录。
  3.gitlab本身采用80端口,如安装前服务器有启用80,安装完访问会报错。需更改gitlab的默认端口。
https://images2017.cnblogs.com/blog/1124243/201708/1124243-20170824232403199-1041925173.png
页: [1]
查看完整版本: 一只野生的程序猿