Mais conteúdo relacionado
Semelhante a Apache mod authまわりとか (20)
Apache mod authまわりとか
- 3. Apache Hooks
•
• Input filter
• Content generator
• Output filter
•
- 4. Input filter (1)
• post_read_request
• translate_name
• ex) mod_alias
• map_to_storage
• ex) <Directory />, <Files />, mod_proxy
• header_parser
• ex) mod_setenvif
- 5. Input filter (2)
• access_checker
• ex) mod_access, mod_authz_host
• check_user_id
• auth_checker
• type_checker
• fixups
- 6. Content generator
and Output filter
•
• Content generator
• mod_passenger, mod_cgi, ...
• Output filter
• mod_xsendfile
- 10. /cgi-bin/401.cgi
1: #!/usr/bin/ruby
2: STDERR.puts "Incoming CGI..."
3:
4: puts <<__RESULT__
5: Status: 401
6:
7: __RESULT__
8:
9: STDERR.puts "CGI done."
- 11. PUT /cgi-bin/401.cgi
$ curl localhost/cgi-bin/401.cgi
-T xcode_3.2.6_and_ios_sdk_4.3__final.dmg > /dev/null
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4237M 0 0 100 4237M 0 114M 0:00:37 0:00:37 --:--:-- 118M
==> access_log <==
::1 - - [05/Apr/2011:14:37:13 +0900] "PUT /cgi-bin/401.cgi HTTP/1.1" 401 -
==> error_log <==
[Tue Apr 05 14:37:50 2011] [error] [client ::1] Incoming CGI...
[Tue Apr 05 14:37:50 2011] [error] [client ::1] CGI done.
14:37:13 PUT
14:37:50
- 14. •
• ap_hook_auth_checker() hook
• ACCESS DENIED
• ap_hook_access_checker() hook
- 15. mod_auth_httprequest
•
• https://github.com/suzumura-ss/
mod_auth_httprequest
• URL HEAD 200(OK),
201(Created), 202(Accepted)
- 17. PUT /
HEAD /cgi-bin/auth.cgi
response
- 19. $ curl localhost/
-T xcode_3.2.6_and_ios_sdk_4.3__final.dmg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 4237M 100 475 0 0 90338 0 --:--:-- --:--:-- --:--:-- 0
==> access_log <==
127.0.0.1 - - [05/Apr/2011:17:57:34 +0900] "HEAD /cgi-bin/auth.cgi HTTP/1.1"
401 - "-" "mod_auth_httprequest/0.1 libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3
libidn/0.6.5"
127.0.0.1 - - [05/Apr/2011:17:57:34 +0900] "PUT /xcode%5F3%2E2%2E6%5Fand%5Fios
%5Fsdk%5F4%2E3%5F%5Ffinal%2Edmg HTTP/1.1" 401 475 "-" "curl/7.15.5 (i686-
redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5"
==> error_log <==
[Tue Apr 05 17:57:34 2011] [error] [client 127.0.0.1] Incoming CGI...
[Tue Apr 05 17:57:34 2011] [error] [client 127.0.0.1] CGI done.
Notas do Editor
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n