阅读 44

腾讯云服务器环境配置记录

Env

  • Platform: TencentCloud CVM
  • Region: East China (Shanghai)
  • System: CentOS 7.5
  • SSH: XShell 6 (Free for Home/School)
yum update
yum install -y lrzsz # For XShell file transfer
yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install -y gcc perl-ExtUtils-MakeMaker
复制代码

Java 1.8

Download rpm file of jdk from Oracle official website and transfer it to server, then rpm the .rpm file:

rpm -ivh jdk-8u201-linux-x64.rpm
复制代码

Set JAVA_HOME & PATH

echo "export JAVA_HOME=/usr/java/jdk1.8.0_201-amd64/" >> /etc/bashrc
echo "export PATH=$JAVA_HOME/bin:$PATH" >> /etc/bashrc
source /etc/bashrc
java -version
复制代码

Yes~

java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
复制代码

Git 2.21.0

Download the tar.gz file from GitHub-git/git first, and transfer it to server

May need to remove the old version→ yum remove -y git-1.8.3.1

tar xzf git-2.21.0.tar.gz # 解压
cd git-2.21.0/
make prefix=/usr/local/git all # 指定位置进行编译
make prefix=/usr/local/git install # 指定位置进行安装
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc # 设置环境变量
source /etc/bashrc # 刷新
git --version
复制代码

Redis 5.0.4

This download was fast, just go wget / 这个下载挺快的,直接wget

wget http://download.redis.io/releases/redis-5.0.4.tar.gz
tar xzf redis-5.0.4.tar.gz
mv redis-5.0.4 /usr/local/redis
cd /usr/local/redis
make PREFIX=/usr/local/redis all # 好像PREFIX用小写就不行orz
make PREFIX=/usr/local/redis install
echo "export PATH=$PATH:/usr/local/redis/bin" >> /etc/bashrc
source /etc/bashrc
redis-server --version
redis-cli --version

vim /usr/local/redis/redis.conf
# 修改 daemonize no
daemonize yes
redis-server /usr/local/redis/redis.conf

#关闭redis-server
redis-cli
127.0.0.1:6379> shutdown
not connected>
# shutdown可带参数save|nosave
复制代码

OK, fine

[root@VM_0_10_centos ~]# redis-server --version
Redis server v=5.0.4 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=51e01150da47607b
[root@VM_0_10_centos ~]# redis-cli --version
redis-cli 5.0.4
复制代码

Tomcat

# 下载
[root@VM_0_10_centos temp]# wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.42/bin/apache-tomcat-8.5.42.tar.gz
# 解压
[root@VM_0_10_centos temp]# tar xzf apache-tomcat-8.5.42.tar.gz
# 重命名并放到/usr/local/下面
[root@VM_0_10_centos temp]# mv apache-tomcat-8.5.42 /usr/local/tomcat

复制代码

常用命令

  • 启动:/usr/local/tomcat/bin/startup.sh
  • 关闭:/usr/local/tomcat/bin/shutdown.sh
  • 查看进程:ps -ef|grep java
  • 查看日志:tail -f /usr/local/tomcat/logs/catalina.out

Maven

[root@VM_0_10_centos temp]# wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
[root@VM_0_10_centos temp]# tar xvf apache-maven-3.6.1-bin.tar.gz
[root@VM_0_10_centos temp]# mv apache-maven-3.6.1 /usr/local/maven
[root@VM_0_10_centos temp]# vim /etc/bashrc
# 添加内容
export PATH=$PATH:/usr/local/maven/bin
export M2_HOME=/usr/local/maven
export M2=$M2_HOME/bin
# 刷新
[root@VM_0_10_centos temp]# source /etc/bashrc
复制代码

Jenkins

# 下载
[root@VM_0_10_centos jar]# wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war
# 拷贝到tomcat的webapps目录
[root@VM_0_10_centos jar]# cp jenkins.war /usr/local/tomcat/webapps/
# 启动tomcat
[root@VM_0_10_centos ]# /usr/local/tomcat/bin/startup.sh
复制代码

http://localhost:8080/Jenkins

自行完成入门配置

关注下面的标签,发现更多相似文章
评论