Ubuntu use overview

check ip address

c 复制代码
ip a
ls /etc/netplan/
sudo nano /etc/netplan/01-netcfg.yaml

Configure the Static IP

c 复制代码
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: no
      addresses:
        - 192.168.1.100/24
      gateway4: 192.168.1.1
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4

Apply the Configuration

c 复制代码
sudo netplan apply

check

ip a

Ubuntu config apt mirror on China

c 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
vim /etc/apt/sources.list

replace to mirrors.tuna.tsinghua.edu.cn

tls install

c 复制代码
sudo apt update
sudo apt install openssl
sudo apt install nginx
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx
openssl genpkey -algorithm RSA -out server.key -pkeyopt rsa_keygen_bits:2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
vim /etc/nginx/sites-available/default
server {
    listen 443 ssl;
    server_name your_domain.com;

    ssl_certificate /path/to/server.crt;
    ssl_certificate_key /path/to/server.key;

    # Other configurations...
}
sudo nginx -t
sudo systemctl reload nginx
相关推荐
少妇的美梦10 小时前
logstash教程
运维
chen94511 小时前
k8s集群部署vector日志采集器
运维
chen94511 小时前
aws ec2部署harbor,使用s3存储
运维
轻松Ai享生活15 小时前
5 节课深入学习Linux Cgroups
linux
christine-rr16 小时前
linux常用命令(4)——压缩命令
linux·服务器·redis
三坛海会大神55516 小时前
LVS与Keepalived详解(二)LVS负载均衡实现实操
linux·负载均衡·lvs
東雪蓮☆16 小时前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
qq_2642208916 小时前
LVS负载均衡群集和LVS+Keepalived群集
运维·负载均衡·lvs
乌萨奇也要立志学C++16 小时前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
雨落Liy16 小时前
Nginx 从入门到进阶:反向代理、负载均衡与高性能实战指南
运维·nginx·负载均衡