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