Huawei Cloud ECS Ubuntu18 Practice

Modify the Ubuntu source

apt-get update

get the error info as following:

buntu.com:80 (91.189.88.152), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out Could not connect to security.ubuntu.com:80 (91.189.88.142), connection timed out

Look at the Huawei Cloud Portal

mv /etc/apt/sources.list /etc/apt/sources.list.bak
wget -O /etc/apt/sources.list http://mirrors.myhuaweicloud.com/repo/sources.list.bionic
apt-get update

It works now.

Server Configuration

  • Security Group
    Modify the security group, change 3389 to 80 and add 443 for SSL connection
  • SSH Transfer too slow
vi /etc/ssh/sshd_config

uncomment UseDNS: no
restart SSH:service sshd restart

  • Connect too slow
    Open ICMP in at the Security Group

Install and configure Nginx

apt-get install nginx
systemctl start nginx
systemctl enable nginx

And you can access the nginx default html now.

vi /etc/nginx/nginx.conf

uncomment the gzip option to accelerate the website download speed

vi /etc/nginx/conf.d/default.conf
service nginx reload

Install JDK8

wget https://mirrors.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz
tar -xzvf jdk-8u202-linux-x64.tar.gz
vi ~/.bashrc
export JAVA_HOME=/java/jdk1.8.0_202
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export PATH=${JAVA_HOME}/bin:$PATH 

here, JAVA_HOMEis the jdk unzip path

source ~/.bashrc

system register

update-alternatives --install /usr/bin/java java /java/jdk1.8.0_202/bin/java 300
java -version

ok

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章