在Ubuntu系统部署nginx

切换到root用户下
sudo -i
sudo su -
查看ip
ip a
网卡地址路径
vi /etc/netplan/50-cloud-init.yaml
查询网关
ip route
重新加载
netplan apply
更新
apt-get update
删除软件包
apt-get remove
apt-get purge
下载软件包
apt-get install
清理软件包
apt-get clean
查看操作系统
cat /etc/os-release

 配置静态IP

vi /etc/netplan/50-cloud-init.yaml
network:
    ethernets:
        ens33:
            dhcp4: false
            addresses: [192.168.93.130/24]
            routes:
              - to: default
                via: 192.168.93.2
            nameservers:
              addresses: [114.114.114.114]
    version: 2
保存退出
netplan apply        #重新刷新一下
vi /etc/apt/sources.list
    deb https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
    
    deb https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
    
    deb https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
    
    # deb https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
    # deb-src https://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
    
    deb https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
    
apt update
apt -y install  nginx
nginx

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值