linux 搭建 gitlab 私人服务器 怼烎@ 2022-10-02 11:51 194阅读 0赞 要求:运行内存要在 2G 以上 整理步骤: (1、安装和配置必要的依赖 ) yum install -y curl openssh-server openssh-clients cronie (2、将在系统防火墙打开HTTP和SSH访问) lokkit -s http -s ssh (3、安装postfix发送通知邮件) yum install postfix service postfix start chkconfig postfix on 在安装配置的屏幕可能会出现后缀。选择“Internet站点”并按Enter键。使用服务器的外部DNS“邮件名称”并按Enter键。如果出现额外的屏幕,继续按回车键接受默认值。 (4、添加gitlab包库安装包) curl -sS [https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh][https_packages.gitlab.com_install_repositories_gitlab_gitlab-ce_script.rpm.sh] | sudo bash 【速度慢的话,换成下面的试试】 curl -sS [http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh][http_packages.gitlab.cc_install_gitlab-ce_script.rpm.sh] | sudo bash (5、下载安装包) yum install -y gitlab-ce (6、修改访问方式) vim /etc/gitlab/gitlab.rb 修改为:external\_url ‘[http://127.0.0.1:8081][http_127.0.0.1_8081]’ 下面两行注释去掉并修改为: unicorn\[‘listen’\] = ‘127.0.0.1’ unicorn\[‘port’\] = 8081 grep ^external\_url /etc/gitlab/gitlab.rb 返回: external\_url ‘[http://127.0.0.1:8081][http_127.0.0.1_8081]’ \#正确 grep ^unicorn /etc/gitlab/gitlab.rb 返回: unicorn\[‘listen’\] = ‘127.0.0.1’ \#正确 unicorn\[‘port’\] = 8081 (7、配置并启动gitlab) gitlab-ctl reconfigure 【注意】 日志位置:/var/log/gitlab 可以进去查看访问日志以及报错日志等,供访问查看以及异常排查。 gitlab-ctl tail nginx/gitlab\_access.log \#查看nginx访问日志 gitlab-ctl tail \#查看所有日志 gitlab-ctl start|stop|status|restart \#日常操作 每次重新配置,也可以 gitlab-ctl reconfigure 使之生效 【卸载】 gitlab-ctl help来获取相关命令 gitlab-ctl uninstall,(此方法在 /opt/gitlab 下,没有就是不存在)关于其的说明是 Kill all processes and uninstall the process supervisor (data will be preserved). 但在实际操作中,只通过uninstall无法彻底卸载gitlab 以下方法可彻底卸载: gitlab-ctl stop gitlab-ctl uninstall gitlab-ctl cleanse rm -rf /opt/gitlab 参考网址: [https://about.gitlab.com/installation/\#centos-6][https_about.gitlab.com_installation_centos-6] [blog.csdn.net/michaelzhouh/article/details/48374431][blog.csdn.net_michaelzhouh_article_details_48374431] [http://blog.csdn.net/m0\_37886429/article/details/73603481][http_blog.csdn.net_m0_37886429_article_details_73603481] 【大神文档】 [http://blog.csdn.net/ouyang\_peng/article/details/72903221][http_blog.csdn.net_ouyang_peng_article_details_72903221] 【中文社区(汉化)】 [https://gitlab.com/xhang/gitlab][https_gitlab.com_xhang_gitlab] [https_packages.gitlab.com_install_repositories_gitlab_gitlab-ce_script.rpm.sh]: https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh [http_packages.gitlab.cc_install_gitlab-ce_script.rpm.sh]: http://packages.gitlab.cc/install/gitlab-ce/script.rpm.sh [http_127.0.0.1_8081]: http://127.0.0.1:8081 [https_about.gitlab.com_installation_centos-6]: https://about.gitlab.com/installation/#centos-6 [blog.csdn.net_michaelzhouh_article_details_48374431]: http://blog.csdn.net/michaelzhouh/article/details/48374431 [http_blog.csdn.net_m0_37886429_article_details_73603481]: http://blog.csdn.net/m0_37886429/article/details/73603481 [http_blog.csdn.net_ouyang_peng_article_details_72903221]: http://blog.csdn.net/ouyang_peng/article/details/72903221 [https_gitlab.com_xhang_gitlab]: https://gitlab.com/xhang/gitlab
还没有评论,来说两句吧...