- 2008-09-05 (Fri) 03:21
iPhone iPod touchでhttpdを動かしてみます
1.1.4時代は3種類ほどinstallerにありましたが2.0以降でパッケージになっているのはlighttpdだけのようです。*1
インストール
Cydiaからインストール。
Cydia→Search"lighttpd"
08/09/05時点ではパッケージにconfやplistファイルが含まれていません。そこでiPod touchでlighttpd - Okiraku Programmingを参考にさせて頂きconfファイル、plistファイル、なんとかの1つ覚えでbossprefsプラグインを作ってみました。
/etc/lighttpd.conf
- ドキュメントルートを/var/mobile/Sites/に
- ディレクトリ表示をenableに
- localhostのみアクセス許可。
- mimetypeにmp4追加
※ipod touchでは最後のusernameとgroupnameをコメント(#)にしないと起動しなかった。
server.modules = (
"mod_access",
"mod_alias",
"mod_dirlisting",
)
server.dir-listing = "enable"
server.document-root = "/var/mobile/Sites/"
index-file.names = (
"index.html", "index.htm",
)
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",
".mp4" => "video/quicktime",
".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"
)
server.port = 80
server.bind = "127.0.0.1"
server.username = "nobody"
server.groupname = "nobody"
/System/Library/LaunchDaemons/com.amcgregor.lighttpd.plist
1.1.4時の配布ファイルに含まれていたものをパスだけ変更。
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.amcgregor.lighttpd</string> <key>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/usr/sbin/lighttpd</string> <string>-f</string> <string>/etc/lighttpd.conf</string> <string>-D</string> </array> <key>StandardErrorPath</key> <string>/dev/null</string> </dict> </plist>
/Applications/BossPrefs.app/services/lighttpd
/bin/launchctl load -w /System/Library/LaunchDaemons/com.amcgregor.lighttpd.plist /bin/launchctl unload -w /System/Library/LaunchDaemons/com.amcgregor.lighttpd.plist com.amcgregor.lighttpd.plist /Applications/BossPrefs.app/ssh.png
一応アップしておきます
- lighttpd.zipをDL&解凍
- lighttpd.confを/etc/にアップ
- com.amcgregor.lighttpd.plistを/System/Library/LaunchDaemons/にアップ
- lighttpdを/Applications/BossPrefs.app/services/にアップ
- /var/mobileにSitesディレクトリを作成
- BossprefsでlighttpdをON
以上で起動するはずです
- 注108/09/05現在
スポンサードリンク
- Posted by: iPoday
- カテゴリー: ネイティブアプリ / Network
- トピックパス:
Home » ネイティブアプリ / Network lighttpd - iPhoneでWebサーバーを動かす for 2.0+
- Tag : iPod touch / iPhone / lighttpd / オレオレplugin
- This post was displayed 4075 views
-
- Newer: MxY!動画 - SafariDL、Mobilefinder or lighttpdを使ってMxtubeの真似事
- Older: Categories - Home画面アイコンをカテゴリー分け for2.0+
Comments:3
- adoribu 2008-09-06 (Sat) 14:29
-
3091
こんにちわ、いつも参考にさせていただいてます。
上記のとおり設定してみましたがhttp://127.0.0.1/へアクセスすると
403を吐かれてしまいます。
パーミッションの設定もしくはSitesの中に何か入れなければならないとか
注意する点はありますでしょうか? - iPoday 2008-09-06 (Sat) 14:39
-
3092
こんにちわ

lighttpd.confの最後の2行をコメントアウトするか削除でどうでしょ?
- adoribu 2008-09-06 (Sat) 16:18
-
3094
早速ご回答ありがとうございます
最後の2行削除にて解決しました。
Trackback URL
- TrackBack URL for this entry
- http://www.ipoday.com/trackback/lighttpd.html
- TrackBack 送信フォーム
- もしあなたのブログがトラックバック送信に対応していない場合にはこちらのフォームからトラックバックを送信することができます。
Trackback:0
このエントリにトラックバックはありません
Referer






TouchSports Tennis

メールで購読する






