A simple server for your iPhone/iPod

Discussion in 'iOS Jailbreak & Cydia' started by giannaros, Apr 15, 2009.

  1. giannaros

    giannaros New Member

    Joined:
    Sep 1, 2008
    Messages:
    775
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    A simple server for your iPhone/iPod

    I always wanted to have a simple http server on my iPhone, a server which I could use to access my files from any computer using just using a web browser, without having to install any additional software. I found out how to do this and I want to share it with the iPTF community. Here are the steps:

    1)Jailbreak your iPhone/iPod
    2)Install MobileTerminal and Python from Cydia
    3)Open MobileTerminal and type in "python -m SimpleHTTPServer"
    -- By doing this, you will start an http server which will display your current directory. You can access it by going to your browser and typing "http://HOSTNAME:8000/. To learn what your hostname is, go to MobileTerminal and type in "hostname". For example, if your hostname is "iPod" and you run the server from within the /var/mobile directory, all you got to do is type in http://iPod:8000/ in your address field and Voila! You can see the /var/mobile directory.
    -- If there is a problem with port 8000 or you simply want to use another port,for example 8080, type "python -m SimpleHTTPServer 8080"

    Hope you liked my guide!

    Please Register or Log in to view images

  2. Bubalooshi

    Bubalooshi Active Member

    Joined:
    May 22, 2008
    Messages:
    2,432
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    This is neat.... Can it potentially be used instead of SSH?
  3. giannaros

    giannaros New Member

    Joined:
    Sep 1, 2008
    Messages:
    775
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    Well, you can download files from your device but you cant upload files, so... propably not.
  4. mcpetrolhead

    mcpetrolhead Member

    Joined:
    Jul 20, 2008
    Messages:
    136
    Likes Received:
    0
    Device:
    iPod touch
    Very good guide.
    I believe there was an app which did something like this in 1.xx.
    This is great though because it can run in the background whereas the other app couldn't.
    Great work.
  5. jlgm25

    jlgm25 Well-Known Member

    Joined:
    Nov 1, 2008
    Messages:
    3,302
    Likes Received:
    28
    Device:
    4G iPod touch
    wow thanks. this is really helpful
  6. SumDaii

    SumDaii Active Member

    Joined:
    Nov 17, 2008
    Messages:
    6,297
    Likes Received:
    0
    Device:
    iPod touch
    wow i wanted to do this as well!

    did u make this up, or a source?

    nice thread

    Please Register or Log in to view images

  7. deeboy55

    deeboy55 New Member

    Joined:
    Feb 2, 2009
    Messages:
    297
    Likes Received:
    0
    Device:
    iPad
    Couldnt you place an Index.html file in your /var/mobile/ directory? and make a website

    Please Register or Log in to view images

    im gunna try this... Ill post again later

    Please Register or Log in to view images


    ------------------double post merged------------------

    Please Register or Log in to view images

    i get an error
    Code:
    Traceback (most recent call last):
      File "/usr/lib/python2.5/runpy.py", line 95, in run_module
        filename, loader, alter_sys)
      File "/usr/lib/python2.5/runpy.py", line 52, in _run_module_code
        mod_name, mod_fname, mod_loader)
      File "/usr/lib/python2.5/runpy.py", line 32, in _run_code
        exec code in run_globals
      File "/private/var/stash/python2.5.dv9UaP/SimpleHTTPServer.py", line 218, in <module>
        test()
      File "/private/var/stash/python2.5.dv9UaP/SimpleHTTPServer.py", line 214, in test
        BaseHTTPServer.test(HandlerClass, ServerClass)
      File "/usr/lib/python2.5/BaseHTTPServer.py", line 570, in test
        httpd = ServerClass(server_address, HandlerClass)
      File "/usr/lib/python2.5/SocketServer.py", line 330, in __init__
        self.server_bind()
      File "/usr/lib/python2.5/BaseHTTPServer.py", line 101, in server_bind
        SocketServer.TCPServer.server_bind(self)
      File "/usr/lib/python2.5/SocketServer.py", line 341, in server_bind
        self.socket.bind(self.server_address)
      File "<string>", line 1, in bind
    socket.error: (48, 'Address already in use')
    
  8. giannaros

    giannaros New Member

    Joined:
    Sep 1, 2008
    Messages:
    775
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    I made it...

    Please Register or Log in to view images

Share This Page