开发环境 测试环境等这些服务器基本都是在linux环境上的,不确定是什么环境可以询问相应的开发同事
-
在本地下载好对应的nginx压缩包
下载地址http://nginx.org/en/download.html
使用filezilla 等服务器上传工具,把本地下载的包传送到对应服务器上
/usr/local //存放位置
- ssh链接服务器并对压缩包进行解压
tar zxvf nginx-1.15.8.tar.gz
服务器克隆Git仓库
- git clone 发现没有git命令 官网查看对应操作系统下载https://git-scm.com/download/linux
yum install git
-. 使用ssh克隆仓库 git clont git@...git
如果需要使用密码,直接更换http下载
在使用 git clone http://......../project 时系统提示如下图所示错误
Initialized empty Git repository in /usr/local/nginx-1.15.8/html/hotel-manage-pc/.git/
error: The requested URL returned error: 401 while accessing http://usernameg:password8@172.25.38.44/frontend/hotel-manage-pc.git/info/refs
fatal: HTTP request failed
The requested URL returned error: 401(curl_result = 22, http_code = 401 ....)
从http_code = 401 可以看出是因为authorization的问题,虽然已经提示了输入username和password,但在多次获取时并未将之前录入的username和password保存下来。
解决办法有二:
一、在$HOME下创建 _netrc文件,在其中写入如下内容
machine 10.0.13.2
login your_username
password your_password
二、在执行命令式直接提供username和password,如下
将git clone http://....../project 替换成
git clone http://username:password@10.0.13.2/project
``