×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    9

    run python script via browser locally

    Hi

    I have stupid problem hope somebody help me:

    Actually i have a simple .py file which generates a html page. When my server runs in internet mode I can call the url successfully. But when I run the server locally and call the script via browser "http://127.0.0.1/test/.py", the browser returns :

    403 Forbidden
    You dont have permission to access /test/ on this server.


    The folder doesnt have any restriction and I did not defined any restriction on the access folder. I dont have any idea how I can set the permission ?

    Appreciate your help

    Ali

    PS
    here is my ht.acl file

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

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: run python script via browser locally

    Quote Originally Posted by alireza.sahami View Post
    Hi

    I have stupid problem hope somebody help me:

    Actually i have a simple .py file which generates a html page. When my server runs in internet mode I can call the url successfully. But when I run the server locally and call the script via browser "http://127.0.0.1/test/.py", the browser returns :

    403 Forbidden
    You dont have permission to access /test/ on this server.


    The folder doesnt have any restriction and I did not defined any restriction on the access folder. I dont have any idea how I can set the permission ?

    Appreciate your help

    Ali

    PS
    here is my ht.acl file

    AddHandler mod_python .py
    PythonHandler test
    PythonDebug On
    Options None
    Order Deny,Allow
    Allow from all
    <FilesMatch "\.(pyc)$">
    Allow from all
    </FilesMatch>
    hi ali

    just a guess is your program has sufficient capability to access the folder i mean is your sis signed with all capability.

    Enjoy Pythoning
    Gaba88

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    9

    Re: run python script via browser locally

    Quote Originally Posted by gaba88 View Post
    hi ali

    just a guess is your program has sufficient capability to access the folder i mean is your sis signed with all capability.

    Enjoy Pythoning
    Gaba88
    I have normal .py file and no need to sign as y script works when I run my MWS in internet mode and I can access the script via internet.

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: run python script via browser locally

    Quote Originally Posted by alireza.sahami View Post
    I have normal .py file and no need to sign as y script works when I run my MWS in internet mode and I can access the script via internet.
    hi ali again
    sorry for the confusion i actually mean if you are offline do you really have the rights to acess that folder. Can you give the details where is the folder??

    Enjoy Pythoning
    gaba88

  5. #5
    Registered User
    Join Date
    Jul 2008
    Posts
    9

    Re: run python script via browser locally

    Quote Originally Posted by gaba88 View Post
    hi ali again
    sorry for the confusion i actually mean if you are offline do you really have the rights to acess that folder. Can you give the details where is the folder??

    Enjoy Pythoning
    gaba88
    it s in httpdoc , as I wanna access that via webserver. I m try to find a way tell server that locally access this folder is also ok. b/c i can access this folder via internet but not LOCALLY.

    Ali

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: run python script via browser locally

    Quote Originally Posted by alireza.sahami View Post
    it s in httpdoc , as I wanna access that via webserver. I m try to find a way tell server that locally access this folder is also ok. b/c i can access this folder via internet but not LOCALLY.

    Ali
    hi ali
    yes that can be possible.
    i feel that the folder must have rights to be accessed on internet not locally thats why you are getting that sort of a error.

    Hope this helps
    Regards
    Gaba88

  7. #7
    Registered User
    Join Date
    Jul 2008
    Posts
    9

    Re: run python script via browser locally

    Quote Originally Posted by gaba88 View Post
    hi ali
    yes that can be possible.
    i feel that the folder must have rights to be accessed on internet not locally thats why you are getting that sort of a error.

    Hope this helps
    Regards
    Gaba88
    already knew that, have not found any solution for that

    thnx any way
    Ali

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

    Re: run python script via browser locally

    Quote Originally Posted by alireza.sahami View Post
    When my server runs in internet mode I can call the url successfully. But when I run the server locally and call the script via browser "http://127.0.0.1/test/.py", the browser returns :

    403 Forbidden
    You dont have permission to access /test/ on this server.
    Ok, so everything works when you browse to http://...mymobilesite.net/test/.py using the browser on your PC, but not when you browse to http://127.0.0.1/test/.py using the browser on the phone?

    Access control wise there is no difference whether the access comes over the Internet or from the local browser. In fact, because of the intermediate gateway, also requests from the Internet arrives from 127.0.0.1, from the web server's point of view.

    Are you absolutely sure the forbidden reply actually is generated by the local server? What access point do you use when you browse using the phone? Check that you don't have a proxy defined that does the wrong thing for 127.0.0.1. On my N95 you find that setting from Tools->Settings->Access points-> "the one you use" -> [Options] -> [Advanced settings] -> 'Proxy server address'. You really did use 127.0.0.1 and not localhost, right?

    Johan

  9. #9
    Registered User
    Join Date
    Jul 2008
    Posts
    9

    Re: run python script via browser locally

    Quote Originally Posted by jhnwkmn View Post
    Ok, so everything works when you browse to http://...mymobilesite.net/test/.py using the browser on your PC, but not when you browse to http://127.0.0.1/test/.py using the browser on the phone?

    Access control wise there is no difference whether the access comes over the Internet or from the local browser. In fact, because of the intermediate gateway, also requests from the Internet arrives from 127.0.0.1, from the web server's point of view.

    Are you absolutely sure the forbidden reply actually is generated by the local server? What access point do you use when you browse using the phone? Check that you don't have a proxy defined that does the wrong thing for 127.0.0.1. On my N95 you find that setting from Tools->Settings->Access points-> "the one you use" -> [Options] -> [Advanced settings] -> 'Proxy server address'. You really did use 127.0.0.1 and not localhost, right?

    Johan
    I checked my N95 and it doesnt have this menu (advance option)which I can check the proxy server address (I already update my N95 with the latest version). Also I have never changed anything related to the proxy since I installed the MWS.
    Plus when I enter http://127.0.0.1/ i can the home page of the server.

    This is how I browse my page, go to web browser->type http://127.0.0.1/test/.py


    Ali

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

    Re: run python script via browser locally

    Quote Originally Posted by alireza.sahami View Post
    Plus when I enter http://127.0.0.1/ i can the home page of the server.
    Ok, then there is no problem with the access point.

    But then I am at a loss for words. I can't really see what the problem could be.

    Johan

  11. #11
    Registered User
    Join Date
    Jul 2008
    Posts
    9

    Re: run python script via browser locally

    Quote Originally Posted by jhnwkmn View Post
    Ok, then there is no problem with the access point.

    But then I am at a loss for words. I can't really see what the problem could be.

    Johan
    is there any problem with my ht.acl file?

  12. #12
    Registered User
    Join Date
    Oct 2007
    Posts
    22

    Re: run python script via browser locally

    i thick ,you must check your phone browser's connect point .when i setting →connecting type→local.then options→via by browser.if my browser'sconnect point is wap(use proxy),it can't assess .when i change connect proxy to net( not use proxy),i can success assess http://127.0.0.1

Similar Threads

  1. [moved] signed python script shell
    By joemarshall in forum Symbian
    Replies: 18
    Last Post: 2009-03-06, 03:17
  2. Replies: 2
    Last Post: 2008-03-10, 05:46
  3. Replies: 3
    Last Post: 2007-03-12, 05:02
  4. Running a Python script on the emulator?
    By iliyang in forum Symbian
    Replies: 6
    Last Post: 2005-03-09, 17:57

Posting Permissions

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