Quick Guide: Secure Linux Server Setup with JDK, Tomcat & Docker
This step‑by‑step tutorial shows how to enable security groups, configure firewall ports, install the BT panel or use the command line to set up a Linux server, then install JDK, Tomcat, and Docker CE with all required commands and configurations.
Enable Security Group
Open the required ports (e.g., 80/tcp, 8080/tcp) in the cloud console, obtain the public IP address, change the root password, and reboot the instance if this is the first login.
Install BT Panel (optional GUI)
Installation
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.shPress y to accept the default prompts.
Configure Firewall (firewalld)
# Check service status
systemctl status firewalld
# Start, restart, stop
service firewalld start
service firewalld restart
service firewalld stop
# List all rules
firewall-cmd --list-all
# Open port 80 permanently
firewall-cmd --zone=public --add-port=80/tcp --permanent
systemctl restart firewalld.serviceInstall JDK
Remove existing OpenJDK packages
rpm -qa | grep java
yum -y remove java-1.7.0-openjdk-1.7.0.141-2.6.10.5.el7.x86_64
yum -y remove java-1.8.0-openjdk-1.8.0.131-11.b12.el7.x86_64
# ... other versions ...Install downloaded JDK RPM
rpm -ivh jdk-11.0.8_linux-x64_bin.rpm
java -versionInstall Tomcat
tar -zxvf apache-tomcat-9.0.37.tar.gz
cd apache-tomcat-9.0.37
# Start Tomcat, e.g., ./bin/startup.shInstall Docker CE
Prepare environment
yum -y install gcc gcc-c++Remove previous Docker packages
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engineAdd Alibaba Cloud mirror repository and install Docker
yum -y install yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum -y install docker-ce docker-ce-cli containerd.ioStart Docker and verify
systemctl start docker
ps -ef | grep dockerSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
