×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    47

    Download older versions of mobile web server

    Hi

    Is it possible to download older versions of the mobile web server from somewhere? I can only find version 1.4 at mymobilesite.net.

    I am faceing some problems getting a script that works perfectly on a N95 / MWS 1.2 to work on N95 8GB / MWS 1.4

    I would like to test is its the device MWS version or something else.

    best regards,
    Magnus

  2. #2
    Registered User
    Join Date
    Mar 2008
    Posts
    47

    Re: Download older versions of mobile web server

    Well I found what is causing my script not to work on the newest mobile web server.

    Nothing serious, actually a debug print out.

    I open a debug file with
    sys.stdout = open("c:\\debugfile.txt", "w")

    so the output of every print statement is written to this file

    then the web server crasses, sends out a zero sized reply, on the following line where I print out the incoming http headers

    print req.headers_in

    I can ofcourse just skip this in a final version, but this works on MWS 1.02(1) and 1.2

  3. #3
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Download older versions of mobile web server

    If memory serves me, the Apache used in MWS up until 1.2 was built using the old c-library of Symbian, while the Apache used in MWS versions after that is built using the new Open-C library.

    I was about to blame Open-C, because there used to be bug (I believe it's been fixed in the latest release) that caused the application to crash when a file opened in binary mode was closed.

    However, as we are now talking PyS60, which still uses the old c-library in its implementation, the use of Open-C should not have any impact.

    Perhaps you still could try whether opening the file using text-mode changes anything.

    Br,
    Johan

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    47

    Re: Download older versions of mobile web server

    Hi,

    I can successfully open, write to the file and close it.

    It only crashes when I try to write out the incoming HTTP headers. So probably this is not the issue. Since this was just meant for debugging and logging, I just took out the line that writes out the incoming headers and then everything works (that is everything else gets written to the file and it is closed successfully).

    best regards,
    Magnus

  5. #5
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Download older versions of mobile web server

    Quote Originally Posted by maggias View Post
    It only crashes when I try to write out the incoming HTTP headers. So probably this is not the issue. Since this was just meant for debugging and logging, I just took out the line that writes out the incoming headers and then everything works (that is everything else gets written to the file and it is closed successfully).
    If it's not too much work, could you please provide me with the smallest possible code snippet that causes a crash and I could investigate what really is going on.

    Johan

  6. #6
    Registered User
    Join Date
    Mar 2008
    Posts
    47

    Re: Download older versions of mobile web server

    Sure no problem, here are two test cases other that crashes and another that works.

    TEST 1:
    def handler(req):
    from mod_python import apache
    import sys

    sys.stdout = open(u'c:\\Data\\Web server\\htdocs\\test1\\result.txt', "w")

    #print something
    print "TEST1"

    #print headers
    print req.headers_in

    req.write("Done")

    sys.stdout.close()

    return apache.OK

    Returns a Zero sized reply, "Oops! the Mobile Web Server (Beta) you used faces a problem."

    The text file gets created but it is empty sys.stdout.flush() before #print headers would though have printed TEST1 into it.

    TEST 2:
    def handler(req):
    from mod_python import apache
    import sys

    sys.stdout = open(u'c:\\Data\\Web server\\htdocs\\test2\\result.txt', "w")

    #print something
    print "TEST2"

    #print headers
    #print req.headers_in

    req.write("Done")

    sys.stdout.close()

    return apache.OK

    Finishes successfully printing Done to the browser and creating the result file containing the string TEST2

    You can test both from my device if you like:
    https://maggi.mymobilesite.net/test1/.py
    https://maggi.mymobilesite.net/test2/.py

    Test 1 works on older version of the MWS then printing out a dict with the incoming HTTP headers.

    best regards,
    Magnus

  7. #7
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Download older versions of mobile web server

    Quote Originally Posted by maggias View Post
    Sure no problem, here are two test cases other that crashes and another that works.
    Thanks, I could easily repeat the behaviour on target. However, unfortunately, both cases work nicely when running under the emulator, which makes further investigations a bit more harder...

    Johan

  8. #8
    Registered User
    Join Date
    Mar 2008
    Posts
    47

    Re: Download older versions of mobile web server

    Hi,

    One other interoperability problem that I have encountered is that HTTP Basic Authentication dose not seem to work on the newer device.

    I have the exact same setup on both devices but with MWS 1.4 the password does not work and after three tries I get 401 Authorization Required

    Is this a known issue or was there some change in this area between releases?

    Here is the content of my files, if I remember correctly I initially followed instructions in the MWS book.

    ht.acl file:
    AddHandler mod_python .py
    PythonHandler manager
    PythonDebug On
    Options None
    Order Deny,Allow
    Allow from all
    <FilesMatch "\.(pyc)$">
    Deny from all
    </FilesMatch>

    AuthType Basic
    AuthName "You have to login to access the manager area"
    AuthUserFile "htdocs/webservices/manager/passwords"
    AuthGroupFile "htdocs/webservices/manager/groups"
    Require group group1

    groups file:
    group1: admin

    password file:
    admin:admin

  9. #9
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: Download older versions of mobile web server

    Quote Originally Posted by maggias View Post
    Is this a known issue or was there some change in this area between releases?
    Yes and no, there's been a change, but in MWS' case there should be no change in the behaviour.

    Up until version 1.2, MWS used the 2.0 branch of Apache and from 1.3 onwards the 2.2 branch. And between 2.0 and 2.2 there was a slight change in the way the Require directive works. In 2.0
    Code:
    Require group ...
    Require user ...
    was interpreted so that if either requirement was fulfilled, the user was allowed access. In 2.2 it's interpreted so that both requirements must be fulfilled, which in practice makes it hard to use group and user at the same time. A straightforward workaround is to create, for each user, a group with the same name and then only use Require group.

    However, MWS (1.3 and 1.4) installs and uses an authentication module from the 2.0, so the authentication behaviour of 1.[3|4] should be identical to that of 1.2.

    Johan

  10. #10
    Registered User
    Join Date
    Mar 2008
    Posts
    47

    Re: Download older versions of mobile web server

    hmm, I don't quite understand

    I added
    Require user admin
    into ht.acl

    so now it looks like this
    AuthType Basic
    AuthName "You have to login to access the manager area"
    AuthUserFile "htdocs/webservices/manager/passwords"
    AuthGroupFile "htdocs/webservices/manager/groups"
    Require group group1
    Require user admin

    leaving the other files intact, but it did not work.

    I then tried to renamed the group also to admin, so now my files look like, this

    ht.acl:
    AuthType Basic
    AuthName "You have to login to access the manager area"
    AuthUserFile "htdocs/webservices/manager/passwords"
    AuthGroupFile "htdocs/webservices/manager/groups"
    Require group admin
    Require user admin

    groups:
    admin:admin

    passwords:
    admin:admin

    That does not work eather.

    The files are clearly in the correct location because when I try to rename one of them I get an Internal Server error.

    Also depending on your previous reply, since the same auth module is used this should infact behave the same way on MWS 1.4 and MWS 1.2

Similar Threads

  1. Mobile web server and web services
    By landerluu in forum Mobile Web Server
    Replies: 1
    Last Post: 2008-01-03, 06:36
  2. problem connecting to mobile web server.
    By lb213_2000 in forum Symbian
    Replies: 0
    Last Post: 2007-11-14, 03:11
  3. Web To Mobile games a reality
    By sjbrown0 in forum Mobile Java General
    Replies: 0
    Last Post: 2005-06-29, 01:51

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×