CentOS+Apache环境下安装gitlab

环境:CentOS 6.8,  Apache 2.22.15

先根据官方教程,安装omnibus版本的安装包。官方源速度太慢,镜像选择了清华tuna。安装过程一路顺利。

关键是配置,gitlab默认内嵌nginx服务器,如果要使用Apache的话,需要禁用掉先,否则开机会报80端口冲突(话说这两天服务器被我重启了三四次。。。,之前170天左右稳定运行没动过)。

设置workhouse tcp连接,本机 127.0.0.1 端口8181

具体参考:

http://docs.gitlab.com/omnibus/settings/nginx.html#using-a-non-bundled-web-server

https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md#using-a-non-bundled-web-server

看文档,SELinux环境下需要做一些配置,本次安装因为本机SELinux已经禁用,因此没有遇到。

参考:https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache#selinux-modifications

根据使用的gitlab版本及本机apache版本,选择一个合适的配置文件,本机参考了:

https://gitlab.com/gitlab-org/gitlab-recipes/blob/master/web-server/apache/gitlab-omnibus-apache22.conf

启动服务器,报503错误,查httpd的日志,发现Apache没有与127.0.0.1:8181连上。

如果要配置HTTPS访问,则配置文件参考:

https://gitlab.com/gitlab-org/gitlab-recipes/blob/8-1-stable/web-server/apache/gitlab-omnibus-ssl-apache22.conf

配置编辑完成后重启httpd,结果报错:

Invalid command ‘SSLCompression’, perhaps misspelled or defined by a module not included in the server

查了一下,是因为Apache版本太低(2.22.15)的原因,起码需要2.22.24。针对低版本的临时解决方案如下:

修改 /etc/sysconfig/httpd文件,添加如下语句:

export OPENSSL_NO_DEFAULT_ZLIB=1

参考:https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache#other-httpd-security-considerations

然后重启结果还是不行。—暂时没解决,谋求升级系统。

参考:

http://serverfault.com/questions/455450/how-to-disable-sslcompression-on-apache-httpd-2-2-15-defense-against-crime-bea

http://serverfault.com/questions/508520/how-to-disable-ssl-tls-compression-in-apache-2-2-16

作者: Ben

IT、电商、零售、医药行业混迹多年的理想主义者。