Linux上安裝git
Git是一個開源的分布式版本控制系統,可以有效、高速的處理從很小到非常大的項目版本管理。
而國外的GitHub和國內的Coding都是項目的托管平台。但是在使用Git工具的時候,第一步要學會如何安裝git,下面使用編譯方式安裝git。
1、介紹
使用Coding管理項目,上面要求使用的git版本為1.8.0以上,而很多yum源上自動安裝的git版本為1.7,所以需要掌握手動編譯安裝git方法。
2、安裝git依賴包
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
3、刪除已有的git
yum remove git
4、下載git源碼
切換到你的包文件存放目錄下
cd /usr/src
下載git安裝包
wget https://www.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz
解壓git安裝包
tar -zxvf git-2.8.3.tar.gz
cd git-2.8.3
配置git安裝路徑
./configure prefix=/usr/local/git/
編譯並且安裝
make && make install
查看git版本號
git --version
git已經安裝完畢
5、將git指令添加到bash中
vi /etc/profile
在最后一行加入
export PATH=$PATH:/usr/local/git/bin
讓該配置文件立即生效
source /etc/profile
maven安裝
下載網站:http://maven.apache.org/download.cgi
舊版本:https://mirrors.tuna.tsinghua.edu.cn/apache/maven/
//1、進入一個目錄
cd /usr/local
//2、創建一個文件夾
mkdir maven
//3、下載二進制編譯文件
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
//4、解壓
tar -zxvf apache-maven-3.5.4-bin.tar.gz
//5、配置環境變量
vim /etc/profile
//新增行MAVEN_HOME,等於號后面是maven解壓的文件夾地址
export MAVEN_HOME=/usr/local/maven/apache-maven-3.5.4
//找到PATH行,追加$MAVEN_HOME/bin
例如:
PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
//6、重新刷新配置文件
source /etc/profile
//7、配置阿里雲倉庫 修改 settings.xml
<mirror> <id>nexus-aliyun</id> <mirrorOf>central</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
//8、驗證maven:
mvn -v
Tomcat 安裝
https://tomcat.apache.org/download-80.cgi
歷史版本地址
http://archive.apache.org/dist/tomcat/
下載:
wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.41/bin/apache-tomcat-8.5.41.tar.gz
解壓、配置環境變量 、source一下
打war包
mvn clean package