Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
Native iPhone / iPod Touch App Launchesforums, a part of the
3rd Party Apps For iPhone | iPod Touchsection;
I've finally finished something I was banging my head with for quite some time. Here on modmyi I found several partial instructions on hot to enable Lighttpd server directory listing...
03-06-2008, 04:47 AM #1PDF/CHM/DOC/XLS/photo viewer - all-in-one Safari/Lighttpd based (complete instruct.)
I've finally finished something I was banging my head with for quite some time. Here on modmyi I found several partial instructions on hot to enable Lighttpd server directory listing (with or without CSS styling).
kane.lai improved code of DeathPrawn's dirlist generator. Improvements are listed at the end of this post.
I chose Lighttpd as it uses less resources (and I won't bother disabling it through BossPrefs).
Apache servers should display root folder content as soon as you delete index.html in ~/Sites. Lighttpd requires more attention
INSTRUCTIONS: HOW TO SETUP COOL DIRECTORY LISTING ON LIGHTTPD
1. Install Lighttpd and PHP (via Installer)
(after finished PHP installation you'll see a message "Please add /opt/iphone/bin/ to your $PATH", ignore it, it's all already set), restart iPhone, lighttpd will be started on the next boot.
2. Check if Lighttpd is installed correctly. Point your iPhone browser to 127.0.0.1 and you should be greeted by Lighttpd welcome screen.
3. Unpack "Lighttpd server.zip" archive (attached at the end of this post) and copy dirlist folder from archive to ~/Sites (/private/var/root/Sites) using your weapon of choice (WinSCP, Putty, Terminal/SSH, AFPd, SFTP...)
Also, rename dirlist to .dirlist (add a dot in front of the directory name, which will make folder invisible and it will not be shown in directory listing). Should you encounter any problems with renaming, navigate to /private/var/root/Sites and type following command in Terminal/SSH (small HOM icon in WinSCP).
mv dirlist .dirlist
4. Edit lighttpd.conf located in /usr/local/etc/ just copy mine over your original (it's also inside .zip archive)
If you feel like editing it all over again, here it's what it takes...this means you don't have to follow the next step (under stars) if you will overwrite your original .conf file with the modified one that you will find in attached zip file.
+ Add two more server modules
server.modules = ( "mod_cgi","mod_indexfile","mod_dirlisting" )
'index-file.names = ( "/.dirlist/dir-generator.php" )'
, ".php" => "/opt/iphone/bin/php-cgi"
cgi.assign = ( ".pl" => "/usr/bin/perl", ".py" => "/usr/bin/python", ".rb" => "/usr/local/bin/ruby", ".cgi" => "", ".sh" => "", ".php" => "/opt/iphone/bin/php-cgi" )
dir-listing.activate = "enable" dir-listing.external-css = "/.dirlist/iphonedirlist.css"
server.bind = "localhost"
#server.bind = "localhost"
After editing it should look like this..
Lighttpd with only folder listing turned on (looks much like Apache without index.html) and screenshot of Lighttpd with PHP/CSS improved view
Viewing Word and Excel files
PDF file in landscape view
Thanks to DeathPrawn, DaveiPhone and cazlar for their initial involvement in this. I've just collected it all together, tweaked CSS and provided screenshots
CHANGELOG OF KANE LAI'S TWEAKS
Version 1.5.1 (Apr 19, 2008)
* fixed a bug where folders/files with spaces in their name cannot be hyperlinked (sorry about this)
Version 1.5 (Apr 19, 2008)
+ added support for ".htm", ".html" and ".php" files
+ added experimental support for ".mp3" and ".mp4" files
Version 1.32 (Apr 5, 2008)
* fixed a bug where folders containing the "+" character fails to open
* fixed a bug where changing the orientation of Safari messes up the font size
Version 1.31 (Apr 3, 2008)
+ added icon for ".jpeg" files (in addition to ".jpg" files)
* added a space between icon and filename
* ignored the case of the file extension (".JpG", ".JPG", ".jpg" are the same)
Version 1.3 (Mar 31, 2008)
+ added icon for txt files
* increased thumbnail size and removed the filenames for photos (coz filenames are generally not important for photos)
* fixed a minor bug about hyperlinks
* renamed apple-touch-icon.png to favicon.png
Version 1.2 (Mar 30, 2008)
+ icons support - for PDF/DOC/XLS/folder, icons are shown; for JPG/GIF/PNG, picture preview are shown.
Version 1.1 (Mar 27, 2008)
* the original script fails to enter directory/file which contains the "#" character in directory name or filename
* when the length of file/dir is too long, the ">" at the right of the line get overlapped. now it's fixed.
+ the original script only shows 127.0.0.1 as the root folder name. i've added a constant in the script that allows the user to customize the name. i preset it as "Library"
+ web clip icon support. just put an icon named "apple-touch-icon.png" in the ".dirlist" folder (or use the one i attached). and try to add the web page to the home screen
+ the page auto scroll to hide the address bar of safari (only if the length of the list of files reached a full screen of safari)
kane.lai, -V-O-Y-A-G-E-R-, DeathPrawn, DaveiPhone and cazlar
Last edited by -V-O-Y-A-G-E-R-; 04-21-2008 at 04:12 AM. Reason: Updated package with kane.lai tweaks.
The Following 24 Users Say Thank You to -V-O-Y-A-G-E-R- For This Useful Post:
attila135791 (04-02-2008), betonmoewe (03-20-2008), Cody Overcash (03-10-2008), DobyTheDoggy (07-08-2008), emla2bu7a5 (06-29-2008), eternal (03-06-2008), Eurisko (03-16-2008), iamubiquitous (08-06-2008), j.ajamil (04-09-2008), k1dr0ck (03-11-2008), koucz (07-09-2008), ksong12 (03-24-2008), louiektc (05-12-2008), meomeo2007 (03-12-2008), NiLbReTh (06-05-2008), ptemples (04-13-2008), Sandric (05-05-2008), Stefans (03-11-2008), taku42 (04-07-2008), tonydeli7 (03-06-2008), user.exe (04-25-2008), vijay7_7 (04-22-2008), zacklyn (03-28-2008), zheleznov (03-09-2008)
03-09-2008, 06:39 AM #2
This is great, thanks for the detailed instructions, I was looking for this!!!
However it seems not to work on my iPhone with 1.1.4 as I only see the greeting screen of Lighttpd when navigating to the IP 127.0.0.1.
I followed all the instructions and checked that also lighttpd.conf has been replaced... No idea why it won't work?
Many thanks and best regards,
03-09-2008, 07:30 AM #3
Navigate from Safari to 127.0.0.1/.dirlist to see if it's properly hidden (named). All the problems probably arose from .dirlist not being setup right. Doesn't matter if you're on 1.1.3 or 1.1.4, you see Lighttpd welcome screen so the whole idea works
03-09-2008, 11:41 AM #4
Many thanks for the quick reply! I do see the .plist .dirlist contents (iPhoneArrow.jpg, etc). So I can create a subfolder, such as Docs, in âˆ•private/var/root/Sites where I then can put all my docs and pdfs, navigating to the directory by entering 220.127.116.11/Docs to see them all?
Many thanks and best regards,
03-09-2008, 02:55 PM #5
03-09-2008, 03:56 PM #6
03-09-2008, 04:21 PM #7
Please your help: where do I find Otpakovati.zip?
I´ve browsed download section and googled, I didn't find it.
Sorry, found the files within the attached zip
Last edited by mortiz; 03-09-2008 at 04:41 PM.
03-09-2008, 08:00 PM #8
03-10-2008, 02:32 AM #9
I have a sort of a problem here, don't see screenshots in my first post every time I load this page? Can you see them or should I relocate them to another hosting site?
Last edited by -V-O-Y-A-G-E-R-; 03-10-2008 at 02:32 AM. Reason: Automerged Doublepost
03-10-2008, 05:44 AM #10
i think this is a great mod...
i'm a noob so sorry...
step 1 is in installer right?
can you make an instruction for dummies on steps 3 and 4?
i'm confused sorry
there is a part where i use terminal right? can i use vt-100 on my iphone?
03-10-2008, 06:44 AM #11
Actually, you don't have to use Terminal. If you're on Windows, use WinSCP, if you're on OS X install AFPd via Installer and you'll see you're iPhone as a network disk.
Step 3 and 4
Unpack attached "Lighttpd server.zip" file and move .dirlist folder (it's dirlist, but rename it to .dirlist) and lighttpd.conf to /private/var/root/Sites and /usr/local/etc/ (respectively).
Copying files around with WinSCP/AFPd+Finder is quite selfexplanatory, like everyday file management.
03-10-2008, 07:45 AM #12
nice hack voyager, but can you ask someone like the mods or big boss to make a complete installer package including first step also. i know i am asking for too much but installer can also run scripts and place files. also i have thanked you as you deserve it. Also I would love to feature it on my blog once it's an installer package.
Last edited by Eurisko; 03-10-2008 at 07:50 AM.
03-10-2008, 08:07 AM #13
Well, this is not much of a work once you download Lighttpd and PHP...I doubt BB or other guys would bother with scripting
Feel free to ask them if you would like
The Following User Says Thank You to -V-O-Y-A-G-E-R- For This Useful Post:
03-10-2008, 08:16 AM #14
thanks for the quick reply.
thanks1.1.4 Winpwned ----> 2.0 Winpwned
Bootloader- 3.9 (1.0.2 OOTB)
Call In/Out - Yes/Yes
SMS In/Out - Yes/Yes
GPRS - Yes
YouTube - Yes
03-10-2008, 05:52 PM #15
When completed, I can load the webpage, but when I rename index.html to index.htxx and reload, all I get is 404 - Not FoundGet "iPod & iTunes for Dummies", it'll change your life.
03-10-2008, 08:05 PM #16
Can the PC iPhone Suite be used to transfers the files or does an FTP program need to be used? If an FTP program, how do i find my iPhone directories using WinSCP?
I have done everything per the instructions and I get a 404 ERROR when I go to http://127.0.0.1/.dirlist or http://127.0.0.1/dirlist (without the period in front of dirlist). Are there any other files from Installer/Cydia I should have installed on my iPhone?
Last edited by samsadex; 03-10-2008 at 08:05 PM. Reason: Automerged Doublepost
03-10-2008, 10:26 PM #17
index-file.names = ( "index.php", "index.py", "index.pl", "index.cgi", "index.html", "default.html", "/.dirlist/dir-generator.php" )
and add the other extensions you want, like "index.htm", "index.xhtml" so on
index-file.names = ( "index.php", "index.py", "index.pl", "index.cgi", "index.html", "index.htm", "index.xhtml", "default.html", "/.dirlist/dir-generator.php" )
03-11-2008, 09:21 AM #18
Excellent work works perfectly!!
Any idea how I can zoom more using PDF files? I can't seem to be able to zoom more than the page width.
03-11-2008, 09:26 AM #19
03-11-2008, 09:30 AM #20