遠程伺服器手動部署備忘筆記

來源:互聯網
上載者:User

遠程伺服器手動部署備忘筆記 環境介紹 1,項目最新版本在git庫中,地址為http://192.168.0.18:8060/git/GatherServer.git 2,擁有一台遠程亞馬遜伺服器,系統為ubuntu Server,web伺服器為glassfish 3,本地機器要裝有git 和 maven必要知識點 1,熟悉git命令 2,熟悉基本的linux命令 3,熟悉maven打包命令 4,熟悉遠程操作基本命令 步驟 1,將git庫中的項目拉到本地 命令:git clone http://192.168.0.18:8060/git/GatherServer.git 2,進入專案檔夾,我這裡進入GatherServer檔案夾,切換到要發布版本分支 我的只有一個master分支,不需要切換分支,如果需要切換到自己的分支,用git checkout xxx(自己的分支) 3,進入拉到本地的項目(GatherServer檔案夾)使用maven命令對項目進行編譯 命令:mvn compile 4,進入target檔案夾,會發現檔案夾下有一個GatherServer.war包,這個就是我們要發布到遠程伺服器上的包 5,將war包上傳到遠程伺服器。命令:rsync -avz GatherServer.war ubuntu@122.226.207.56:~/juxinli;  //(當前路徑為/target,這句命令就是將target目錄下的GatherServer.war包複製到遠程56機器上的/juxinli目錄下) 6,遠程連結到56伺服器,命令:ssh ubuntu@122.226.207.56 (輸入遠程登入密碼) 7,進入/juxinli檔案夾,查看是否上傳成功 8,複製war包到glassfish伺服器.(當前路徑/juxinli)命令:cp GatherServer.war ~/glassfish4/glassfish/domains/domain1/autodeploy 9,重啟glassfish伺服器。(1)關閉伺服器:進入glassfish的bin目錄cd ~/glassfish4/glassfish/bin。(2)關閉命令:./asadmin stop-domain (3)重啟命令:./asadmin start-domain 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.