¦p¦ó±N§Aªºproject¥Ø¿ý¥[±K

¤@¡B«Ø¥ß.htaccessÀÉ®×
­º¥ýlogin cyber.cs.ntou.edu.tw¡A¦b§A­n«OÅ@ªº¥Ø¿ý¤U«Ø¥ß¤@­Ó¦W¬°.htaccess ¤º®e¬°


  # ÀH«K¨ú­Ó¦W¦r§a¡A¥¦·|¥X²{¦bÂsÄý¾¹ªºÂÛ¥Xµøµ¡¤¤¡C
  AuthName °ê¥ß»OÆW®ü¬v¤j¾Ç¸ê°T¨t³q°T¿ý¬d¸ß

  # ½s½X¤è¦¡¡A¥Ø«e¥u¤ä´©Basic¤@ºØ¦Ó¤w¡C
  AuthType Basic

  # ±K½XÀɪºµ´¹ï¸ô®|¡A¥i¥Îhtpasswd«ü¥O«Ø¥ß
  # (.htpasswdÀÉ¥i¦bind.ntou.edu.tw¤W«Ø¦n¦A¶Ç¦^cyber.cs.ntou.edu.tw)¡C
  AuthUserFile /home/under/b86204/.htpasswd
  # ^^^^^^
  # §¦Û¤vªº±b¤á¦W

  # ­Y¤U­±¦³«ü©w require group¡A«h»Ý­ngroupÀɪºµ´¹ï¸ô®|¡C
  # AuthGroupFile /home/under/b86204/filename

  <Limit GET POST>
  require user franklin
  require user beef
  require user david
  require user huangant
  #^^^^^^^^^
  #¥iÆ[¬Ý§AªºProjectªºusername

  #require group my-users group2 ...
  </Limit>

¤G¡B«Ø¥ß.htpasswdÀÉ

«Ø¥ß¦¹Àɦ³³\¦h¤èªk¡A¥u­n§A¤F¸Ñ.htpasswdªº®æ¦¡ ®æ¦¡¦p¤U©Ò¥Ü:

franklin:Z4vr73LqdneRA
beef:RVN7zpfopMpiY
david:4mUlggYxqB4KQ
huangant:DtAmaQ49hJuWk

 ^^^^^^^ ^^^^^^^^^^^^^^^
username ¸gcrypt½s½X¹Lªº±K½X 

·íµM³Ì²³æªº¤èªk¡A´N¬O telnet ind.ntou.edu.tw³o¥x¥D¾÷¡A §Q¥Îhtpasswdµ{¦¡«Ø¥ß.htpasswd¡A¦A¶Ç¦^cyber.cs.ntou.edu.tw¡C ¤èªk¦p¤U©Ò¥Ü:

  % telnet ind.ntou.edu.tw
  (loginªº¹Lµ{²¤)

  % htpasswd -c htpasswd.txt franklin
  Adding password for franklin
  New password:
  Re-type new password:

  % htpasswd htpasswd.txtbeef
  Adding user beef
  New password:
  Re-type new password:

  (¨ä¾lªºusername ¤§±K½X«Ø¥ß¡A¦p¦P"htpasswd htpasswd.txt beef"¤@¯ë¡A
   ¥H¦¹Ãþ±À¡C¦pªG htpasswd µ{¦¡¦³¥ô¦óºÃ°Ý¡A¤£§«¥Î"htpasswd -h"¬d¬d)

  %ftp cyber.cs.ntou.edu.tw
  (ftp¹Lµ{²¤)

  ftp>mput htpasswd.txt
  ftp>bye

  %telnet cyber.cs.ntou.edu.tw
  (login¹Lµ{²¤)

  % mv htpasswd.txt .htpasswd

¤T¡B­n¦p¦ó¦bHomepage©ÎCGI¿ëÃѨº¤@­Óuser¦bÂsÄý¦¹¤@¥[±Kªº¥Ø¿ý? ¤£¥~¥G­n¨Ï¥ÎÀô¹ÒÅܼơA¦ý¬O»Ý­n¤@¨Ç«e¸m§@·~:

login cyber.cs.ntou.edu.tw«á¡A

% cp /usr/local/etc/httpd/cgi-bin/w3-msql ~/www/project
                                          ^^^^^^^^^^^^^
                                          Project location
% mv ~/www/project/w3-msql ~/www/project/w3-msql.cgi


¦b§A©I¥s§t¦³w3-msql»yªkªºhtmlÀɮɡA­n¥Î

"http://cyber.cs.ntou.edu.tw/~b86204/project/w3-msql.cgi/~b86204/project/project.html"
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                  your cgi                        your project file



¦p¦¹¤@¨Ó¡A´N¥i¥H¦bw3-msql¤¤¡A¥Î$REMOTE_USER±oª¾¥Ø«eªºuser¬O½Ö¤F¡C

¥|¡B¦p¦ó­­¨î¬Y¨Ç domain ªº¦s¨ú

AuthName Example

AuthType Basic

AuthUserFile /home/under/b86204/.htpasswd

AuthGroupFile /home/under/b86204/filename

<Limit GET>
order deny, allow

deny from all

allow from .ntou.edu.tw

</Limit>