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

CentOS+webmin环境安装OpenLDAP和phpldapadmin【未完成】

利用webmin里面的功能,安装了ldap server管理模块,当然了,在它提示下也安装了openldap。遗憾的是,webmin里面ldap server管理模块貌似不是最新,并不能一步到位正确配置openldap,需要手工配置。搞了很久,不少坑。

首先,是webmin里面的模块参数,里面的openldap的执行文件路径、配置文件路径等等,好多都跟我的环境不一样。对模块的参数进行了修改。然后也设置了openLDAP的一些参数:Suffix、RootDN、Rootpw等等。这些知识修改的文件,要配置成功,还得要服务器运行,并且webmin的模块能连上ldap server。但由于不是很熟,一直不能成功连上server。

中间也检查过slapd服务,确实开起来了,用前面设的RootDN和Rootpw去登录,就是不成功,报错“Invalid credential”。后来临机一动,停用了服务,直接执行

slapd -f /etc/openldap/slapd.conf

结果能连上了。研究了一下/etc/init.d/slapd文件,暂时没什么头绪。phpldapadmin安装上了,还没配置好,还不能成功登录。