章工运维 章工运维
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)

章工运维

业精于勤,荒于嬉
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)
  • linux

  • windows

  • 中间件

  • 网络

  • 安全

  • 存储

  • 防火墙

  • 数据库

  • 系统

    • vmware

    • ftp

    • nexus

    • harbor

    • confluence&jira

    • loki

    • sonarqube

    • svn

    • other

    • openldap

      • openldap介绍和安装
      • go-ldap-admin平台安装
        • 集成zabbix,jenkins,gitlab,jumpserver,harbor,jira,confluence实战
        • openldap配置自助修改密码
      • influxdb

      • wordpress

      • kvm

      • argocd

      • jfrog

      • nextcloud

      • RustDesk

      • mail

      • ghost

    • docker

    • other

    • 监控

    • 运维
    • 系统
    • openldap
    章工运维
    2023-05-27
    目录

    go-ldap-admin平台安装

    # 安装包下载

    前端包:https://github.com/eryajf/go-ldap-admin-ui/releases

    后端包:https://github.com/eryajf/go-ldap-admin/releases

    # 前端安装

    编译项目之前,需要将.env.production中的VUE_APP_BASE_API配置项,更改为正式部署环境的域名。

    cat .env.production
    # just a flag
    ENV = 'production'
    
    # base api
    VUE_APP_BASE_API = 'http://172.16.30.172:8888/'
    #VUE_APP_WS_API = 'ws://localhost:8088'
    VUE_APP_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nMIGfMA0GCb3DQEBAQUAA4GNADCBiQKBgQDbOYcY8HbDaNM9ooYXoc9s+R5o\nR05ZL1BsVKadQBgOVH/kj7PQuD+ABEFVgB6rJNi287fRuZeZR+MCoG72H+AYsAhR\nsEaB5SuI7gDEstXuTyjhx5bz0wUujbDK4VMgRfPO6MQo+A0c95OadDEvEQDG3KBQ\nwLXapv+ZfsjG7NgdawIDAQAB\n-----END PUBLIC KEY-----"
    
    1
    2
    3
    4
    5
    6
    7
    8

    # 编译项目

    # 一些直接从GitHub拉取的依赖需要进行如下配置
    $ git config --global url."https://".insteadOf git://
    
    $ npm install --registry=http://registry.npmmirror.com
    
    $ yarn build:prod
    
    1
    2
    3
    4
    5
    6

    编译完成之后,会在本地生成dist目录,需将其同步到服务器。

    # OpenResty配置

    在OpenResty中添加如下配置,代理本项目:

    server {
        listen 80;
        server_name localhost;
    
        root /data/application/go-ldap-admin-ui;
    
        location / {
            try_files $uri $uri/ /index.html;
            add_header Cache-Control 'no-store';
        }
    
        location /api/ {
            proxy_set_header Host $http_host;
            proxy_set_header  X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_pass http://172.16.30.172:8888;
        }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    配置重载之后,即可在浏览器通过http://oxy_pass http进行访问

    # 后端部署

    # 编译项目

    $ make build-linux
    
    1

    # 更改配置

    根据实际情况调整配置文件内容。

    $ vim config.yml
    
    1

    # systemd管理

    基于systemd进行管理:

    $cat /usr/lib/systemd/system/go-ldap-admin.service
    
    [Unit]
    Description=Go Ldap Admin Service
    
    [Service]
    WorkingDirectory=/data/www/go-ldap-admin.eryajf.net/
    ExecStart=/data/www/go-ldap-admin.eryajf.net/go-ldap-admin
    
    [Install]
    WantedBy=multi-user.target 
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    # 启动项目

    $ systemctl daemon-reload
    $ systemctl start go-ldap-admin
    $ systemctl status go-ldap-admin
    
    1
    2
    3

    # 验证服务

    启动之后项目将会监听本地8888端口,通过如下请求可验证后端是否可用:

    $ curl -s localhost:8888/api/base/ping | jq
    {
      "code": 200,
      "data": "pong",
      "msg": "ok"
    }
    
    1
    2
    3
    4
    5
    6
    微信 支付宝
    上次更新: 2023/05/27, 18:13:40

    ← openldap介绍和安装 集成zabbix,jenkins,gitlab,jumpserver,harbor,jira,confluence实战→

    最近更新
    01
    shell脚本模块集合
    05-13
    02
    生活小技巧(认知版)
    04-29
    03
    生活小技巧(防骗版)
    04-29
    更多文章>
    Theme by Vdoing | Copyright © 2019-2025 | 点击查看十年之约 | 鄂ICP备2024072800号
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式