配置阿里云+域名真实环境,访问不了

来源:2-3 GitLab安装配置管理

smniuhe

2020-07-09

环境阿里云ECS, centos7.3 2核4G,所有配置方式都是参考视频,
域名是 smniuhe.com,可以ping 通,有个疑问是可以配置子域名么,这边并不能ping 通 gitlab.smniuhe.com,gitlab-ctl restart 启动服务后,访问不了 gitlab.smniuhe.com 这个地址,老师需要查看我这边什么配置随时发信息

#将所有证书配置到gitlab文件中
[root@iZuf6iq8e7ya9v3ix71k0pZ ssl]# vim /etc/gitlab/gitlab.rb
external_url = 'https://gitlab.smniuhe.com'
nginx['redirect_http_to_https'] = true
# nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.smniuhe.com.crt"
# nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.smniuhe.com.key"
# nginx['ssl_dhparam'] = /etc/gitlab/ssl/dhparams.pem # Path to dhparams.pem, eg. /etc/gitlab/ssl/dhparams.pem

# 配置 nginx 转发
[root@iZuf6iq8e7ya9v3ix71k0pZ ssl]# vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
server {
  listen *:80;
  server_name gitlab.smniuhe.com;
  rewrite ^(.*)$ https://$host$1 permanent;
  server_tokens off; ## Don't show the nginx version number, a security best practice

  ## Increase this if you want to upload large attachments
  ## Or if you want to accept large git objects over http
  client_max_body_size 0;


vim /var/opt/gitlab/gitlab-rails/etc/gitlab.yml
 #
  # 1. GitLab app settings
  # ==========================

  ## GitLab settings
  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: 106.15.191.27
    port: 80
    https: false
写回答

6回答

一路向北

2020-07-10

如果你配置了证书 那就应该开启443端口,而且这里我看不到gitlab的关键配置项,从最新日志我又看到了一个占用了8080端口的错误

0
6
smniuhe
回复
一路向北
谢谢老师,现在可以了,换了个思路,不使用子域名了,直接使用http的方式,监听端口改成8090,现在主要是想了解下整个持续交付的流程,暂时减少其他配置减少干扰,继续加油了
2020-07-11
共6条回复

一路向北

2020-07-10

建议把完整的配置文件发过来,还有为什么你的nginx要启动80端口?

0
1
smniuhe
稍等,我copy下文件,平时不干运维,从持续交付后面想了解下这个流程,就立马购买了课程
2020-07-10
共1条回复

smniuhe

提问者

2020-07-10

这是解决 80 冲突后的日志,没看到相关异常,gitlab.smniuhe.com 还是访问不了
//img.mukewang.com/szimg/5f086f1e0962e9d818121698.jpg



0
0

一路向北

2020-07-10

从日志看的确80端口被占用,首先确保你的机器上没有其他服务使用80端口

0
2
smniuhe
看日志,80端口冲突解决了,但还是访问不了,日志我截图到上面去了,老师能不能帮我分析下,周末终于有时间了,不然一直卡着
2020-07-10
共2条回复

smniuhe

提问者

2020-07-10

 sudo gitlab-clt tail 查看运行日志

//img.mukewang.com/szimg/5f07c9c109790b1609690486.jpg

//img.mukewang.com/szimg/5f07d3640944f4ca10880203.jpg







0
0

一路向北

2020-07-10

感谢这位同学关注,可以查看一下gitlab日志看有什么报错信息,并且确保你的云主机已经做了备案,否则公网访问80 443端口可能会被运营商禁端口。

0
2
一路向北
这个docker-pr我没见过,应该不是gitlab的,建议删掉。
2020-07-10
共2条回复

Jenkins+Ansible+Gitlab-三剑合璧掌握自动化部署

整合三大工具解决自动化部署&持续交付问题

1290 学习 · 319 问题

查看课程