mod_perl hacks PHP

  • 1,976 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,976
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
7
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Transcript

  • 1. mod_perl hacks PHP fonfun (OGATA Tetsuji) Twitter: @xtetsuji 2011/12/10
  • 2. • (OGATA Tetsuji)• Twitter: @xtetsuji• Blog: http://post.tetsuji.jp/• ( )•
  • 3. • Hokkaido.pm#5 mod_perl• 3• Perl 30• :
  • 4. • fonfun( ) http://www.fonfun.co.jp/ • http://rmail.jp/• g15 http://g15.jp/
  • 5. • fonfun( : ) • 1999 ( : ) • 2003 4 (Perl + Apache/ mod_perl + Oracle + Postfix) •
  • 6. Hokkaido.pm++• ( )•
  • 7. Agenda
  • 8. Agenda• mod_perl• PHP• mod_perl Hacks PHP • Authen/Authz Hacks • Output Filter Hacks
  • 9. Agenda• • 20 90 →•• mod_perl
  • 10. mod_perl
  • 11. mod_perl• mod_perl Perl CGI• mod_perl Apache Perl• (#5) mod_perl Slideshare
  • 12. mod_perl• mod_perl2• mod_perl1(Apache1.x) …•
  • 13. PHP
  • 14. PHPhttp://ja.wikipedia.org/wiki/PHP:_Hypertext_Preprocessor
  • 15. PHP• IT• Perl Monger!! Hokkaido.pm!!• PHP
  • 16. PHP• PHP•• Perl Monger• PHP (ry
  • 17. PHP•※ ( )
  • 18. PHP•※
  • 19. • PHP dis•
  • 20. PHP
  • 21. • PHP …• PHP• Perl• …
  • 22. mod_perl hacks PHP
  • 23. mod_perl hacks PHP• PHP mod_perl • PHP • PHP …
  • 24. :mod_perl2 PerlChildInitHandler PerlPostReadRequestHandler PerlInitHandler PerlTransHandler PerlMapToStorageHandler PerlHeaderParserHandler PerlAccessHandler PerlAuthenHandler PerlAuthzHandler PerlTypeHandler PerlFixupHandler PerlFixupHandler PerlResponseHandler PerlLogHandler PerlCleanupHandler PerlChildExitHandler※Apache2 /※ http://perl.apache.org/docs/2.0/user/config/config.html
  • 25. Apache2 / mod_perl2 ※ Practical mod_perl
  • 26. Apache2 / mod_perl2
  • 27. • Q: PHP PerlResponseHandler Apache2• A: ( ) • PHP ※
  • 28. …• Apache LL … … • Tomcat • FastCGI / mod_{ } • PHP
  • 29. Authen/Authz Hacks
  • 30. Authen/Authz Hacks• PHP • php.ini • PHP session_start()•
  • 31. Authen/Authz Hacks• php.ini session_*() …• Perl … • →PHP (SSO)
  • 32. Cookie
  • 33. Cookie• sub handler { my $r = shift; ... }• Raw Cookie HTTP::Cookies• Apache2 (libapreq) Apache2::Cookie APR::Request::Cookie
  • 34. AAA••3 • PerlAccessHandler • PerlAuthenHandler • PerlAuthzHandler
  • 35. CPAN Module ofApache2::AuthCookie*
  • 36. CPAN Module ofApache2::AuthCookie*• Apache2::AuthCookie• Apache2::AuthCookie•
  • 37. Output Filter Hacks
  • 38. Output Filter Hacks• PHP• Apache PHP ob_*
  • 39. Output Filter Hacks• • PHP Perl • i-mode Softbank (Perl )
  • 40. Output Filter• Filter sub handler { ... } $r (Request Object) $f (Filter Object)• PerlOutputFilterHandler
  • 41. Output Filter<VirtualHost *:80> <FilesMatch “.*(html?|php)$”> PerlOutputFilterHandler MyApache2::FilterObfuscate </FilesMatch></VirtualHost>
  • 42. Output Filter
  • 43. DEMO
  • 44. Filter• pipe Apache2.1 mod_filter• ”*.html” pipe w3m text/plain
  • 45. Filter
  • 46. • Apache PHP mod_perl• PHP mod_perl
  • 47. • Web mod_perl• mod_perl2 • APR:: Apache2:: ModPerl::• LL Perl
  • 48. Perl• Perl Perl
  • 49. Perlhttp://d.hatena.ne.jp/syohex/20111110/1320938963
  • 50. Perl• WAF Apache•• mod_perl
  • 51. Perl• mod_perl• mod_perl(1 and 2)•• Twitter
  • 52. • mod_perl2 User’s Guide (Onyx Neon 2007; http://modperl2book.org/)