日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

Linux基础系列:常用命令(5)_samba服务与nginx服务

發布時間:2023/12/10 linux 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Linux基础系列:常用命令(5)_samba服务与nginx服务 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

?

作業一:部署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

????????? #SELINUX=disabled

?????????????? ====》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 [root@www nginx]# vim conf/nginx.conf 2 3 [root@www nginx]# vim conf/nginx.conf 4 5 [root@www nginx]# mkdir -p /webserver/server1 6 7 [root@www nginx]# mkdir -p /webserver/server2 8 9 [root@www nginx]# mkdir -p /webserver/server3 10 11 [root@www nginx]# echo 'server1' > /webserver/server1/index.html 12 13 [root@www nginx]# echo 'server2' > /webserver/server2/index.html 14 15 [root@www nginx]# echo 'server3' > /webserver/server3/index.html 16 17 [root@www nginx]# mkdir /webserver/nginx_conf 18 19 [root@www nginx]# cp /usr/local/nginx/conf/nginx.conf /webserver/nginx_conf/web1.conf 20 21 [root@www nginx]# cp /usr/local/nginx/conf/nginx.conf /webserver/nginx_conf/web2.conf 22 23 [root@www nginx]# cp /usr/local/nginx/conf/nginx.conf /webserver/nginx_conf/web3.conf 24 25 [root@www nginx]# cd /webserver/nginx_conf/ 26 27 [root@www nginx_conf]# vim web1.conf 28 29 [root@www nginx_conf]# vim web2.conf 30 31 [root@www nginx_conf]# vim web3.conf

2、修改conf文件,以web1.conf為例

?  

?  

3、配置lb服務

?  

  

  

  

4、重啟服務:

1 [root@www nginx_conf]# pkill -9 nginx 2 3 [root@www nginx_conf]# /usr/local/nginx/sbin/nginx -c /webserver/nginx_conf/lb.conf 4 5 [root@www nginx_conf]# /usr/local/nginx/sbin/nginx -c /webserver/nginx_conf/web3.conf 6 7 [root@www nginx_conf]# /usr/local/nginx/sbin/nginx -c /webserver/nginx_conf/web2.conf 8 9 [root@www 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

總結

以上是生活随笔為你收集整理的Linux基础系列:常用命令(5)_samba服务与nginx服务的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。