http作业

[复制链接]
发表于 2026-1-4 20:00:32 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
1.关闭防火墙
  1. [root@localhost ~]# systemctl stop firewalld   #关闭防火墙
  2. [root@localhost ~]# setenforce  0
复制代码
2.下载nginx包
  1. [root@localhost ~]# mount   /dev/sr0   /mnt #挂载目录
  2. [root@localhost ~]# yum install nginx  -y  #下载nginx包
复制代码
3.增长多条端口
  1. [root@localhost ~]# nmcli connection modify ens160  ipv4.method manual ipv4.addresses 192.168.92.10/24  ipv4.gateway 192.168.88.2 ipv4.dns 192.168.88.2  +ipv4.addresses 192.168.88.20/24  +ipv4.addresses 192.168.88.30/24  #当前主机添加多地址
复制代码
4.期货网卡
  1. [root@localhost ~]# nmcli connection up ens160 #激活网卡
复制代码
5.自界说nginx设置文件
  1. [root@localhost ~]# vim  /etc/nginx/conf.d/test_ip.conf  #自定义nginx配置文件
  2. server {
  3.         listen 192.168.88.10:80;
  4.         root /test/10;
  5.         location / {
  6.         index  index.html;
  7.         }
  8. }
  9. server {
  10.         listen 192.168.88.20:80;
  11.         root /test/20;
  12.         location / {
  13.             index  index.html;
  14.         }
  15. }
  16. server {
  17.         listen 192.168.88.30:80;
  18.         root /test/30;
  19.         location / {
  20.             index  index.html;
  21.         }
  22. }
复制代码
6.
  1. [root@localhost ~]# mkdir /test/{10,20,30} -pv
  2. mkdir: created directory '/test'
  3. mkdir: created directory '/test/10'
  4. mkdir: created directory '/test/20'
  5. mkdir: created directory '/test/30'
  6. [root@localhost ~]# echo this is 250 > /test/10/index.html
  7. [root@localhost ~]# echo this is 250 > /test/20/index.html
  8. [root@localhost ~]# echo this is 250 > /test/30/index.html
复制代码
7.测试

回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表