Installed SSL/TLS server Private key & Certificate.
Disabled SELinux.
Allowed Firewall.
Enviroment
1 2 3 4 5 6 7
[root@rhel8 ~]# cat /etc/redhat-release Red Hat Enterprise Linux release 8.5 (Ootpa) [root@rhel8 ~]# httpd -v Server version: Apache/2.4.37 (Red Hat Enterprise Linux) Server built: Oct 26 2021 14:18:06 [root@rhel8 ~]# smbstatus --version Version 4.14.5
# create new <IfModule mod_dav_fs.c> DAVLockDB /var/lib/dav/lockdb </IfModule> Alias /share /share <Location /share> DAV On SSLRequireSSL Options None AuthType Basic AuthName WebDAV AuthUserFile /etc/httpd/conf/.htpasswd <RequireAny> Require method GET POST OPTIONS Require valid-user </RequireAny> </Location>
Create WebDAV User
Note: This user is not your operating system’s user.
1 2 3 4
htpasswd -c /etc/httpd/conf/.htpasswd <InputYourUserName> New password: <InputYourPassword> Re-type new password: <InputYourPassword> Adding password for user <HereIsYourUserName>
(Optional) Edit Apache run user
It doesn’t work.
1 2 3 4 5 6 7
vim /etc/httpd/conf/httpd.conf
69 #User apache 70 #Group apache 71 User cjl 72 Group cjl
Start Apache
1
systemctl enable --now httpd
(Optional) Configure SMB
When we want SMB to coexist with WebDAV.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
vim /etc/samba/smb.conf
[global] workgroup = WORKGROUP security=user map to guest =Bad User
#添加名为share的共享文件夹 [share] comment = share all path = /share browseable = yes public = yes writable = yes create mode = 0744 force create mode = 0744 directory mode = 0744 force directory mode = 0744 force user = apache
1
systemctl restart smb
WebDAV Client
Windows11
1
net use W: https://192.168.64.84:10443/share /user:cjh Passw0rd