+ Reply
Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 49

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Apache on iPhone - How Cool!!

is a discussion within the

Native iPhone / iPod Touch App Launches

forums, a part of the

3rd Party Apps For iPhone | iPod Touch

section;
Brilliant! It worked!! I was unaware of the local IP address, but that worked flawlessly!!
...
  1. #21
    iPhone? More like MyPhone
    Join Date
    Sep 2007
    Posts
    124
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Brilliant!

    It worked!!

    I was unaware of the local IP address, but that worked flawlessly!!

  2. #22
    iPhone? More like MyPhone shaiss's Avatar
    Join Date
    Sep 2007
    Posts
    261
    Thanks
    6
    Thanked 34 Times in 22 Posts

    Best use of apache is to run all those iphone webapps directly from the phone itself. Take a look, this is how it works!
    <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/Yl7JHp9WkDs"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/Yl7JHp9WkDs" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

    using lighttpd instead of apache, but you can do the same using apache

  3. #23
    Green Apple
    Join Date
    Aug 2007
    Posts
    85
    Thanks
    13
    Thanked 11 Times in 10 Posts

    Quote Originally Posted by shaiss View Post
    Best use of apache is to run all those iphone webapps directly from the phone itself. Take a look, this is how it works!
    Yea that was next on my list.

    But, dude, that video is like blurrrrrryyy city. I would like to have been able to see that the iPhone was in fact not downloading anything from the 'Net--like an airplane mode symbol. Actually it would be nice to be able to see anything.

    Also, what did you install server-side to support all of these apps? And how/where did you grab all the server-side code?

    BTW: I am not talking about launching URLs from the springboard. If that was the point of your vid then never mind.



    --
    Mike

  4. #24
    iPhone? More like MyPhone
    Join Date
    Sep 2007
    Posts
    124
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Indeed: how did you do that?

  5. #25
    iPhone? More like MyPhone shaiss's Avatar
    Join Date
    Sep 2007
    Posts
    261
    Thanks
    6
    Thanked 34 Times in 22 Posts

    sorry for the blurry video guys.
    I'll redo it monday. For now heres the how to I quickly wrote up:

    using lighttpd, Erika's OpenURL, and WinHtTrack I was able to get normal web widgets/apps to run native on the iphone. Using WinHtTrack download the entire site, put it in the sites folder after installing lighttpd, and use OpenURL to create the icon on the springboard!

    more details and pictures to come

  6. #26
    What's Jailbreak?
    Join Date
    Jul 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by Tinman View Post
    Yes, you can be offline and still access your content locally.

    Content is stored in:
    /Library/WebServer/Documents

    I renamed index.html (created by default during Apache's install) so that a Web page is not displayed. Instead I get a list of files, and can tap whatever I want to open:



    It works fine in Airplane Mode too, but I used SSH to snap the screenshot and needed WiFi.




    --
    Mike


    I used Manzana to access the index.html file and right-clicking only allows me to delete it. Renaming is grayed-out at won't allow it. How do I re-name it? (BTW, I'm excited to add the pdf files as ebooks. The Books.app application is great but only .txt and .html files )

  7. #27
    Green Apple
    Join Date
    Aug 2007
    Posts
    85
    Thanks
    13
    Thanked 11 Times in 10 Posts

    Quote Originally Posted by fug2000 View Post
    I used Manzana to access the index.html file and right-clicking only allows me to delete it. Renaming is grayed-out at won't allow it. How do I re-name it? (BTW, I'm excited to add the pdf files as ebooks. The Books.app application is great but only .txt and .html files )
    You really don't need index.html, it is just a crude generic home page supplied by Apache. You could just delete it, or even copy it to your desktop computer if you want to retrieve it later (simply reinstalling Apache will bring it back too).

    Also, you can create folders under the .../Documents folder to organize files (e.g., OfficeDocs, PDFs, etc.)


    --
    Mike

  8. #28
    Green Apple
    Join Date
    Sep 2007
    Posts
    44
    Thanks
    0
    Thanked 10 Times in 7 Posts

    I mentioned it in another thread, but one thing I did once I installed lighttpd to read local pdfs was enable a stylesheet for the directory index. So this enables you to up the size of the filename etc, so that it looks more "iphone-like", and you don't immediately need to zoom in to be able to hit the links accurately. I'm sure there is something similar for Apache somewhere.

    Edit: Here's a screenshot. I'm sure someone with better CSS skills could make it much nicer!
    Last edited by cazlar; 10-10-2007 at 03:07 PM.

  9. #29
    iPhone? More like MyPhone shaiss's Avatar
    Join Date
    Sep 2007
    Posts
    261
    Thanks
    6
    Thanked 34 Times in 22 Posts

    Quote Originally Posted by cazlar View Post
    I mentioned it in another thread, but one thing I did once I installed lighttpd to read local pdfs was enable a stylesheet for the directory index. So this enables you to up the size of the filename etc, so that it looks more "iphone-like", and you don't immediately need to zoom in to be able to hit the links accurately. I'm sure there is something similar for Apache somewhere.

    Edit: Here's a screenshot. I'm sure someone with better CSS skills could make it much nicer!
    could you give a bit a more details on how to do this?
    I'd really like to this on mine

  10. #30
    Green Apple
    Join Date
    Sep 2007
    Posts
    44
    Thanks
    0
    Thanked 10 Times in 7 Posts

    See here: http://www.modmyi.com/forums/showpos...5&postcount=15 on how to enable directory listing in lighttpd. To enable the css, in the same config file add a line like
    Code:
    dir-listing.external-css = "/iphonedirlist.css"
    , then you can just make a css file with that name in your /Sites directory that lighttpd made. I used mobileTextEdit to edit both the config and css files on the phone, rather than switching files back and forth with ssh. If you want, I can post my current css later tonight.

  11. #31
    iPhone? More like MyPhone shaiss's Avatar
    Join Date
    Sep 2007
    Posts
    261
    Thanks
    6
    Thanked 34 Times in 22 Posts

    please post your css file, I cant CSS to save my life ;(

    Quote Originally Posted by cazlar View Post
    Sorry about replying to myself, but if anyone is interested in this, to turn on directory listings you need to edit the lighttpd.conf file (in /usr/local/etc/ IIRC) to add
    Code:
    dir-listing.activate = "enabled"
    and also add
    Code:
    "mod_dirlisting"
    in the module listing alongside the "mod_cgi" (separate with a comma).

    Restart the phone (I guess you could just restart lighttpd if you wanted) and you can browse your pdfs :-)

    Edit: And you could probably style the directory listing via CSS (there's an option to enable this) to get something that looked very pretty on the iPhone. I'm crappy at CSS though.
    I tried this but it didnt work. I changed the file as stated above, put it back in the /usr/local/etc/ overrighting the original. I restart lighttpd go to 127.0.0.1 and get "server not found". when I restore the original lighttpd.conf file and restart lighttpd it works fine but no directory browsing obviously.

    Heres my lighttpd.conf, any help is appriciated
    Code:
    server.document-root = "/private/var/root/Sites/"
    # server.port = 80 # Default
    #server.bind = "127.0.0.1" # Default: All
    server.modules = ( "mod_cgi", "mod_dirlisting" )
    server.tag = "iPhone lighttpd"
    
    #server.pid-file            = "/var/run/lighttpd.pid"
    
    accesslog.filename = "/var/log/lighttpd/access.log"
    server.errorlog = "/var/log/lighttpd/error.log"
    dir-listing.activate = "enabled"
    
    index-file.names = ( "index.php", "index.py", "index.pl", "index.cgi", "index.html", "default.html" )
    url.access-deny = ( "~", ".inc" )
    static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".cgi", ".py" )
    
    cgi.assign = ( ".pl"  => "/usr/bin/perl", ".py" => "/usr/bin/python", ".rb" => "/usr/local/bin/ruby", ".cgi" => "", ".sh" => "" )
    
    mimetype.assign             = (
    	".pdf"          =>      "application/pdf",
    	".sig"          =>      "application/pgp-signature",
    	".spl"          =>      "application/futuresplash",
    	".class"        =>      "application/octet-stream",
    	".ps"           =>      "application/postscript",
    	".torrent"      =>      "application/x-bittorrent",
    	".dvi"          =>      "application/x-dvi",
    	".gz"           =>      "application/x-gzip",
    	".pac"          =>      "application/x-ns-proxy-autoconfig",
    	".swf"          =>      "application/x-shockwave-flash",
    	".tar.gz"       =>      "application/x-tgz",
    	".tgz"          =>      "application/x-tgz",
    	".tar"          =>      "application/x-tar",
    	".zip"          =>      "application/zip",
    	".mp3"          =>      "audio/mpeg",
    	".m3u"          =>      "audio/x-mpegurl",
    	".wma"          =>      "audio/x-ms-wma",
    	".wax"          =>      "audio/x-ms-wax",
    	".ogg"          =>      "application/ogg",
    	".wav"          =>      "audio/x-wav",
    	".gif"          =>      "image/gif",
    	".jpg"          =>      "image/jpeg",
    	".jpeg"         =>      "image/jpeg",
    	".png"          =>      "image/png",
    	".xbm"          =>      "image/x-xbitmap",
    	".xpm"          =>      "image/x-xpixmap",
    	".xwd"          =>      "image/x-xwindowdump",
    	".css"          =>      "text/css",
    	".html"         =>      "text/html",
    	".htm"          =>      "text/html",
    	".js"           =>      "text/javascript",
    	".asc"          =>      "text/plain",
    	".c"            =>      "text/plain",
    	".cpp"          =>      "text/plain",
    	".log"          =>      "text/plain",
    	".conf"         =>      "text/plain",
    	".text"         =>      "text/plain",
    	".txt"          =>      "text/plain",
    	".dtd"          =>      "text/xml",
    	".xml"          =>      "text/xml",
    	".mpeg"         =>      "video/mpeg",
    	".mpg"          =>      "video/mpeg",
    	".mov"          =>      "video/quicktime",
    	".qt"           =>      "video/quicktime",
    	".avi"          =>      "video/x-msvideo",
    	".asf"          =>      "video/x-ms-asf",
    	".asx"          =>      "video/x-ms-asf",
    	".wmv"          =>      "video/x-ms-wmv",
    	".bz2"          =>      "application/x-bzip",
    	".tbz"          =>      "application/x-bzip-compressed-tar",
    	".tar.bz2"      =>      "application/x-bzip-compressed-tar",
    	# default mime type
    	""              =>      "application/octet-stream",
    )
    Last edited by shaiss; 10-11-2007 at 08:48 AM.

  12. #32
    Green Apple
    Join Date
    Sep 2007
    Posts
    45
    Thanks
    2
    Thanked 1 Time in 1 Post
    Default How to start and stop Apache?
    I want the freedom to turn on and off my webserver.

    In terminal I type apachectl -k stop and it says stop but then u open http://localhost or http://127.0.0.1 and its still running.

    weird does anyone know?????

  13. #33
    iPhone? More like MyPhone shaiss's Avatar
    Join Date
    Sep 2007
    Posts
    261
    Thanks
    6
    Thanked 34 Times in 22 Posts

    Quote Originally Posted by joejoe123 View Post
    I want the freedom to turn on and off my webserver.

    In terminal I type apachectl -k stop and it says stop but then u open http://localhost or http://127.0.0.1 and its still running.

    weird does anyone know?????
    I think you need to use the unload command. try using Erica Sudan's UIctrl

  14. #34
    Green Apple
    Join Date
    Sep 2007
    Posts
    44
    Thanks
    0
    Thanked 10 Times in 7 Posts

    Oops, just glancing at my conf file, it should read "enable", not "enabled". Sorry, I'll edit my earlier post, and also post my css when I get a chance today.

  15. #35
    iPhone? More like MyPhone shaiss's Avatar
    Join Date
    Sep 2007
    Posts
    261
    Thanks
    6
    Thanked 34 Times in 22 Posts

    would be nice if someone could make a css file or whatever so browsing the sites folder would feel like the iphone interface that the webapps use. that would be great!

  16. #36
    Green Apple
    Join Date
    Sep 2007
    Posts
    44
    Thanks
    0
    Thanked 10 Times in 7 Posts

    Here's my current one. As I said, I suck at CSS too, so I'm sure it can get a LOT better in the hands of a real designer
    Code:
    a, a:active {text-decoration: none; color: blue;}
    a:visited {color: #48468F;}
    a:hover, a:focus {text-decoration: underline; color: red;}
    
    h2 {display:none;}
    table {margin-left: 10px;}
    th, td { font: 20pt Helvetica; text-align: left;}
    th { font-weight: bold; padding-right: 14px; padding-bottom: 3px;}
    td {padding-right: 10px; border-top: 1px solid #d9d9d9;}
    td.s, th.s {text-align: right;}
    div.list { font-size:36pt; background-color: white; }
    td.m { font-size:16pt;}
    td.t { font-size:20pt;}
    td.s { font-size:24pt;}
    td.n { font-size:40pt; padding-top:12px; padding-bottom:12px; }
    div.foot {dispay:none; font: 1pt monospace; color: #fff;}

  17. #37
    iPhone? More like MyPhone shaiss's Avatar
    Join Date
    Sep 2007
    Posts
    261
    Thanks
    6
    Thanked 34 Times in 22 Posts

    cool, works for me, but yeah, I'm sure someone could do better

  18. #38
    What's Jailbreak?
    Join Date
    Oct 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How does the apache server affect the batterylife?
    When I unload -w or stop with UIctl, it still works in safari. and I still see it running with top in terminal.

  19. #39
    Green Apple e-gold-casino's Avatar
    Join Date
    Sep 2007
    Posts
    33
    Thanks
    14
    Thanked 1 Time in 1 Post
    Excellent, everything working OK. I'd managed to arrange all my PDFs, Docs, local htmls.

    CSS file definitely needs tuning.

  20. #40
    What's Jailbreak?
    Join Date
    Nov 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Q
    I install apache and then open to safari and type in the web address where I get a message from apache saying software successfully installed.

    I then use mobile finder to navigate to library but there is no WebServer folder and I can't find any file called index.html

    Am i supposed to create the webserver and documents folders manually?

    any help appreciated

    and apache doesn't show up in my list of applications even though it says installed. I presume it is supposed to?
    Last edited by bobjames; 11-17-2007 at 05:05 AM. Reason: Automerged Doublepost

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