Centos搭建私有Maven

一、下载nexus

百度网盘:

链接:https://pan.baidu.com/s/1Gfl0HPg9ASBVij5c37BmUA

提取码:huor

二、上传latest-unix.tar文件到/usr/local

三、给nexus文件创建用户和权限

chwon -R nexus:nexus nexus-3.22.0-02

四、启动nexus,进入bin目录

./nexus start

五、宝塔配置nginx

server
{
    listen 80;
    listen [::]:80;
    server_name nexus.saiita.com.cn;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/nexus.saiita.com.cn;
    
    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    #SSL-END
    
    #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    #ERROR-PAGE-END
    
    #PHP-INFO-START  PHP引用配置,可以注释或修改
    include enable-php-72.conf;
    #PHP-INFO-END
    location /{
      proxy_pass http://0.0.0.0:8081/;
      proxy_redirect  off; 
      proxy_set_header Host $host; 
      proxy_set_header X-Real-IP $remote_addr; 
      proxy_set_header X-Forwarded-For 
      $proxy_add_x_forwarded_for; 
    }
    #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
    include /www/server/panel/vhost/rewrite/nexus.saiita.com.cn.conf;
    #REWRITE-END
    
    #禁止访问的文件或目录
    location ~ ^/(.user.ini|.htaccess|.git|.svn|.project|LICENSE|README.md)
    {
        return 404;
    }
    
    #一键申请SSL证书验证目录相关设置
    location ~ .well-known{
        allow all;
    }
    access_log  /www/wwwlogs/nexus.saiita.com.cn.log;
    error_log  /www/wwwlogs/nexus.saiita.com.cn.error.log;
}

六:访问nexus

Centos搭建私有Maven



知识共享许可协议本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。

相关推荐

暂无评论

目录展开