開(kāi)發(fā)環(huán)境 測(cè)試環(huán)境等這些服務(wù)器基本都是在linux環(huán)境上的,不確定是什么環(huán)境可以詢問(wèn)相應(yīng)的開(kāi)發(fā)同事
-
在本地下載好對(duì)應(yīng)的nginx壓縮包
下載地址http://nginx.org/en/download.html
WechatIMG36.jpeg 使用filezilla 等服務(wù)器上傳工具,把本地下載的包傳送到對(duì)應(yīng)服務(wù)器上
/usr/local //存放位置
- ssh鏈接服務(wù)器并對(duì)壓縮包進(jìn)行解壓
tar zxvf nginx-1.15.8.tar.gz
服務(wù)器克隆Git倉(cāng)庫(kù)
- git clone 發(fā)現(xiàn)沒(méi)有g(shù)it命令 官網(wǎng)查看對(duì)應(yīng)操作系統(tǒng)下載https://git-scm.com/download/linux
yum install git
-. 使用ssh克隆倉(cāng)庫(kù) git clont git@...git
如果需要使用密碼,直接更換http下載
在使用 git clone http://......../project 時(shí)系統(tǒng)提示如下圖所示錯(cuò)誤
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 可以看出是因?yàn)閍uthorization的問(wèn)題,雖然已經(jīng)提示了輸入username和password,但在多次獲取時(shí)并未將之前錄入的username和password保存下來(lái)。
解決辦法有二:
一、在$HOME下創(chuàng)建 _netrc文件,在其中寫入如下內(nèi)容
machine 10.0.13.2
login your_username
password your_password
二、在執(zhí)行命令式直接提供username和password,如下
將git clone http://....../project 替換成
git clone http://username:password@10.0.13.2/project
``
