сряда, август 12, 2009

Apache2+WebDAV on Debian

С apache-to и WebDAV-a лесна работа...
a2enmod dav_fs
a2enmod dav
a2enmod auth_digest
(ако digest ще се ползва за auth)
apache2ctl -k restart
Към vhost.cfg се добавя:
Alias /webdav /path/to/vhost/DocumentRoot
<Location /webdav> DAV On 
AuthType Digest
AuthName "webdav-auth"
AuthDigestFile /path/to/auth_file/.digest.passwd
Require valid-user
</Location>

или ако auth type ще е Basic :
<Location /webdav>
DAV On
AuthType Basic
AuthName "webdav-auth"
AuthDigestFile /path/to/auth_file/.basic.passwd
Require valid-user
< /Location>
apache2ctl -t
apache2ctl -k restart

С добавянето на users е малка греда... принципно се добавят така:
htdigest -c /path/to/auth_file/.digest.passwd webdav-auth webdav-user-name
htpasswd -c /path/to/auth_file/.basic.passwd webdav-user-name

Но пък после като тръгнат да установяват връзка сървъра не ми приема credentials, та решението е ако ще се вързват към webdav.server.com потребителите да се добавят така:
htdigest -c /path/to/auth_file/.digest.passwd webdav-auth webdav.server.com\\webdav-user-name
htpasswd -c /path/to/auth_file/.basic.passwd webdav.server.com\\webdav-user-name

И сме в играта...
 cadaver http://webdav.server.com/webdav
Authentication required for webdav on server `webdav.server.com':
Username: eol
Password:
dav:/webdav/>

Ама под Windows големият пръчкогриз... каквото и да му подаваш, какъвто и да е auth type все тая ... все ритник в метатарзисите...
В крайна сметка се оказа, че XP/2003 включително и с SP2 не разбират от Basic Authentication Method ... този reg file оправя работа
Малко (доста) по-късно намерих един sexy trick с който аз да наритам XP-то по крупата, а именно докато се добавя с Add  Network Place Wizard new location в полето connect to Internet or network address да се добави порта към който се закача webdav user-a сиреч: http://webdav.server.com/webdav:80 и слънцето свети, птичките пеят, а камилите решават диференциални уравнения наум
Следващото което трябва да се направи е интеграция на цялата тази дивотия с MS Active Directory ама за този клиент няма да я бъде... и без това това няма да разбере какво е това и с какво мезе върви


Reblog this post [with Zemanta]

3 коментара:

mister_sou каза...

Красивото заключение за слънцето, птичките, камилите и диференциалните уравнения ми хареса много, ще го използвам като цитат, авторско ли е? :)

Eol® каза...

be my guest

Eol® каза...

Windows XP includes the WebClient service that allows one to mount a Web Folder as a mapped network drive:

net use x: "http://server.com/folder" /User:UserName Password

Note to make the mapping permanent add the parameter /persistent:yes

Note Windows XP can only connect to port 80 and can only map to a sub folder and not the root directly.

If wanting to make a secure SSL mapping using the https protocol at port 443:

net use x: "\\server.com@ssl:443\folder" /User:UserName Password

net use x: "https://server.com/folder" /User:UserName Password

Note Windows XP only supports SSL / https connections when using My Network Places, but can be tricked into using SSL with net use by creating a forward server using stunnel. More Info Simple Groupware WebDAV.

Windows Vista can create a network drive without needing to dive into the command line:

1. Click on the Start menu and choose Computer.
2. Click the Map network drive button in the toolbar.
3. Select the drive-letter and enter the WebDAV location in the Folder using the http address.
4. Click the blue link "Connect using a different username" to specify a different user account and password, than the Windows user account.
5. Click Finish to create the new drive letter.

Note there is an update available for Windows XP/Vista for better support of WebDAV folders (Will be part of XP SP3 and Vista SP1). More Info MS KB 907306.

* The latest version of the Web Folders update (2.0) doesn't support Windows 98, Me or 2000. Instead one should use version 11.0.6715.15 Download Webfldrs-KB892211-ENU.exe.
* Windows Vista SP1 (and older) has a known bug where it cannot access sub-folder unless it has read-access to the parent folders. More Info MS KB942392

Note if using Windows 2000 or earlier, then one must use a 3rd party utility to map a WebDAV folder as a network drive.

Note MS Office (2000+) includes its own WebDAV client which supports file locking and SSL, but will only work when accessing files through the office applications (Excel, Word, etc.). More Info MS KB 838028

Note to setup a WebDAV server for the clients to connect to, then one can use IIS