Installing WebDAV server

B

becky_lewis

It's only for experimenting with calendar software, so authorization is not
a point.
So I forget about MySQL.













Possibly.
I tried this:
server.py -n -c config.ini
Once again, the server is up and running and when I am logging in with my
browser (10.0.0.140:8081) I can see information showing up at the command
prompt, showing somebody is logging is, but the same error:
"fshandler:get_data: \Webdav not found". During starting up the server
mentioned: "pywebdav:Serving data from \Webdav".

In the config file it says:
"# main directory
directory = \Webdav"

Perhaps my Python configuration is at fault.

Fokke

Is the path supposed to be absolute? In which case you'd need to have:
directory=C:\path\to\Webdav

instead of just
directory=\Webdav


Becky Lewis
 
P

python

Hi Fokke,

Disclaimer: I have no experience with the Python WebDAV package you're
using.

But a thought:
In the config file it says:
"# main directory
directory = \Webdav"

Perhaps you should qualify your directory path with a drive letter?

I would try this 2 ways:

directory = E:\Webdav

And if that doesn't work:

directory = E:/Webdav

My thinking about the 2nd example is that perhaps the \W is getting
interpreted as a control character vs. "backslash" "W".

Malcolm
 
F

Fokke Nauta

Dennis Lee Bieber said:
I think that's the line that should have your e:/wwwroot
specification
--

Sorry!
It used to have.
But as it did not work, with the same error message, it could not find
E:\wwwroot, I changed it into \Webdav.
Ofcourse, in the command line as well. Later on I left the D specification
out in the command line.
Perhaps another drive letter might cause the problem, so in this case I kept
it on the same partition. But I still got the same error.

Fokke
 
F

Fokke Nauta

It's only for experimenting with calendar software, so authorization is
not
a point.
So I forget about MySQL.


Possibly.
I tried this:
server.py -n -c config.ini
Once again, the server is up and running and when I am logging in with my
browser (10.0.0.140:8081) I can see information showing up at the command
prompt, showing somebody is logging is, but the same error:
"fshandler:get_data: \Webdav not found". During starting up the server
mentioned: "pywebdav:Serving data from \Webdav".

In the config file it says:
"# main directory
directory = \Webdav"

Perhaps my Python configuration is at fault.

Fokke

Is the path supposed to be absolute? In which case you'd need to have:
directory=C:\path\to\Webdav

instead of just
directory=\Webdav

I tried:
directory=D:\Webdav
directory=D:/Webdav

To no avail.
It didn.t make any difference.

I surely believe my WebDAV installation is at fault.

Fokke
 
F

Fokke Nauta

Hi Fokke,

Disclaimer: I have no experience with the Python WebDAV package you're
using.

But a thought:


Perhaps you should qualify your directory path with a drive letter?

I would try this 2 ways:

directory = E:\Webdav

And if that doesn't work:

directory = E:/Webdav

My thinking about the 2nd example is that perhaps the \W is getting
interpreted as a control character vs. "backslash" "W".

I tried:
directory=D:\Webdav
directory=D:/Webdav

To no avail.
It didn't make any difference.

I surely believe my WebDAV installation is at fault.

And D: is the same partition as where Python is, D:\Python27

Fokke
 
T

Thomas 'PointedEars' Lahn

Fokke said:
"Thomas 'PointedEars' Lahn" […]:
Fokke said:
"Thomas 'PointedEars' Lahn" […] wrote:
The Python shell executes Python code. The above obviously is not
Python
code, but *system* shell commands. So let the *system* command shell
execute them (as indicated by the `$' prompt, which is customary for a
sh-based UNIX/Linux shell prompt).
I know. I worked with SCO Unix and various sorts of Linux.
But never with Python, so I hadn't got a clue about the prompt.
Come on, with that experience you see a `$' and those commands and don't
realize it is (ba)sh?

Ofcourse I realized it was Unix/Linux. I already could tell that as the
packages I downloaded were tar.gz files.

For *Windows*?
So I unpacked them and expected to run a Python installer script from the
Python command line.

Again, given all that experience you claim to have, how come it did not
occur to you that the `$' was meant to be a *command* *shell* prompt? Other
OSes have command shells, too, you know; they are just named and run
differently.
Tried to run the Python installer script from the DOS command line but
that resulted in an error.

"There was an error" is no error report at all.
What do you mean by STFW?

Search The F****ing Web.
I wasn't aware that easy_install was a utility. Downloaded and installed
the Windows version and run easy_install pywebdav.
It downloaded something, installed something and finished something.
But, once again, don't know how to proceed.
RTFM.


It's my own server and I didn't write a manual for it.

No, the people providing it for you obviously did, but you do not seem to
care to read it.
In the manual of Easy_install it says how to install packaged etc and I
did sucessfully.
There is no furter information as how to proceed.

Either you are lying, or you are really forgetful, or you are simply not
smart enough for this. You yourself told me/us before what the next step
is:
I did and it worked. What's next?

Start the now-installed server, for goodness' sake!

Observing this, be reminded that playing stupid does not work with me:

<http://catb.org/~esr/faqs/smart-questions.html>

And please get rid of that attribution novel and trim your quotes to the
relevant minimum. I am asking you the last time here. If you cannot find
it within you to think about your readers when you post, you are not worth
my attention or (free) time.
 
F

Fokke Nauta

<cut>

If you don't have anything better to contribute, please stop answering.

Es genügt schon.

Fokke
 
T

Thomas 'PointedEars' Lahn

Fokke said:
<cut>

If you don't have anything better to contribute, please stop answering.

Es gen�gt schon.

I should have expected as much from an address munger.

*plonk*
 
B

becky_lewis

Is the path supposed to be absolute? In which case you'd need to have:
directory=C:\path\to\Webdav

instead of just
directory=\Webdav

I tried:
directory=D:\Webdav
directory=D:/Webdav

To no avail.
It didn.t make any difference.

I surely believe my WebDAV installation is at fault.

Fokke

Interestingly, looking at the code that returns the
"fshandler:get_data: \Webdav not found" message, it looks like it
tests that the path given exists and then tries an os.path.isfile,
then an os.path.isdir. If both fail you get the message that you see.
This might be a bit of a shot in the dark but could you try the path
with and without a trailing '/' or '\'? I don't currently have a
windows box available to test on and figure out why it would be
detected as existing but not test true for either a file or directory.

Becky Lewis
 
F

Fokke Nauta

becky_lewis said:
Interestingly, looking at the code that returns the
"fshandler:get_data: \Webdav not found" message, it looks like it
tests that the path given exists and then tries an os.path.isfile,
then an os.path.isdir. If both fail you get the message that you see.
This might be a bit of a shot in the dark but could you try the path
with and without a trailing '/' or '\'? I don't currently have a
windows box available to test on and figure out why it would be
detected as existing but not test true for either a file or directory.

Hi Becky,

I tried it straight away:
directory=D:\Webdav\
directory=D:/Webdav/

Didn't work, in both cases the same error "fshandler:get_data: \Webdav not
found".

I have the opinion that my WebDAV installation is at fault. The database is
not created either.
To have set up Python, I used python-2.7.2.msi.
To install WebDAV, I used PyWebDAV-0.9.4.1 and PyXML-0.8.4 packages, both
Unix/Linux.
To install the, I used
"
Shall I reïnstall the whole lot? Would it make a difference if in that case
I would use ActivePython-2.7.2.5-win32-x86.msi instead of python-2.7.2.msi?

Fokke
 
B

becky_lewis

Hi Becky,

I tried it straight away:
directory=D:\Webdav\
directory=D:/Webdav/

Didn't work, in both cases the same error "fshandler:get_data: \Webdav not
found".

I have the opinion that my WebDAV installation is at fault. The database is
not created either.
To have set up Python, I used python-2.7.2.msi.
To install WebDAV, I used PyWebDAV-0.9.4.1 and PyXML-0.8.4 packages, both
Unix/Linux.
To install the, I used
"


Shall I reïnstall the whole lot? Would it make a difference if in that case
I would use ActivePython-2.7.2.5-win32-x86.msi instead of python-2.7.2.msi?

Fokke

You could try that but I'd imagine you'll end up with the same issue.
My best guess is that something is preventing os.path.isdir from
detecting the path as a directory under windows. I can't reproduce it
on my Linux system but may have a working windows installation later.
If I were you I'd fire up a python shell (execute python and get theto try and find out what the actualy problem is.
 
F

Fokke Nauta

Hi Becky,

I tried it straight away:
directory=D:\Webdav\
directory=D:/Webdav/

Didn't work, in both cases the same error "fshandler:get_data: \Webdav not
found".

I have the opinion that my WebDAV installation is at fault. The database
is
not created either.
To have set up Python, I used python-2.7.2.msi.
To install WebDAV, I used PyWebDAV-0.9.4.1 and PyXML-0.8.4 packages, both
Unix/Linux.
To install the, I used
"


Shall I reïnstall the whole lot? Would it make a difference if in that
case
I would use ActivePython-2.7.2.5-win32-x86.msi instead of
python-2.7.2.msi?

Fokke

You could try that but I'd imagine you'll end up with the same issue.
My best guess is that something is preventing os.path.isdir from
detecting the path as a directory under windows. I can't reproduce it
on my Linux system but may have a working windows installation later.
If I were you I'd fire up a python shell (execute python and get theto try and find out what the actualy problem is.

I'm not familiar with Python, but I entered "import os.path " (nothing
happened) and "os.path.isdir(path_name)
" in the shell. I guess what I did was not correct.
Underneath I copied what showed up in the shell.

-------------------------------------------
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on
win32
Type "copyright", "credits" or "license()" for more information.
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
os.path.isdir(path_name)
NameError: name 'path_name' is not defined
 
D

Dennis Lee Bieber

-------------------------------------------
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on
win32
Type "copyright", "credits" or "license()" for more information.
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
os.path.isdir(path_name)
NameError: name 'path_name' is not defined
"path_name" is a placeholder -- you're supposed to put in the exact
string(s) you have been trying in the configuration file (wrap the
string in quotes).
Traceback ( File "<interactive input>", line 1
os.path.isdir("e:\webdav\")
^
SyntaxError: EOL while scanning single-quoted string
Note that Python itself (and the C-runtime) doesn't care if the
separator is \ or / or even mixed; it is just the Windows command line
that uses \ for separator and / for options. (Python, however, uses \ as
an escape and \" is treated first, hence the need for \\" to escape the
\ itself)
 
F

Fokke Nauta

Dennis Lee Bieber said:
-------------------------------------------
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
on
win32
Type "copyright", "credits" or "license()" for more information.
import os.path
os.path.isdir(path_name)

Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
os.path.isdir(path_name)
NameError: name 'path_name' is not defined
"path_name" is a placeholder -- you're supposed to put in the exact
string(s) you have been trying in the configuration file (wrap the
string in quotes).
Traceback ( File "<interactive input>", line 1
os.path.isdir("e:\webdav\")
^
SyntaxError: EOL while scanning single-quoted string
Note that Python itself (and the C-runtime) doesn't care if the
separator is \ or / or even mixed; it is just the Windows command line
that uses \ for separator and / for options. (Python, however, uses \ as
an escape and \" is treated first, hence the need for \\" to escape the
\ itself)

Thanks, this is clear.

This is my Python shell:

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on
win32
Type "copyright", "credits" or "license()" for more information.
So Python recognizes the directory d:\webdav

This is the command shell:

D:\Python27\WebDAV\PyWebDAV\DAVServer>server.py -n -c config.ini

INFO:pywebdav:Starting up PyWebDAV server <version 0.9.4-dev>
INFO:pywebdav:chunked_http_response feature ON
INFO:pywebdav:http_request_use_iterator feature OFF
INFO:pywebdav :http_response_use_iterator feature OFF
INFO:fshandler:Initialized with D:/Webdav-http://10.0.0.140:8081/
WARNING:pywebdav:Authentication disabled!
INFO:pywebdav:Serving data from D:/Webdav
Listening on 10.0.0.140 <8081>

(here I try to login the WebDAV server with the local IE browser)

INFO:fshandler :get_data: D:\Webdav not found
server - - [06/Sep/2011 21:05:35] - Mozilla/4.0 (compatible; MSIE 8.0;
Windows N
T 5.1; Trident/4.0> - "GET / HTTP/1.1" 404 -
server - - [06/Sep/2011 21:05:35] - Mozilla/4.0 (compatible; MSIE 8.0;
Windows N
T 5.1; Trident/4.0> - "GET / HTTP/1.1" 404 -

So - I'm a bit lost now. Thinking seriously that my webdav installation is
at fault.

Fokke
 
D

Dennis Lee Bieber

This is my Python shell:

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on
win32
Type "copyright", "credits" or "license()" for more information.
So Python recognizes the directory d:\webdav

This is the command shell:

D:\Python27\WebDAV\PyWebDAV\DAVServer>server.py -n -c config.ini

INFO:pywebdav:Starting up PyWebDAV server <version 0.9.4-dev>
INFO:pywebdav:chunked_http_response feature ON
INFO:pywebdav:http_request_use_iterator feature OFF
INFO:pywebdav :http_response_use_iterator feature OFF
INFO:fshandler:Initialized with D:/Webdav-http://10.0.0.140:8081/
WARNING:pywebdav:Authentication disabled!
INFO:pywebdav:Serving data from D:/Webdav
Listening on 10.0.0.140 <8081>

(here I try to login the WebDAV server with the local IE browser)

INFO:fshandler :get_data: D:\Webdav not found

At this point my best suggestion is to study the source code of
fshandler to see what it is doing at this moment in time (offhand, is
there any content IN the directory to be "served"?)
server - - [06/Sep/2011 21:05:35] - Mozilla/4.0 (compatible; MSIE 8.0;
Windows N
T 5.1; Trident/4.0> - "GET / HTTP/1.1" 404 -
server - - [06/Sep/2011 21:05:35] - Mozilla/4.0 (compatible; MSIE 8.0;
Windows N
T 5.1; Trident/4.0> - "GET / HTTP/1.1" 404 -
That almost looks like something is trying to retrieve a default
page for 404 (not found) page.

To save you some time:

-=-=-=-
if os.path.exists(path):
if os.path.isfile(path):
file_size = os.path.getsize(path)
if range == None:
## REST SNIPPED
else:
# also raise an error for collections
# don't know what should happen then..
log.info('get_data: %s not found' % path)

Note that at this point in the system, it is looking for a FILE, not
a directory.
 
F

Fokke Nauta

Dennis Lee Bieber said:
On Tue, 6 Sep 2011 21:26:12 +0200, "Fokke Nauta"
<[email protected]> declaimed the following in
gmane.comp.python.general:



At this point my best suggestion is to study the source code of
fshandler to see what it is doing at this moment in time (offhand, is
there any content IN the directory to be "served"?)

There is a file indeed, in d:\Webdav
server - - [06/Sep/2011 21:05:35] - Mozilla/4.0 (compatible; MSIE 8.0;
Windows N
T 5.1; Trident/4.0> - "GET / HTTP/1.1" 404 -
server - - [06/Sep/2011 21:05:35] - Mozilla/4.0 (compatible; MSIE 8.0;
Windows N
T 5.1; Trident/4.0> - "GET / HTTP/1.1" 404 -
That almost looks like something is trying to retrieve a default
page for 404 (not found) page.

To save you some time:

-=-=-=-
if os.path.exists(path):
if os.path.isfile(path):
file_size = os.path.getsize(path)
if range == None:
## REST SNIPPED
else:
# also raise an error for collections
# don't know what should happen then..
log.info('get_data: %s not found' % path)

I have seen this part. Do I need to alter it?
Note that at this point in the system, it is looking for a FILE, not
a directory.
--

I have re-installed Python and the setuptool, and tried the Python version
of Active, but it did not make a difference.
So now I use the "old" Python 2.7 again. Used easy_install to install
PyWebDAV. I now run davserver.exe from the Script directory. Still the same
problem.
What I found, however, was that if I specify the directory from the command
line (like davserver -D d:\Webdav -n) there is no error message as
"INFO:fshandler :get_data: D:\Webdav not found". The browser shows still the
404 error.
The error "INFO:fshandler :get_data: D:\Webdav not found" only occurs when I
specify the "-c config.ini" in the command line.

I didn't expect it to be this so tricky. It looked easy to set up an
experimental webdav server.

Fokke
 
B

becky_lewis

I have re-installed Python and the setuptool, and tried the Python version
of Active, but it did not make a difference.
So now I use the "old" Python 2.7 again. Used easy_install to install
PyWebDAV. I now run davserver.exe from the Script directory. Still the same
problem.
What I found, however, was that if I specify the directory from the command
line (like davserver -D d:\Webdav -n) there is no error message as
"INFO:fshandler :get_data: D:\Webdav not found". The browser shows still the
404 error.
The error "INFO:fshandler :get_data: D:\Webdav not found" only occurs when I
specify the "-c config.ini" in the command line.

I didn't expect it to be this so tricky. It looked easy to set up an
experimental webdav server.

Fokke

How are you trying to access the webdav server? I've been hacking on
the server for several days now (unrelated reasons) and have found
that it's a little unforgiving when it comes to configuration errors.
You need to be accessing the webdav server via the correct port (I
think it's 8008 by default). If you're not doing this and something
else is running on port 80 (which is where a webdav client will go to
by default) then this would explain the 404 errors.
 
F

Fokke Nauta

becky_lewis said:
How are you trying to access the webdav server?

By IE 8 and Firefox, on the same system as well as on another system.
Firefox doesn't show the 404 error but shows a blank screen.
I bound the davserver to the local adress of the system where it's on
(10.0.0.140).
The port was 8081 but I changed it to 8008 as you said it's the default. No
difference.
I've been hacking on
the server for several days now (unrelated reasons) and have found
that it's a little unforgiving when it comes to configuration errors.
You need to be accessing the webdav server via the correct port (I
think it's 8008 by default). If you're not doing this and something
else is running on port 80 (which is where a webdav client will go to
by default) then this would explain the 404 errors.

I certainly use the correct IP address and port number.

Underneath is my command shell.
The 1st time I specified the config file (davserver.ini), the 2nd time I
specified on the command line.
Here I logged in with Firefox from system XXX (replaced the name by XXX).

(Here I started the server with the the config file (davserver.ini)
D:python27\Scripts>davserver -m -c davserver.ini
INFO:pywebdav:Starting up PyWebDAV server <version 0.9.4-dev>
INFO:pywebdav:chunked_http_response feature ON
INFO:pywebdav:http_request_use_iterator feature OFF
INFO:pywebdav:http_response_use_iterator feature OFF
INFO:DAVServer.fshandler:Initialized with d:\webdav-http://10.0.0.140:8081/
WARNING:pywebdav:Authentication disabled!
INFO:pywebdav:Serving data from d:\webdav
Listening on 10.0.0.140 <8081>

(browser logging in)

INFO:DAVServer.fshandler:get_data: d:\webdav not found
XXX --- [07/Sep/2011 11:57:48] - Mozilla/5.0 UJindows NT 5.1; rv:6.0.1>
Gecko/
20100101 Firefox/6.0.1 - "GET / HTTP/1.1" 404 -
XXX --- [07/Sep/2011 11:57:52] - Mozilla/5.0 <Uindows NT 5.1; rv:6.0.1>
Gecko/
20100101 Firefox/6.0.1 - "GET / HTTP/1.1" 404 -

^C
D:\Python27\Scripts>INFO:pywebdav:Killed by user

(Here I started the server with command line options)
davserver -D d:\webdav -H 10.0.0.140 -P 8081 -n
WARNING:pywebdav:Authentication disabled!
Listening on 10.0.0.140 <8081>
XXX --- [07/Sep/2011 11:58:49] - Mozilla/5.0 <Uindows NT 5.1; rv:6.0.1>
Gecko/
20100101 Firefox/6.0.1 - "GET / HTTP/1.1" 404 -
XXX --- [07/Sep/2011 11:58:54] - Mozilla/5.0 <Uindows NT 5.1; rv:6.0.1>
Gecko/
20100101 Firefox/6.0.1 - "GET / HTTP/1.1" 404 -

^C
D:\Python27\Scripts>INFO:pywebdav:Killed by user
 
P

Piet van Oostrum

INFO:DAVServer.fshandler:get_data: d:\webdav not found
XXX --- [07/Sep/2011 11:57:48] - Mozilla/5.0 UJindows NT 5.1; rv:6.0.1>
Gecko/
20100101 Firefox/6.0.1 - "GET / HTTP/1.1" 404 -
XXX --- [07/Sep/2011 11:57:52] - Mozilla/5.0 <Uindows NT 5.1; rv:6.0.1>
Gecko/
20100101 Firefox/6.0.1 - "GET / HTTP/1.1" 404 -
From the log it looks like you are trying to access the server with the
url:

http://localhost:8008/ or something similar.

This won't work as you would try to access the root of your webdav
directory in this way (i.e. D:/webdav). The webdav server can only serve
files, not directories, so you would have to access
http://localhost:8008/somefile.txt where somefile.txt is a file in
D:/webdav.

This only applies to acces using a browser. If you access the server
through a webdav-aware client (for example the Finder on Mac OS X, or
probably the Windows Explorer) it can serve the contents of the directory.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top