1.查看要改动的端口号是否被占用
netstat -an |grep 8081 或者 ps -ef | grep 8081
2.修改apache主配置文件
vim /data/gitlab/apache2/conf/httpd.conf
查找:/Listen
修改:Listen 8081
3.修改apache的bitnami的配置文件
vim /data/gitlab/apache2/conf/bitnami/bitnami.conf
<IfVersion < 2.3 >
NameVirtualHost *:8081
...
</IfVersion>
<VirtualHost _default_:8081 >
...
</VirtualHost>
4.修改gitlab-shell的配置文件
vim /data/gitlab/apps/gitlab/gitlab-shell/config.yml
gitlab_url: "http://192.168.1.10:8081 /"
5.修改gitlab的apache主目录配置文件
vim /data/gitlab/apps/gitlab/htdocs/config/gitlab.yml
gitlab:
host: 192.168.1.10
port: 8081
https: false
6.gitlab-workhorse请求认证地址:127.0.0.1:80,此地址被写死在启动文件里(apps/gitlab-workhorse/scripts/ctl.sh),所以修改此文件。
vim /data/gitlab/apps/gitlab-workhorse/scripts/ctl.sh
WORKHORSE_START="/opt/gitlab-8.8.4-0/apps/gitlab-workhorse/gitlab-workhorse -listenUmask 0 -listenNetwork tcp -listenAddr 127.0.0.1:8181 -authBackend http://127.0.0.1:8000"
7.重启服务
在cd /data/gitlab目录下
sudo ./ctlscript.sh restart
参考链接: