mod_perl hacks PHP

2,431 views
2,339 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,431
On SlideShare
0
From Embeds
0
Number of Embeds
23
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

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
  • mod_perl hacks PHP

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

    ×