LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-06-2008, 09:43 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
Encountered problem on enabling WebDAV with Apache2


Hi folks,


Ubuntu 7.04 server amd64
apache2 - 2.2.3
php5 - 5.2.1
libapache2-mod-php5 - 5.2.1


I was following;
Enable WebDAV with Apache 2.x on Ubuntu Linux
http://www.digital-arcanist.com/sanc...70427101250622

Already enabled "dav_fs" module with running "a2enmod"


Performed following steps;

$ su
password
# cd /etc/apache2/mods-enabled/

# ln -s ../mods-available/dav* .
Code:
ln: creating symbolic link `./dav_fs.conf' to `../mods-available/dav_fs.conf': File exists
ln: creating symbolic link `./dav_fs.load' to `../mods-available/dav_fs.load': File exists
ln: creating symbolic link `./dav.load' to `../mods-available/dav.load': File exists
ln: creating symbolic link `./dav_lock.load' to `../mods-available/dav_lock.load': Permission denied
ln: creating symbolic link `./dav_svn.conf' to `../mods-available/dav_svn.conf': File exists
ln: creating symbolic link `./dav_svn.load' to `../mods-available/dav_svn.load': File exists

# mkdir /usr/share/apache2/var
# touch /usr/share/apache2/var/DAVlock
# chown -R -c www-data:www-data /usr/share/apache2/var
Code:
changed ownership of `/usr/share/apache2/var/DAVlock' to www-data:www-data
changed ownership of `/usr/share/apache2/var' to www-data:www-data
# htpasswd -m -c /etc/apache2/.htpasswd
Code:
Usage:
        htpasswd [-cmdpsD] passwordfile username
        htpasswd -b[cmdpsD] passwordfile username password

        htpasswd -n[mdps] username
        htpasswd -nb[mdps] username password
 -c  Create a new file.
 -n  Don't update file; display results on stdout.
 -m  Force MD5 encryption of the password.
 -d  Force CRYPT encryption of the password (default).
 -p  Do not encrypt the password (plaintext).
 -s  Force SHA encryption of the password.
 -b  Use the password from the command line rather than prompting for it.
 -D  Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.

I was stuck here. According to "man htpasswd", there are 3 suggestions;

htpasswd /usr/local/etc/apache/.htpasswd-users jsmith

htpasswd -c /home/doe/public_html/.htpasswd jane

htpasswd -mb /usr/web/.htpasswd-all jones Pwd4Steve


Which of them I should follow? None of the above path exists. Please advise. TIA


B.R.
satimis
 
Old 01-07-2008, 07:03 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If you're talking strictly about the location of the password file then in theory it could be anywhere as long as you (can) reference it in your "AuthUserFile" statement. In practice it should be placed, since it contains passwords, outside the DOCROOT. (BTW a more appropriate thread title would have included the words "htpassword" and "location".)
 
Old 01-07-2008, 08:08 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by unSpawn View Post
If you're talking strictly about the location of the password file then in theory it could be anywhere as long as you (can) reference it in your "AuthUserFile" statement. In practice it should be placed, since it contains passwords, outside the DOCROOT. (BTW a more appropriate thread title would have included the words "htpassword" and "location".)
Hi unSpawn,


I solved my problem partially with following steps;


On Firefox;
Tools --> Add-ons --> Get-Extensions --> Search "bookmarks synchronizer"

found 2 items;
1)
Box.net Bookmarks Synchronizer

2)
Bookmark Sync and Sort
Code:
by rhaebuster .
Bookmark Sync and Sort is a Mozilla Firefox extension that lets you connect to an FTP/WebDAV server and synchronize your bookmarks that are stored in an XML file. Setup is easy; just write in your FTP/WebDAV server address, username, password and...

Installed "Bookmark Sync and Sort 1.0.7" and restarted Firefox


Continued;

# htpasswd -m -c /var/www/bookmarks/.htpasswd satimis
New password:
Re-type new password:
Adding password for user satimis


# mkdir /var/www/bookmarks
# chown -R -c www-data:www-data /var/www/bookmarks
Code:
changed ownership of `/var/www/bookmarks' to www-data:www-data

# ls /etc/apache2/
Code:
apache2.conf    envvars                  mods-available  
conf.d          httpd.conf               mods-enabled    sites-available
dav_svn.passwd  ports.conf      sites-enabled

Edited /etc/apache2/http.conf adding following lines on it;
Code:
## Location of the DavLock file
DavLockDB /usr/share/apache2/var/DavLock

## Set up the bookmarks directory to use WebDAV and authentication
<Directory "/var/www/bookmarks">
        Dav On
        AuthName "WebDAV Login"
        AuthType Basic
        AuthUserFile /var/www/bookmarks/.htpasswd
        ## Limit access for enhanced security
        <LimitExcept GET HEAD OPTIONS POST>
                require valid-user
        </LimitExcept>
        Order allow,deny
        Allow from all
</Directory>

# /etc/init.d/apache2 restart
Code:
 * Forcing reload of web server (apache2)...                                               [ OK ]

On the same PC login as satimis and start Firefox

1)
http://satimis.com/bookmarks/
Code:
Index of /bookmarks
[ICO]	Name	Last modified	Size	Description
[DIR]	Parent Directory	 	-
Apache/2.2.3 (Ubuntu) DAV/2 SVN/1.4.3 PHP/5.2.1 mod_ssl/2.2.3 OpenSSL/0.9.8c Server at satimis.com Port 80
No login page started.

2)
https://satimis.com/bookmarks/
Code:
Index of /bookmarks
[ICO]	Name	Last modified	Size	Description
[DIR]	Parent Directory	 	-
Apache/2.2.3 (Ubuntu) DAV/2 SVN/1.4.3 PHP/5.2.1 mod_ssl/2.2.3 OpenSSL/0.9.8c Server at satimis.com Port 443
Also no login page started


3)
http://test.webdav.org/dav/
Code:
Not Found

The requested URL /dav/ was not found on this server.

Advice would be appreciated. TIA


satimis
 
Old 01-07-2008, 08:44 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If "/var/www/bookmark" is not inside your DOCROOT (default is "/var/www/html" AFAIK) you need to add an alias before it. Else what do the access and error logs say? BTW, if the box is connected to the 'net then regardless of routing or firewall settings, using "Order allow,deny, Allow from all" for testing is nice but it's wrong. Better "allow from" your subnet or something.
 
Old 01-07-2008, 10:00 AM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by unSpawn View Post
If "/var/www/bookmark" is not inside your DOCROOT (default is "/var/www/html" AFAIK) you need to add an alias before it. Else what do the access and error logs say? BTW, if the box is connected to the 'net then regardless of routing or firewall settings, using "Order allow,deny, Allow from all" for testing is nice but it's wrong. Better "allow from" your subnet or something.
$ sudo find / -name html -type f
Password:
$ sudo find / -name public_html -type f
Both w/o printout

$ ls /var/www/
Code:
apache2-default  bookmarks  phpmyadmin  webalizer
$ tail /var/log/apache2/access.log
Code:
220.232.213.178 - - [07/Jan/2008:15:23:29 +0800] "POST /mail/src/redirect.php HTTP/1.1" 302 - "htt
ps://satimis.com/mail/src/login.php" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.11) Gecko
/20061201 Firefox/2.0.0.11 (Ubuntu-feisty)"
220.232.213.178 - - [07/Jan/2008:15:23:29 +0800] "GET /mail/src/webmail.php HTTP/1.1" 200 331 "htt
ps://satimis.com/mail/src/login.php" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.11) Gecko
/20061201 Firefox/2.0.0.11 (Ubuntu-feisty)"
220.232.213.178 - - [07/Jan/2008:15:23:29 +0800] "GET /mail/src/right_main.php HTTP/1.1" 200 9610 
"https://satimis.com/mail/src/webmail.php" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.11)
 Gecko/20061201 Firefox/2.0.0.11 (Ubuntu-feisty)"
220.232.213.178 - - [07/Jan/2008:15:23:29 +0800] "GET /mail/src/left_main.php HTTP/1.1" 200 2209 "
https://satimis.com/mail/src/webmail.php" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.11) 
Gecko/20061201 Firefox/2.0.0.11 (Ubuntu-feisty)"
220.232.213.178 - - [07/Jan/2008:15:23:29 +0800] "GET /mail/images/sort_none.png HTTP/1.1" 200 289
 "https://satimis.com/mail/src/right_main.php" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1
.11) Gecko/20061201 Firefox/2.0.0.11 (Ubuntu-feisty)"
220.232.213.178 - - [07/Jan/2008:15:26:49 +0800] "GET /mail/src/signout.php HTTP/1.1" 200 740 "htt
ps://satimis.com/mail/src/right_main.php" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.11) 
Gecko/20061201 Firefox/2.0.0.11 (Ubuntu-feisty)"
220.232.213.178 - - [07/Jan/2008:23:53:21 +0800] "GET /bookmarks/ HTTP/1.1" 200 753 "-" "Mozilla/5
.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.11) Gecko/20061201 Firefox/2.0.0.11 (Ubuntu-feisty)"
220.232.213.178 - - [07/Jan/2008:23:53:21 +0800] "GET /icons/blank.gif HTTP/1.1" 200 148 "http://s
atimis.com/bookmarks/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.11) Gecko/20061201 Fire
fox/2.0.0.11 (Ubuntu-feisty)"
220.232.213.178 - - [07/Jan/2008:23:53:21 +0800] "GET /icons/back.gif HTTP/1.1" 200 216 "http://sa
timis.com/bookmarks/" "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.11) Gecko/20061201 Firef
ox/2.0.0.11 (Ubuntu-feisty)"
220.232.213.178 - - [07/Jan/2008:23:53:22 +0800] "GET /favicon.ico HTTP/1.1" 404 340 "-" "Mozilla/
5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.11) Gecko/20061201 Firefox/2.0.0.11 (Ubuntu-feisty)"

$ tail /var/log/apache2/error.log
Code:
[Mon Jan 07 18:36:38 2008] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Mon Jan 07 18:36:38 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Mon Jan 07 18:36:40 2008] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Mon Jan 07 18:36:40 2008] [notice] Apache/2.2.3 (Ubuntu) DAV/2 SVN/1.4.3 PHP/5.2.1 mod_ssl/2.2.3 OpenSSL/0.9.8c configured -- resuming normal operations
[Mon Jan 07 18:52:24 2008] [notice] caught SIGTERM, shutting down
[Mon Jan 07 23:32:11 2008] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Mon Jan 07 23:32:11 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Mon Jan 07 23:32:13 2008] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
[Mon Jan 07 23:32:13 2008] [notice] Apache/2.2.3 (Ubuntu) DAV/2 SVN/1.4.3 PHP/5.2.1 mod_ssl/2.2.3 OpenSSL/0.9.8c configured -- resuming normal operations
[Mon Jan 07 23:53:22 2008] [error] [client 220.232.213.178] File does not exist: /var/www/favicon.ico

satimis
 
Old 01-09-2008, 01:50 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Docroot is a *directoryname*: grep -i ^docroot /etc/apache2/httpd.conf
 
Old 01-09-2008, 04:04 AM   #7
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by unSpawn View Post
Docroot is a *directoryname*: grep -i ^docroot /etc/apache2/httpd.conf
$ grep -i ^docroot /etc/apache2/httpd.conf
$ sudo grep -i ^docroot /etc/apache2/httpd.conf
Password:
Both w/o printout


I haven't created homepage yet. Apache2 is running. On visiting "satimis.com" it only displays;

Code:
Index of /
[ICO]	Name	Last modified	Size	Description
[DIR]	apache2-default/	21-Nov-2004 04:16 	-
[DIR]	bookmarks/	09-Jan-2008 09:53 	-
[DIR]	webalizer/	19-Dec-2007 22:26 	-
Apache/2.2.3 (Ubuntu) DAV/2 SVN/1.4.3 PHP/5.2.1 mod_ssl/2.2.3 OpenSSL/0.9.8c Server at satimis.com Port 80
satimis
 
Old 01-10-2008, 04:55 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Uh. I forgot. With DAV you could need to start by putting a copy of the files to be requested in the right folder, /var/www/bookmarks in your case, and *then* try. Maybe docroot was specified in another config in /etc/apache2/.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache2 add webdav after compile helpmhost Linux - Software 1 02-09-2007 02:28 PM
webdav from ie6 on w2k3 to apache2 Hamsjael Linux - Networking 3 12-13-2006 01:37 PM
Apache2 apache2-common WebDav timgerr Linux - Networking 1 08-25-2005 09:41 PM
Enabling SSI in Apache2.0 lawadm1 Linux - Software 1 08-11-2004 09:11 AM
First problem encountered... minotaur_6 Linux - Newbie 2 02-01-2004 05:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration