中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

自己做網站怎么掙錢對網絡營銷的認識有哪些

自己做網站怎么掙錢,對網絡營銷的認識有哪些,wordpress 4.5 多站點,可以賺人民幣的傳奇手游基于Jenkins自動打包并部署Tomcat環(huán)境 傳統(tǒng)網站部署的流程 在運維過程中,網站部署是運維的工作之一。傳統(tǒng)的網站部署的流程大致分為:需求分 析-->原型設計-->開發(fā)代碼-->提交代碼-->內網部署-->內網測試-->確認上線-->備份數(shù)據(jù)-->外網更新…

基于Jenkins自動打包并部署Tomcat環(huán)境

傳統(tǒng)網站部署的流程

????????在運維過程中,網站部署是運維的工作之一。傳統(tǒng)的網站部署的流程大致分為:需求分 析-->原型設計-->開發(fā)代碼-->提交代碼-->內網部署-->內網測試-->確認上線-->備份數(shù)據(jù)-->外網更新-->外網測試-->發(fā)布完成。如果在內網測試時發(fā)現(xiàn)代碼有異常,返回代碼開發(fā)人員名字,調整代碼;如果在外網測試時發(fā)現(xiàn)外網部署的代碼有異常,可以及時進行網站回滾。

傳統(tǒng)代碼上線的過程

開發(fā)人員發(fā)起代碼上線的需求(郵件中包含開發(fā)做好的WAR包)-->運維人員連接線上負載調度器(Nginx)--> 隔離一組服務器(Tomcat)--> 連接服務器(Tomcat)--> 備份舊代碼(tar打包)-->?刪除舊代碼目錄 -->?上傳新的WAR包 --> 外網測試 --> 測試不通過則通過備份回滾代碼 --> 測試通過則利用rsync的腳本推送代碼到其他服務器--> 統(tǒng)一外網測試 -->連接調度器恢復隔離機制 ?--> 隔離另一組服務器實施上線步驟 -->?上線完成。

目前主流網站部署的流程

目前主流網站部署方法:通過 Hudson/Jenkins 工具平臺實現(xiàn)全自動部署+測試,是一個可擴展的持續(xù)集成引擎,屬于開源軟件項目,旨在提供一個開放易用的軟件平臺,使軟件的持續(xù)集成變成可能。Jenkins 非常易于安裝和配置,簡單易用。

  • 開發(fā)人員:寫好代碼,不需要自己進行源碼編譯、打包等工作,直接將代碼分支存放在 SVN、Git 倉庫即可。
  • 運維人員:減輕人工干預的錯誤率,同時解放運維人員繁雜的上傳代碼、手動備份、更新等操作。
  • 測試人員:可以通過 Jenkins 進行簡單的代碼及網站測試。

?????????Jenkins 的工作原理是先將源代碼從 SVN/Git 版本控制系統(tǒng)中拷貝一份到本地,然后根據(jù)設置的腳本調用Maven進行 build(構建)。整個系統(tǒng)的關鍵就是 build 腳本,build 腳本告訴Jenkins 在一次集成中需要執(zhí)行的任務。

?

所需工具提取鏈接:https://pan.baidu.com/s/1N_HvY1WExW6yycI3udbnFw?pwd=02yi?
提取碼:02yi?

實驗環(huán)境

操作系統(tǒng)

IP地址

主機名

角色

CentOS7.5

192.168.2.121

gitgit服務器

CentOS7.5

192.168.2.122

Jenkins?git客戶端jenkins服務器

CentOS7.5

192.168.2.123

tomcat

web服務器

所有主機關閉防火墻和selinux

[root@localhost ~]# systemctl stop firewalld 
[root@localhost ~]# iptables -F
[root@localhost ~]# setenforce 0

1、配置git主機

# rpm安裝安裝依賴關系:6和7都安

[root@localhost ~]# hostname gitclient
[root@localhost ~]# bash
[root@gitclient ~]# [root@gitclient ~]# yum -y install curl-devel expat-devel gettext-devel  openssl-devel zlib-devel

# 編譯安裝—服務端和客戶端,訪問https://mirrors.edge.kernel.org/pub/software/scm/git/下載所需要的版本

[root@gitclient ~]# tar xf git-2.22.0.tar.gz -C /usr/src/[root@gitclient ~]# cd /usr/src/git-2.22.0/[root@gitclient git-2.22.0]#  make configure[root@git git-2.22.0]# ./configure --prefix=/usr/local/git && make && make install[root@gitclient git-2.22.0]# ln -sf /usr/local/git/bin/git /usr/bin/[root@gitclient git-2.22.0]# git --versiongit version 2.22.0[root@gitclient git-2.22.0]# cd
[root@gitclient ~]# useradd git
[root@gitclient ~]#  echo "123456" | passwd --stdin git
更改用戶 git 的密碼 。
passwd:所有的身份驗證令牌已經成功更新。

創(chuàng)建本地倉庫probe

[root@git ~]# su - git [git@gitclient ~]$ mkdir probe.git[git@gitclient ~]$ cd probe.git/[git@gitclient probe.git]$ git --bare init
已初始化空的 Git 倉庫于 /home/git/probe.git/[git@gitclient probe.git]$ exit
exit

克隆項目代碼同步到自己創(chuàng)建的倉庫中

[root@gitclient ~]# rz -E
rz waiting to receive.[root@gitclient ~]# tar xf psi-probe.tar.gz [root@gitclient ~]# git clone git@192.168.2.121:/home/git/probe.git
正克隆到 'probe'...
git@192.168.2.121's password:             #密碼為123456
warning: 您似乎克隆了一個空倉庫。[root@gitclient ~]# cp -rf psi-probe/* probe/[root@gitclient ~]# cd probe/[root@gitclient probe]# git add .[root@gitclient probe]# git config --global user.email "zch@163.com"[root@gitclient probe]# git config --global user.name "zch"[root@gitclient probe]# git commit -m "all probe"[root@gitclient probe]# git push origin master
git@192.168.2.121's password:              #密碼為123456枚舉對象: 1168, 完成.
對象計數(shù)中: 100% (1168/1168), 完成.
使用 2 個線程進行壓縮
壓縮對象中: 100% (1121/1121), 完成.
寫入對象中: 100% (1168/1168), 2.02 MiB | 6.79 MiB/s, 完成.
總共 1168 (差異 395),復用 0 (差異 0)
To 192.168.2.117:/home/git/probe.git* [new branch]      master -> master

2、配置jenkins主機

1)添加驗證憑據(jù) :憑證這里添不添加都可以,這個試驗不牽扯到憑證

?

?

?

在憑據(jù)頁面中,點擊“system”跳轉到“系統(tǒng)”頁面。點擊左側導航欄中“添加域”,

跳轉到“添加域”頁面。在該頁面創(chuàng)建域名為“crushlinux”并點擊“ok”完成配置。

“添加憑據(jù)”。

?

?

?填寫以上數(shù)據(jù)后,點擊“確定”就可以查看到新增的遠程 web 主機賬號。

?

2)添加 Publish Over SSH 遠程主機

????????在 Jenkins 首頁中點擊“Manage Jenkins”->“Configure System”->“Publish over SSH”->“SSH Servers”->“增加”選項按鈕,添加 SSH 遠程主機。如圖 3.13 所示,輸入 Name、Hostname、Username 等必要信息后,點擊“高級”選項按鈕->勾選“Use Password authentication,or use a different key”選項->輸入“遠程主機登錄密碼”->“Test Configuration”測試遠程主機配置。測試遠程主機配置成功后點擊“保存”按鈕即可。

?

3)配置 Maven、JDK、Git 環(huán)境

????????在 Jenkins 首頁中點擊“Manage Jenkins”->“Global Tool Configuration”->“JDK” ->新增“JDK”,設置 JDK 別名為”JDK17”。去掉“Install automatically”選項,設置 “JAVA_HOME”為本案例中 JDK 實際安裝路徑。

/usr/local/java

?

?

?Jenkins安裝maven

[root@jenkins ~]# rz -E            #上傳apache-maven-3.5.0-bin.tar.gz
rz waiting to receive.[root@jenkins ~]# tar xf apache-maven-3.5.0-bin.tar.gz [root@jenkins ~]# mv apache-maven-3.5.0 /usr/local/maven-3.5.0

為maven更換阿里云鏡像站

[root@jenkins ~]# vim /usr/local/maven-3.5.0/conf/settings.xml
#刪除兩個<mirrors>中的所有東西,大概12行,把下面的阿里云鏡像站添加到兩個<mirrors>中<mirror><id>nexus-aliyun</id><mirrorOf>central</mirrorOf><name>Nexus aliyun</name><url>http://maven.aliyun.com/nexus/content/groups/public</url></mirror>最后達到的效果

?????????在“Global Tool Configuration”配置界面中找到 Maven 配置選項,然后點擊“新增 Maven”并設置別名為“Maven3.5”。

?

?Git 配置

[root@jenkins ~]# which git
/usr/bin/git

?

?以上全局基本配置完畢后,點擊保存即可完成。

3、配置web主機

[root@tomcat ~]# tar xf apache-tomcat-8.5.40.tar.gz
[root@tomcat ~]# tar xf jdk-8u191-linux-x64.tar.gz 
[root@tomcat ~]# mv jdk1.8.0_191/ /usr/local/java
[root@tomcat ~]# mv apache-tomcat-8.5.40 /usr/local/tomcat
[root@tomcat ~]# vim /etc/profileexport JAVA_HOME=/usr/local/java/
export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar
export PATH=$JAVA_HOME/bin:$PATH[root@tomcat ~]# source /etc/profile[root@tomcat ~]# java -versionjava version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

發(fā)布公鑰給jenkins主機

[root@tomcat ~]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:2oIK3dABtlQQWpoUbeRl/xGhb9BC+gVpxHy1ExGxkkw root@tomcat
The key's randomart image is:
+---[RSA 2048]----+
| o@=.o++.Eo*+    |
|.B.=o +=*.o +    |
|+ o....=.B +     |
|   . .. * o .    |
|  . .  .S+       |
| . o . o.        |
|. . o o .        |
| . .   .         |
|  .              |
+----[SHA256]-----+[root@tomcat ~]# ssh-copy-id 192.168.2.122
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.2.122 (192.168.2.122)' can't be established.
ECDSA key fingerprint is SHA256:RG6SwP4IEdCtwZTqmw5B3lW7k3e06TBVBtpIQQhXXU8.
ECDSA key fingerprint is MD5:30:ae:c1:97:d5:fd:9f:ca:6b:36:a1:6d:e3:b7:06:d2.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.2.122's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh '192.168.2.122'"
and check to make sure that only the key(s) you wanted were added.

主機Jenkins默認用jenkins用戶去連接git,所以用jenkins用戶生成密鑰對,并發(fā)送給git。

[root@jenkins ~]# id jenkinsuid=997(jenkins) gid=995(jenkins) 組=995(jenkins)[root@jenkins ~]# su -s /bin/bash jenkinsbash-4.2$ ssh-keygen                #生成密鑰Generating public/private rsa key pair.
Enter file in which to save the key (/var/lib/jenkins/.ssh/id_rsa): 
Created directory '/var/lib/jenkins/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /var/lib/jenkins/.ssh/id_rsa.
Your public key has been saved in /var/lib/jenkins/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:TXyhCWBXN2DJk1/wZGz6ltw3XPqlshRVa7L6iLpt0ME jenkins@jenkins
The key's randomart image is:
+---[RSA 2048]----+
|      o.oo++=oo .|
|     . . +=+ *+..|
|        . =o.=oo |
|         E .o.+ .|
|        S o .+.+.|
|       . .  ..*o+|
|        .  ... o+|
|        ....+ . .|
|       o+o ..+   |
+----[SHA256]-----+bash-4.2$ ssh-copy-id git@192.168.2.121            #發(fā)送密鑰/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/var/lib/jenkins/.ssh/id_rsa.pub"
The authenticity of host '192.168.2.121 (192.168.2.121)' can't be established.
ECDSA key fingerprint is SHA256:a7IpGawJCffvD7q1hMT/WIP+ZT/Bm9Qhy8NxapJa1GA.
ECDSA key fingerprint is MD5:a6:56:1e:0c:59:62:fa:bf:f5:9b:77:d5:f0:0c:65:5d.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
git@192.168.2.121's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'git@192.168.2.121'"
and check to make sure that only the key(s) you wanted were added.bash-4.2$ ssh git@192.168.2.121                #登錄測試Last failed login: Tue Aug 22 15:06:36 CST 2023 on ssh:notty
There were 2 failed login attempts since the last successful login.
Last login: Tue Aug 22 14:58:26 2023[git@gitclient ~]$ exit
登出
Connection to 192.168.2.121 closed.bash-4.2$ exit
exit[root@jenkins ~]# ssh-keygen             #生成密鑰Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:t92j/vRv35XZWWmEpkdGebNRy7oyFzWwz1oDnYT6rSA root@jenkins
The key's randomart image is:
+---[RSA 2048]----+
|             oo.o|
|            .oB+o|
|            .B.O+|
|           .= B.o|
|        S ...+.B.|
|         E +.o*.B|
|          ooo+=+o|
|            ++ o+|
|           .o...B|
+----[SHA256]-----+[root@jenkins ~]# ssh-copy-id git@192.168.2.121        #發(fā)送密鑰/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
git@192.168.2.121's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'git@192.168.2.121'"
and check to make sure that only the key(s) you wanted were added.[root@jenkins ~]# ssh git@192.168.2.121                #登陸測試Last login: Tue Aug 22 16:31:43 2023
[git@gitclient ~]$ exit
登出
Connection to 192.168.2.121 closed.

4、新建Maven項目

????????在以上配置完成后,回到 Jenkins 首頁,選擇“新建任務”,然后輸入一個任務名稱 “probe”,并選中“Maven project”點擊當前頁面下方的“確定”按鈕。

?

?

在點擊“確定”按鈕后,選擇“源碼管理”選中“Git”,配置“RepositoriesURL”為

git@192.168.2.121:/home/git/probe.git

?

?選擇“Build”

clean package -Dmaven.test.skip=true?

選擇“構建后操作“中的“send build artfacts over SSH” “Exec command”中執(zhí)行命令的含義是:在自動部署前先殺掉 Tomcat 進程,然后刪除 war 包,用 scp 遠程拷貝命令將 Jenkins 自動打包好的項目 war 包拷貝到當前 Tomcat 應用目錄。 然后重啟 Tomcat 。

scp 192.168.2.122:/root/.jenkins/workspace/proble/psi-probe-web/target/probe.war /usr/local/tomcat/webapps/
/usr/local/tomcat/bin/startup.sh

?

?????????以上全部配置完成后,點擊保存即可。然后點擊剛才創(chuàng)建的“probe”->“Build Now” 直至項目構建完成。構建過程可以在“控制臺輸出”中查看到。

?

?

?

5、驗證 Jenkins 自動打包部署結果

在web主機上查看 probe 目錄是否被拷貝到/usr/local/tomcat/webapps 目錄下

[root@tomcat ~]# ls /usr/local/tomcat/webapps/
docs  examples  host-manager  manager  probe  probe.war  ROOT
[root@tomcat ~]# ll /usr/local/tomcat/webapps/probe
總用量 20
drwxr-x---. 3 root root   66 8月  24 14:04 css
drwxr-x---. 2 root root 8192 8月  24 14:04 flags
-rw-r-----. 1 root root  536 8月  24 11:34 index.jsp
drwxr-x---. 3 root root  148 8月  24 14:04 js
drwxr-x---. 3 root root   76 8月  24 14:04 META-INF
drwxr-x---. 6 root root 4096 8月  24 14:04 WEB-INF從以上結果來看,Jenkins 已把打好的 probe war 包拷貝過來了。

從構建后的執(zhí)行命令可以看出,Tomcat 已經重新啟動,通過瀏覽器訪問測試 probe 監(jiān)控系統(tǒng)。http://192.168.2.123:8080/probe。

[root@tomcat ~]# vim /usr/local/tomcat/conf/tomcat-users.xml<role rolename="manager-gui"/><role rolename="admin-gui"/><user username="tomcat" password="tomcat" roles="manager-gui,admin-gui"/>
</tomcat-users>	# 在此行前加入上面三行

[root@tomcat ~]# vim /usr/local/tomcat/webapps/manager/META-INF/context.xml
<!--  <Valve className="org.apache.catalina.valves.RemoteAddrValve"allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> -->[root@tomcat ~]# /usr/local/tomcat/bin/shutdown.sh 
[root@tomcat ~]# /usr/local/tomcat/bin/startup.sh

?

至此,Jenkins 自動打包部署完畢。

http://www.risenshineclean.com/news/8307.html

相關文章:

  • 重慶公司章程怎么下載seo培訓學校
  • 網站建設申報書短視頻廣告投放平臺
  • 一級做爰片c視頻網站怎么做網頁宣傳
  • 九江建設公司網站免費網絡推廣
  • 怎么做應援網站石家莊抖音seo
  • 哪個網站可以做面料訂單流量精靈
  • 網站運營規(guī)劃百度指數(shù)怎么看
  • 廈門網站建設公司哪家好河南疫情最新消息
  • 手機app是什么意思seo的范疇是什么
  • windows做網站服務器嗎新型網絡營銷方式
  • 制作動態(tài)網頁的軟件seo免費優(yōu)化網址軟件
  • 制定網站建設方案十大接單平臺
  • 館陶縣網站怎么有自己的網站
  • 怎樣做京東網站最新seo新手教程
  • 日用品企業(yè)網站建設萬能軟文范例800字
  • 測試網站兼容大數(shù)據(jù)是干什么的
  • 太原網站制作費用金戈枸櫞酸西地那非片
  • 400全國服務熱線代理順德手機網站建設sem推廣計劃
  • 金山網站制作百度業(yè)務范圍
  • 浦東新區(qū)專業(yè)做網站seo推廣軟件排行榜
  • 婁底企業(yè)網站建設制作百度免費推廣登錄入口
  • 門戶網站建設運行環(huán)境要求每日精選12條新聞
  • wordpress中文分類問題多地優(yōu)化完善疫情防控措施
  • 自己做網站怎么修改語言寧波seo網站
  • 香港網站域名查詢百度推廣關鍵詞匹配模式
  • 網站需要怎么做推廣發(fā)布任務平臺app下載
  • 自己可以建設一個網站要錢游戲推廣可以做嗎
  • 做育兒類網站用什么程序好百度收錄接口
  • 杭州網站設計首選柚米精準營銷案例
  • 泰安建材網站建設電話企業(yè)危機公關