Alibaba Cloud deployment project steps

Alibaba Cloud deployment project steps

1. rpm download address http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. Uninstall if openjdk is installed

[root@kuangshen ~]# java -version
java version “1.8.0_121”
Java™ SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot™ 64-Bit Server VM (build 25.121-b13, mixed mode)

an examination

[root@kuangshen ~]# rpm -qa|grep jdk
jdk1.8.0_121-1.8.0_121-fcs.x86_64

Uninstall -e --nodeps force deletion

[root@kuangshen ~]# rpm -e --nodeps jdk1.8.0_121-1.8.0_121-fcs.x86_64
[root@kuangshen ~]# java -version
-bash: /usr/bin/java: No such file or directory # OK
3、安装JDK

Install java rpm

[root@kuangshen kuangshen]# rpm -ivh jdk-8u221-linux-x64.rpm

After the installation is complete, configure the environment variable file: /etc/profile

JAVA_HOME=/usr/java/jdk1.8.0_221-amd64
CLASSPATH=%JAVA_HOME%/lib:%JAVA_HOME%/jre/lib
PATH= P A T H : PATH: PATH:JAVA_HOME/bin:$JAVA_HOME/jre/bin
export PATH CLASSPATH JAVA_HOME

Save and exit

Let the new environment variables take effect!

source /etc/profile

Test java -version

[root@kuangshen java]# java -version
java version “1.8.0_221”
Java™ SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot™ 64-Bit Server VM (build 25.221-b11, mixed mode)

Tomcat installation (decompression installation)

1. After installing the Java environment, we can test Tomcat! Prepare the Tomcat installation package!

2. Move the file to /usr/tomcat/ and unzip it!

[root@kuangshen kuangshen]# mv apache-tomcat-9.0.22.tar.gz /usr
[root@kuangshen kuangshen]# cd /usr
[root@kuangshen usr]# ls
apache-tomcat-9.0.22.tar.gz
[root@kuangshen usr]# tar -zxvf apache-tomcat-9.0.22.tar.gz # Unzip
3. Run Tomcat and enter the bin directory, which is the same as what we used to see under Windows

Execution: startup.sh -->start tomcat

Execution: shutdown.sh --> shut down tomcat

./startup.sh
./shutdown.sh
4, to ensure that Linux firewall ports are open, and if the cloud Ali, Ali cloud the need to ensure the security group policy is open!

View firewall service status

systemctl status firewalld

Open, restart, close, firewalld.service service

Turn on

service firewalld start

Reboot

service firewalld restart

shut down

service firewalld stop

View firewall rules

firewall-cmd --list-all # View all information
firewall-cmd --list-ports # Only look at port information

Open port

Open port command: firewall-cmd --zone=public --add-port=80/tcp --permanent
Restart the firewall: systemctl restart firewalld.service

Command meaning:
–zone #scope
–add-port=80/tcp #Add port, the format is: port/communication protocol
–permanent #permanent effect, invalid after restart without this parameter

Install Docker (yum installation)

Installation based on CentOS 7
Official website installation reference manual: https://docs.docker.com/install/linux/docker-ce/centos/

Make sure you are CentOS7 and above

[root@192 Desktop]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
yum to install gcc related (you need to ensure that the virtual machine can access the Internet)

yum -y install gcc
yum -y install gcc-c++
uninstall the old version

yum -y remove docker docker-common docker-selinux docker-engine

Official website version

yum remove docker
docker-client
docker-client-latest
docker-common
docker-latest
docker-latest-logrotate
docker-logrotate
docker-engine
安装需要的软件包

yum install -y yum-utils device-mapper-persistent-data lvm2
set stable mirror warehouse

error

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Report an error

[Errno 14] curl#35 - TCP connection reset by peer
[Errno 12] curl#35 - Timeout

Correctly recommend the use of domestic

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
update yum package index

yum makecache fast
install Docker CE

yum -y install docker-ce docker-ce-cli containerd.io
启动docker

systemctl start docker
test

docker version

docker run hello-world

docker images

Guess you like

Origin blog.csdn.net/weixin_43941676/article/details/113863432