Python學習day9--linux基礎(六)

來源:互聯網
上載者:User

標籤:samba服務   pytho   ima   加密   zlib   usr   vim   測試   預設   

今天我們來看一下Samba服務和nginx服務。

Samba服務

1.samba的功能

   samba是一個網路伺服器,用於Linux和Windows之間共用檔案。

2.samba服務的啟動、停止、重啟
   啟動:systemctl  start smb

   停止:systemctl  stop smb

   重啟:systemctl  restart smb

3. samba的主設定檔為:/etc/samba/smb.conf

4.配置samba服務

 ①準備環境
    =====>part1:
    iptables -F #清除預設表filter中所有規則鏈中的規則
    #systemctl disable firewalld #開機預設關閉

    #systemctl enable firewalld #設定開機啟動

    #systemctl start firewalld #開啟服務
    #systemctl stop firewalld  #立即關閉
    #systemctl status firewalld #查看防火牆狀態
        
    setenforce 0 #關閉selinux防火牆    (setenforce是Linux的selinux防火牆配置命令 )
    #/etc/sysconfig/selinux  (/etc/sysconfig/selinux 是?啟?動?或?中?止 SELinux 的?主?要?配?置?文?件)
    #SELINUX=disabled
    =====>part2:    
    配置ip

   ifconfig #查看已經啟用的網卡

   永久修改網卡的配置資訊:

          vim /etc/sysconfig/network-scripts/ifcfg-網卡名


   重啟網路服務:service network restart

   跨子網通訊要走網關

          route add default gw 192.168.16.254 dev 網卡名(添加網關並指定網卡)

 
②安裝軟體包
yum install samba -y
③修改設定檔
/etc/samba/smb.conf
        [public]
        comment = Public Stuff
        path = /share
        public = yes
        writable = no
        printable = no
        write list = alex,lili
④啟動服務
systemctl restart smb

⑤測試
映射網路驅動
\\服務端的ip\使用者名稱 --------》登入到使用者的家目錄下
\\服務端的ip\public --------》登入到共用目錄

補充
net use #查看
net use * /del #清除

 

nginx服務

源碼安裝:

yum install gcc-* glibc-* openssl openssl-devel pcre pcre-devel zlib zlib-devel -y
ls
tar xvf nginx-1.10.3.tar.gz
cd nginx-1.10.3
ls
./configure
./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module
make
make install

 

說明:

pcre: 用來作地址修正的功能。

zlib:nginx 的gzip模組,傳輸資料打包,省流量(但消耗資源)。

openssl:提供ssl加密協議。

安裝:http://www.cnblogs.com/crazyacking/p/5138146.html

相關參數:http://blog.csdn.net/xifeijian/article/details/20956605

location:http://www.tuicool.com/articles/Jr63qy

正向 Proxy,反向 Proxy,透明代理:http://blog.csdn.net/u012572955/article/details/49357219

LB:http://nginx.org/en/docs/http/load_balancing.html

 

Python學習day9--linux基礎(六)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.