Webdav與行事曆伺服器(1)—我的自家用伺服器U8NAS-Type2 (六)

webdav03.jpg

網頁伺服器除了能夠提供網頁瀏覽外,另外他也能夠提供如檔案伺服器(FTP)的功能,而這個功能就由 Webdav(Web-based Distributed Authoring)來擔當。而在U8T2搭載的Apache和Webmin就能夠很容易啟動和編輯這個功能。在Apache的模組裡,你先要將dav和dav_fs這幾個模組啟動,若想使用較安全的連線方式,那也要將ssl這個模組來啟動。
基本上在原先的虛擬伺服器上去設定就可以了,但你也可以另外再開設出另一個虛擬伺服器,在這裡建議你來安裝Webmin(目前版本為1.480),因為它已經將所有的設定檔都安排的好好的,不論要自己直接編改,或是利用其所安排的功能去勾選都很方便因此會讓工作更容易很多,你也可以藉此去調教出你想要的設定方式來工作。若要新增虛擬主機來運作,記得先在設定檔/etc/apache2 /port.conf內設定一個可以使用的連接埠來給新的虛擬伺服器來使用像是如下所示

NameVirtualHost *:9995
Listen 9995

而所有虛擬伺服器的設定檔都在/etc/apache2/site-available/…內,若你是由Webmin來新增虛擬伺服器,他會幫你新增一個像webmin.xxxxxxxxxx.conf這樣的設定檔或你所要的檔名。
而這個檔案內容會類似如下所示這樣(僅供參考)。
<VirtualHost *:9995>
DocumentRoot /opt/web1
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/https.pem
SSLCertificateKeyFile /etc/ssl/certs/https.pem
Alias /webdav "/opt/web1/dav"
<Directory "/opt/web1">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<Directory "/opt/web1/dav">
Dav on
AuthName "dav gate"
AuthType Basic
require valid-user
AuthUserFile /opt/web/passwd.dav
</Directory>
…….
</VirtualHost>
而對於所在的根目錄使用者和群組設定為給www-data,再來設定登入webdav伺服器的使用者設定檔(AuthUserFile)
請於終端機程式輸入(以管理員身分)
htpasswd -c /opt/web/passwd.dav username (請注意下次增加使用者時htpasswd -c 這個"-c"就不要了,否則會重寫,其他的使用者都會不見)。
若要利用安全連線(SSL),要在建立認證檔案,請於終端機程式輸入(以管理員身分)
openssl req -x509 -newkey rsa:1024 -keyout /etc/ssl/private/xxx.key.pem -out /etc/ssl/certs/xxx.crt.pem -nodes -days 365
就會出現如下列,然後請你一一填入相關資訊。
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:
若要測試下自己的webdav伺服器可否運作,你可以裝上命令列的DAV客端軟體cadaver,輸入如下。
wang@ub904d:~$ cadaver https://localhost:9999/webdav
WARNING: Untrusted server certificate presented for `ub904d’:
Certificate was issued to hostname `ub904d’ rather than `localhost’
This connection could have been intercepted.
Issued to: cstudio, Webmin Webserver on ub904d, xxx, 12345, tw
Issued by: cstudio, Webmin Webserver on ub904d, xxx, 12345, tw
Certificate is valid from Tue, 19 May 2009 09:25:13 GMT to Fri, 17 May 2019 09:25:13 GMT
Do you wish to accept the certificate? (y/n) y
Authentication required for dav gate on server `localhost’:
Username: wang
Password:
dav:/webdav/> ls
Listing collection `/webdav/’: succeeded.
Coll:   test                                   0   6月 17 15:31
dav:/webdav/> mkdir test001
Creating `test001′: succeeded.
dav:/webdav/> ls
Listing collection `/webdav/’: succeeded.
Coll:   test                                   0   6月 17 15:31
Coll:   test001                                0   6月 17 15:34
dav:/webdav/> quit
Connection to `localhost’ closed.

或許在過程中有錯誤,有可能是發生在其他的模組(dav_fs)的設定,請注意一下。
他的設定檔和所在為/etc/apache2/mods-available/dav_fs.conf
他的內容如下
DAVLockDB /var/lock/db/DAVLock
其中DAVLock是一個檔案,若成功時會自然出現,其實所在位置資料夾(/var/lock/db/…)你也可以自行設定,但在ubuntu 9.04好像沒有這個"db"資料夾,若依預設位置你可自行建立,其使用者為www-data,群組為root,這樣在試一次應該就可以了 (DAVLock就會出現)。
許多網友可利用WebDAV來修改網頁和傳輸檔案,也有讓他化身為行事曆伺服器,其實用它來成為多媒體伺服器也很好用。
在作為檔案傳輸和備份的客端工具,像是常用的超強檔案管理工具total commander加掛WebDAV的功能外掛就可以即刻升級他的功能。而他在操作上也極為方便就如一般FTP,他的功能鍵如下:
F7:    create new connection
F8/Del:    Delete connection
Enter    Connect
Alt+Enter Change options

webdav02.jpg
若要WebDAV伺服器成為你備份的伺服器,在客端軟體Super Flexible File Synchronizer就能支援這項的功能。

webdav06-1.jpg
而 Firefox瀏覽器在這時候當然也沒有缺席,這個多管閒事的超強瀏覽器,在這裡自然也會利用他強大的外掛程式再度增強他的威力,Web Folder(1.2)就會是一個不錯的選項。在Firefox的選單列的檔案–>open web folder就可開啟他的功能,然後會在選單列的末端出現他的功能選項。

webdav01.jpg

當利用WebDAV伺服器成為你的行事曆伺服器也相當的好用,而在客端的應用程式Mozilla Sunbird會是一個不錯的選擇。但你想要一架更為專職的行事曆伺服器,在Ubuntu的套件庫內也有幾架專業的行事曆伺服器來提供你的選擇和安裝如 davical和caldav,在未來的筆記也將記錄在部落格內。

cdav001.jpg

caldav005.jpg

webdav07.jpg

而在作業系統上,若你客端系統為Windows系統,你也可以將WebDAV新增一個網路位置到你的電腦內,就好像是新增一個FTP伺服器那般,這樣在未來使用上的存取也是相當的方便。但是無論Windows XP或是Windows Vista好像在新增Web Folder時多少都會有一些問題,而這時候你需要下載這個修正檔案Webfldrs-KB907306-CHT.exe(此為正體中文版)來修正你的問題,這個檔案可用在Windows XP和Windows Vista上,這樣你就可以將WebDAV伺服器上的目錄夾新增到你的電腦內了。而這個問題在目前的Windows 7 Build 7229好像還是存在!

webdav08.jpg

當我們存放在NAS上的多媒體檔案若是利用WebDAV伺服器來分享出來也是一個很方便和好用的方式,這樣又可將WebDAV伺服器升級成一架多媒體伺服器,由其若是使用Firefox來處理這些事務和媒體更是方便,尤其你是利用
FoxyTunes(音樂)和NetVideoHunter(影像)這兩個外掛程式的加持那更是方便。

webdav05.jpg

webdav04.jpg

附記:

上一篇貼文:給Windows Vista SP2的一些修改工具—也幫Windows Vista換換不一樣服裝(佈景主題)!!

張貼分享 :

Powered by Windows Live Writer

123

張貼於隨身儲存工具, 電腦, 軟體工具, Firefox, Firefox add-ons, Linux, Ubuntu, Windows
8 comments on “Webdav與行事曆伺服器(1)—我的自家用伺服器U8NAS-Type2 (六)
  1. […] Webdav與行事曆伺服器(1)—我的自家用伺服器U8NAS-Type2 (六) […]

  2. Hello to all, how is the whole thing, I think every one is
    getting more from this website, and your views are nice
    in support of new visitors.

  3. Anais 說道:

    Bon travail, Ce site a vraiment été une révélation pour moi.

    Est ce qu’il y a des forums que tu recommandes sur le sujet ?

  4. Good day! I just want to give an enormous thumbs up for the good data
    you’ve gotten here on this post. I can be coming back to your weblog for extra
    soon.

  5. Hey! I simply would like to give a huge thumbs up for the nice data you’ve right
    here on this post. I will likely be coming again to your weblog for more soon.

  6. I tend not to leave many remarks, however i did some
    searching and wound up here Webdav與行事曆伺服器(1)-我的自家用伺服器U8NAS-Type2
    (六) | 多多與我的部落格. And I do have 2 questions for you if you do not mind.
    Is it only me or does it look as if like a few of the
    remarks appear like they are written by brain dead individuals?
    😛 And, if you are writing at additional
    sites, I’d like to keep up with anything fresh you have to post. Could you list of every one of your community pages like your Facebook page, twitter feed, or linkedin profile?

  7. Whats up! I simply wish to give a huge thumbs up for the nice information you could have here on
    this post. I can be coming again to your blog
    for extra soon.

  8. 旅行社 說道:

    Hey! I simply wish to give an enormous thumbs up for the great information you may have right here on this post.
    I shall be coming back to your weblog for extra soon.

回覆給seoul seoul-t'ukpyolsi south korea 取消回覆

Last.fm

文章張貼日期
六月 2009
1234567
891011121314
15161718192021
22232425262728
2930  
分類標籤
各期張貼數