网站建设好的图片,企业网站模板下载需谨慎半数留有后门,化工材料 技术支持 东莞网站建设,叶县建设局网站作业一#xff1a;部署samba 每个用户有自己的目录#xff0c;可以浏览内容#xff0c;也可以删除 所有的用户共享一个目录#xff0c;只能浏览内容#xff0c;不能删 安装samba服务 1、准备环境 setenforce 0 2、安装软件包 yum -y install samba 3、修改配置文件 /etc/s… 作业一部署samba 每个用户有自己的目录可以浏览内容也可以删除 所有的用户共享一个目录只能浏览内容不能删 安装samba服务 1、准备环境 setenforce 0 2、安装软件包 yum -y install samba 3、修改配置文件 /etc/samba/smb.conbf #先建立共享目录 mkdir /share 4、启动服务 systemctl start smb 5、测试 samba用户必须是系统用户登录类型为/sbin/nologin不可登录型 作业二nginx服务 二进制安装nginx包作为web服务修改配置文件 让配置生效验证配置 1、准备环境 iptables –F 临时清除防火墙 systemctl stop firewalld systemctl disable firewalld 关闭开机自启 setenforce 0 /etc/sysconfig/selinux #SELINUXdisabled 》part2配置ip arping ip地址 ping通时返回ip地址 2、安装软件包 二进制方式安装 yum install epel-release -y yum install nginx -y 源码安装 yum –y install gcc-* yum –y install glibc-* yum –y install pcre -y # ./configure --prefix/usr/local/nginx --with-pcre/usr/lib64 ./configure --prefix/usr/local/nginx --with-http_rewrite_module make make install 安装完成后 3、修改配置文件 vim /usr/local/nginx/conf/nginx.conf #user nobody; worker_processes 3; 4、启动服务 /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf ps aux | grep nginx #/usr/local/nginx/sbin/nginx -s stop 关闭 #/usr/local/nginx/sbin/nginx -s reload 重新加载配置文件 补充 状态码 200 访问成功 3开头重定向 4开头客户端的问题 5开头服务端的问题 5 测试 作业三nginx反向代理三台web 1、模拟三台web服务 1 [rootwww nginx]# vim conf/nginx.conf2 3 [rootwww nginx]# vim conf/nginx.conf4 5 [rootwww nginx]# mkdir -p /webserver/server16 7 [rootwww nginx]# mkdir -p /webserver/server28 9 [rootwww nginx]# mkdir -p /webserver/server3
10
11 [rootwww nginx]# echo server1 /webserver/server1/index.html
12
13 [rootwww nginx]# echo server2 /webserver/server2/index.html
14
15 [rootwww nginx]# echo server3 /webserver/server3/index.html
16
17 [rootwww nginx]# mkdir /webserver/nginx_conf
18
19 [rootwww nginx]# cp /usr/local/nginx/conf/nginx.conf /webserver/nginx_conf/web1.conf
20
21 [rootwww nginx]# cp /usr/local/nginx/conf/nginx.conf /webserver/nginx_conf/web2.conf
22
23 [rootwww nginx]# cp /usr/local/nginx/conf/nginx.conf /webserver/nginx_conf/web3.conf
24
25 [rootwww nginx]# cd /webserver/nginx_conf/
26
27 [rootwww nginx_conf]# vim web1.conf
28
29 [rootwww nginx_conf]# vim web2.conf
30
31 [rootwww nginx_conf]# vim web3.conf 2、修改conf文件以web1.conf为例 3、配置lb服务 4、重启服务 1 [rootwww nginx_conf]# pkill -9 nginx
2
3 [rootwww nginx_conf]# /usr/local/nginx/sbin/nginx -c /webserver/nginx_conf/lb.conf
4
5 [rootwww nginx_conf]# /usr/local/nginx/sbin/nginx -c /webserver/nginx_conf/web3.conf
6
7 [rootwww nginx_conf]# /usr/local/nginx/sbin/nginx -c /webserver/nginx_conf/web2.conf
8
9 [rootwww nginx_conf]# /usr/local/nginx/sbin/nginx -c /webserver/nginx_conf/web1.conf 实现基于轮询的方式调度三台web并验证结果 实现基于权重的方式调度三台web并验证结果 结果 实现基于hash的方式调用三台web并验证结果 结果 转载于:https://www.cnblogs.com/hedeyong/p/6926460.html