linux基礎四----sanba&&nginx
一 samba
1環境配置:
a.確保linux下防火墻關閉比或開放共享目錄權限 iPtables -F
b.確保setlinux關閉:setenforce 0
c.配置iP
2安裝軟件包:yum install samba -y
3修改配置文件:
路徑: /etc/samba/smb.conf
4 啟動服務
systemctl restart smb
5 測試
映射網絡驅動
\\服務端的ip\用戶名 --------》登錄到用戶的家目錄下
\\服務端的ip\public --------》登錄到共享目錄
step1 mkdir /share
掛著一塊空閑的硬盤到 /share
step2 vim /etc/samba/smb.conf
[public]
comment = Public Stuff
path = /share
public = yes
writable = no
printable = no
write list = alex,lili
step 3 systemctl restart smb
step 4 修改用戶權限
chmod 775 /share (只能瀏覽內容,不能刪)
step5 測試:
二 nginx
1 準備環境
=====>part1:
iptables -F
#systemctl disable firewalld #開機默認關閉
#systemctl stop firewalld #立即關閉
#systemctl status firewalld
setenforce 0
#/etc/sysconfig/selinux
#SELINUX=disabled
=====>part2:
配置ip
2.安裝ngnix
a.二進制安裝:
yum install epel-release -y
yum install nginx -y
b.源碼安裝:
3.修改配置文件:通過 nginx 實現靜態文件轉發、反向代理和負載均衡的配置
4.啟動服務
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
#/usr/local/nginx/sbin/nginx -s stop 關閉
#/usr/local/nginx/sbin/nginx -s reload 重新加載配置文件
linux基礎四----sanba&&nginx