[펌]Color Hex Code List

ITWeb/개발일반 2008. 7. 30. 21:31
가끔.. 급하게 color hex code 가 필요 할때가 있더라구요.. ^^*
뭐.. 걍 검색해서 찾을 수도 있지만..
저도 걍.. 하나 정도는 스크랩 해서 가지고 있음 좋을것 같아서.. ㅎㅎ


ref. http://www.colourlovers.com/blog/2007/06/30/ultimate-html-color-hex-code-list/

Standard 16 Named Color Codes

 Black or 000000  Gray or 808080  Silver or C0C0C0  White or FFFFFF
 Navy or 000080  Blue or 0000FF  Teal or 008080  Aqua or 00FFFF
 Purple or 800080  Maroon or 800000  Red or FF0000  Fuschia or FF00FF
 Green or 008000  Lime or 00FF00  Olive or 808000  Yellow or FFFF00


216 Web Safe Color Codes

 
 000000  000033  000066  000099  0000CC  0000FF
 003300  003333  003366  003399  0033CC  0033FF
 006600  006633  006666  006699  0066CC  0066FF
 009900  009933  009966  009999  0099CC  0099FF
 00CC00  00CC33  00CC66  00CC99  00CCCC  00CCFF
 00FF00  00FF33  00FF66  00FF99  00FFCC  00FFFF
 330000  330033  330066  330099  3300CC  3300FF
 333300  333333  333366  333399  3333CC  3333FF
 336600  336633  336666  336699  3366CC  3366FF
 339900  339933  339966  339999  3399CC  3399FF
 33CC00  33CC33  33CC66  33CC99  33CCCC  33CCFF
 33FF00  33FF33  33FF66  33FF99  33FFCC  33FFFF
 660000  660033  660066  660099  6600CC  6600FF
 663300  663333  663366  663399  6633CC  6633FF
 666600  666633  666666  666699  6666CC  6666FF
 669900  669933  669966  669999  6699CC  6699FF
 66CC00  66CC33  66CC66  66CC99  66CCCC  66CCFF
 66FF00  66FF33  66FF66  66FF99  66FFCC  66FFFF
 990000  990033  990066  990099  9900CC  9900FF
 993300  993333  993366  993399  9933CC  9933FF
 996600  996633  996666  996699  9966CC  9966FF
 999900  999933  999966  999999  9999CC  9999FF
 99CC00  99CC33  99CC66  99CC99  99CCCC  99CCFF
 99FF00  99FF33  99FF66  99FF99  99FFCC  99FFFF
 CC0000  CC0033  CC0066  CC0099  CC00CC  CC00FF
 CC3300  CC3333  CC3366  CC3399  CC33CC  CC33FF
 CC6600  CC6633  CC6666  CC6699  CC66CC  CC66FF
 CC9900  CC9933  CC9966  CC9999  CC99CC  CC99FF
 CCCC00  CCCC33  CCCC66  CCCC99  CCCCCC  CCCCFF
 CCFF00  CCFF33  CCFF66  CCFF99  CCFFCC  CCFFFF
 FF0000  FF0033  FF0066  FF0099  FF00CC  FF00FF
 FF3300  FF3333  FF3366  FF3399  FF33CC  FF33FF
 FF6600  FF6633  FF6666  FF6699  FF66CC  FF66FF
 FF9900  FF9933  FF9966  FF9999  FF99CC  FF99FF
 FFCC00  FFCC33  FFCC66  FFCC99  FFCCCC  FFCCFF
 FFFF00  FFFF33  FFFF66  FFFF99  FFFFCC  FFFFFF

Red Based Tints and Shades

 FFFFFF  FFFFF9  FFFFEC  FFFFE8  FFFFDF  FFFFD2  FFFFC8  FFFFBF
 FFFFFF  FFFFF3  FFFFDA  FFFFD2  FFFFBF  FFFFA6  FFFF91  FFFF7F
 FFFFFF  FFFFED  FFFFC8  FFFFBB  FFFF9F  FFFF7A  FFFF5A  FFFF3F
 FFFFFF  FFFFEA  FFFFBD  FFFFAE  FFFF8C  FFFF60  FFFF39  FFFF19
 FFFFFF  FFFFE7  FFFFB6  FFFFA5  FFFF7F  FFFF4E  FFFF23  FFFF00
 EEEEEE  EEEED8  EEEEAA  EEEE9A  EEEE77  EEEE49  EEEE21  EEEE00
 CDCDCD  CDCDBA  CDCD92  CDCD85  CDCD66  CDCD3F  CDCD1C  CDCD00
 8B8B8B  8B8B7E  8B8B63  8B8B5A  8B8B45  8B8B2A  8B8B13  8B8B00
 FFF9FF  FFF9F9  FFF9EC  FFF9E8  FFF9DF  FFF9D2  FFF9C8  FFF9BF
 FFF3FF  FFF3F3  FFF3DA  FFF3D2  FFF3BF  FFF3A6  FFF391  FFF37F
 FFEDFF  FFEDED  FFEDC8  FFEDBB  FFED9F  FFED7A  FFED5A  FFED3F
 FFEAFF  FFEAEA  FFEABD  FFEAAE  FFEA8C  FFEA60  FFEA39  FFEA19
 FFE7FF  FFE7E7  FFE7B6  FFE7A5  FFE77F  FFE74E  FFE723  FFE700
 EED8EE  EED8D8  EED8AA  EED89A  EED877  EED849  EED821  EED800
 CDBACD  CDBABA  CDBA92  CDBA85  CDBA66  CDBA3F  CDBA1C  CDBA00
 8B7E8B  8B7E7E  8B7E63  8B7E5A  8B7E45  8B7E2A  8B7E13  8B7E00
 FFECFF  FFECF9  FFECEC  FFECE8  FFECDF  FFECD2  FFECC8  FFECBF
 FFDAFF  FFDAF3  FFDADA  FFDAD2  FFDABF  FFDAA6  FFDA91  FFDA7F
 FFC8FF  FFC8ED  FFC8C8  FFC8BB  FFC89F  FFC87A  FFC85A  FFC83F
 FFBDFF  FFBDEA  FFBDBD  FFBDAE  FFBD8C  FFBD60  FFBD39  FFBD19
 FFB6FF  FFB6E7  FFB6B6  FFB6A5  FFB67F  FFB64E  FFB623  FFB600
 EEAAEE  EEAAD8  EEAAAA  EEAA9A  EEAA77  EEAA49  EEAA21  EEAA00
 CD92CD  CD92BA  CD9292  CD9285  CD9266  CD923F  CD921C  CD9200
 8B638B  8B637E  8B6363  8B635A  8B6345  8B632A  8B6313  8B6300
 FFE8FF  FFE8F9  FFE8EC  FFE8E8  FFE8DF  FFE8D2  FFE8C8  FFE8BF
 FFD2FF  FFD2F3  FFD2DA  FFD2D2  FFD2BF  FFD2A6  FFD291  FFD27F
 FFBBFF  FFBBED  FFBBC8  FFBBBB  FFBB9F  FFBB7A  FFBB5A  FFBB3F
 FFAEFF  FFAEEA  FFAEBD  FFAEAE  FFAE8C  FFAE60  FFAE39  FFAE19
 FFA5FF  FFA5E7  FFA5B6  FFA5A5  FFA57F  FFA54E  FFA523  FFA500
 EE9AEE  EE9AD8  EE9AAA  EE9A9A  EE9A77  EE9A49  EE9A21  EE9A00
 CD85CD  CD85BA  CD8592  CD8585  CD8566  CD853F  CD851C  CD8500
 8B5A8B  8B5A7E  8B5A63  8B5A5A  8B5A45  8B5A2A  8B5A13  8B5A00
 FFDFFF  FFDFF9  FFDFEC  FFDFE8  FFDFDF  FFDFD2  FFDFC8  FFDFBF
 FFBFFF  FFBFF3  FFBFDA  FFBFD2  FFBFBF  FFBFA6  FFBF91  FFBF7F
 FF9FFF  FF9FED  FF9FC8  FF9FBB  FF9F9F  FF9F7A  FF9F5A  FF9F3F
 FF8CFF  FF8CEA  FF8CBD  FF8CAE  FF8C8C  FF8C60  FF8C39  FF8C19
 FF7FFF  FF7FE7  FF7FB6  FF7FA5  FF7F7F  FF7F4E  FF7F23  FF7F00
 EE77EE  EE77D8  EE77AA  EE779A  EE7777  EE7749  EE7721  EE7700
 CD66CD  CD66BA  CD6692  CD6685  CD6666  CD663F  CD661C  CD6600
 8B458B  8B457E  8B4563  8B455A  8B4545  8B452A  8B4513  8B4500
 FFD2FF  FFD2F9  FFD2EC  FFD2E8  FFD2DF  FFD2D2  FFD2C8  FFD2BF
 FFA6FF  FFA6F3  FFA6DA  FFA6D2  FFA6BF  FFA6A6  FFA691  FFA67F
 FF7AFF  FF7AED  FF7AC8  FF7ABB  FF7A9F  FF7A7A  FF7A5A  FF7A3F
 FF60FF  FF60EA  FF60BD  FF60AE  FF608C  FF6060  FF6039  FF6019
 FF4EFF  FF4EE7  FF4EB6  FF4EA5  FF4E7F  FF4E4E  FF4E23  FF4E00
 EE49EE  EE49D8  EE49AA  EE499A  EE4977  EE4949  EE4921  EE4900
 CD3FCD  CD3FBA  CD3F92  CD3F85  CD3F66  CD3F3F  CD3F1C  CD3F00
 8B2A8B  8B2A7E  8B2A63  8B2A5A  8B2A45  8B2A2A  8B2A13  8B2A00
 FFC8FF  FFC8F9  FFC8EC  FFC8E8  FFC8DF  FFC8D2  FFC8C8  FFC8BF
 FF91FF  FF91F3  FF91DA  FF91D2  FF91BF  FF91A6  FF9191  FF917F
 FF5AFF  FF5AED  FF5AC8  FF5ABB  FF5A9F  FF5A7A  FF5A5A  FF5A3F
 FF39FF  FF39EA  FF39BD  FF39AE  FF398C  FF3960  FF3939  FF3919
 FF23FF  FF23E7  FF23B6  FF23A5  FF237F  FF234E  FF2323  FF2300
 EE21EE  EE21D8  EE21AA  EE219A  EE2177  EE2149  EE2121  EE2100
 CD1CCD  CD1CBA  CD1C92  CD1C85  CD1C66  CD1C3F  CD1C1C  CD1C00
 8B138B  8B137E  8B1363  8B135A  8B1345  8B132A  8B1313  8B1300
 FFBFFF  FFBFF9  FFBFEC  FFBFE8  FFBFDF  FFBFD2  FFBFC8  FFBFBF
 FF7FFF  FF7FF3  FF7FDA  FF7FD2  FF7FBF  FF7FA6  FF7F91  FF7F7F
 FF3FFF  FF3FED  FF3FC8  FF3FBB  FF3F9F  FF3F7A  FF3F5A  FF3F3F
 FF19FF  FF19EA  FF19BD  FF19AE  FF198C  FF1960  FF1939  FF1919
 FF00FF  FF00E7  FF00B6  FF00A5  FF007F  FF004E  FF0023  FF0000
 EE00EE  EE00D8  EE00AA  EE009A  EE0077  EE0049  EE0021  EE0000
 CD00CD  CD00BA  CD0092  CD0085  CD0066  CD003F  CD001C  CD0000
 8B008B  8B007E  8B0063  8B005A  8B0045  8B002A  8B0013  8B0000


Green Based Tints and Shades

 FFFFFF  FFFFF9  FFFFEC  FFFFE8  FFFFDF  FFFFD2  FFFFC8  FFFFBF
 FFFFFF  FFFFF3  FFFFDA  FFFFD2  FFFFBF  FFFFA6  FFFF91  FFFF7F
 FFFFFF  FFFFED  FFFFC8  FFFFBB  FFFF9F  FFFF7A  FFFF5A  FFFF3F
 FFFFFF  FFFFEA  FFFFBD  FFFFAE  FFFF8C  FFFF60  FFFF39  FFFF19
 FFFFFF  FFFFE7  FFFFB6  FFFFA5  FFFF7F  FFFF4E  FFFF23  FFFF00
 EEEEEE  EEEED8  EEEEAA  EEEE9A  EEEE77  EEEE49  EEEE21  EEEE00
 CDCDCD  CDCDBA  CDCD92  CDCD85  CDCD66  CDCD3F  CDCD1C  CDCD00
 8B8B8B  8B8B7E  8B8B63  8B8B5A  8B8B45  8B8B2A  8B8B13  8B8B00
 F9FFFF  F9FFF9  F9FFEC  F9FFE8  F9FFDF  F9FFD2  F9FFC8  F9FFBF
 F3FFFF  F3FFF3  F3FFDA  F3FFD2  F3FFBF  F3FFA6  F3FF91  F3FF7F
 EDFFFF  EDFFED  EDFFC8  EDFFBB  EDFF9F  EDFF7A  EDFF5A  EDFF3F
 EAFFFF  EAFFEA  EAFFBD  EAFFAE  EAFF8C  EAFF60  EAFF39  EAFF19
 E7FFFF  E7FFE7  E7FFB6  E7FFA5  E7FF7F  E7FF4E  E7FF23  E7FF00
 D8EEEE  D8EED8  D8EEAA  D8EE9A  D8EE77  D8EE49  D8EE21  D8EE00
 BACDCD  BACDBA  BACD92  BACD85  BACD66  BACD3F  BACD1C  BACD00
 7E8B8B  7E8B7E  7E8B63  7E8B5A  7E8B45  7E8B2A  7E8B13  7E8B00
 ECFFFF  ECFFF9  ECFFEC  ECFFE8  ECFFDF  ECFFD2  ECFFC8  ECFFBF
 DAFFFF  DAFFF3  DAFFDA  DAFFD2  DAFFBF  DAFFA6  DAFF91  DAFF7F
 C8FFFF  C8FFED  C8FFC8  C8FFBB  C8FF9F  C8FF7A  C8FF5A  C8FF3F
 BDFFFF  BDFFEA  BDFFBD  BDFFAE  BDFF8C  BDFF60  BDFF39  BDFF19
 B6FFFF  B6FFE7  B6FFB6  B6FFA5  B6FF7F  B6FF4E  B6FF23  B6FF00
 AAEEEE  AAEED8  AAEEAA  AAEE9A  AAEE77  AAEE49  AAEE21  AAEE00
 92CDCD  92CDBA  92CD92  92CD85  92CD66  92CD3F  92CD1C  92CD00
 638B8B  638B7E  638B63  638B5A  638B45  638B2A  638B13  638B00
 E8FFFF  E8FFF9  E8FFEC  E8FFE8  E8FFDF  E8FFD2  E8FFC8  E8FFBF
 D2FFFF  D2FFF3  D2FFDA  D2FFD2  D2FFBF  D2FFA6  D2FF91  D2FF7F
 BBFFFF  BBFFED  BBFFC8  BBFFBB  BBFF9F  BBFF7A  BBFF5A  BBFF3F
 AEFFFF  AEFFEA  AEFFBD  AEFFAE  AEFF8C  AEFF60  AEFF39  AEFF19
 A5FFFF  A5FFE7  A5FFB6  A5FFA5  A5FF7F  A5FF4E  A5FF23  A5FF00
 9AEEEE  9AEED8  9AEEAA  9AEE9A  9AEE77  9AEE49  9AEE21  9AEE00
 85CDCD  85CDBA  85CD92  85CD85  85CD66  85CD3F  85CD1C  85CD00
 5A8B8B  5A8B7E  5A8B63  5A8B5A  5A8B45  5A8B2A  5A8B13  5A8B00
 DFFFFF  DFFFF9  DFFFEC  DFFFE8  DFFFDF  DFFFD2  DFFFC8  DFFFBF
 BFFFFF  BFFFF3  BFFFDA  BFFFD2  BFFFBF  BFFFA6  BFFF91  BFFF7F
 9FFFFF  9FFFED  9FFFC8  9FFFBB  9FFF9F  9FFF7A  9FFF5A  9FFF3F
 8CFFFF  8CFFEA  8CFFBD  8CFFAE  8CFF8C  8CFF60  8CFF39  8CFF19
 7FFFFF  7FFFE7  7FFFB6  7FFFA5  7FFF7F  7FFF4E  7FFF23  7FFF00
 77EEEE  77EED8  77EEAA  77EE9A  77EE77  77EE49  77EE21  77EE00
 66CDCD  66CDBA  66CD92  66CD85  66CD66  66CD3F  66CD1C  66CD00
 458B8B  458B7E  458B63  458B5A  458B45  458B2A  458B13  458B00
 D2FFFF  D2FFF9  D2FFEC  D2FFE8  D2FFDF  D2FFD2  D2FFC8  D2FFBF
 A6FFFF  A6FFF3  A6FFDA  A6FFD2  A6FFBF  A6FFA6  A6FF91  A6FF7F
 7AFFFF  7AFFED  7AFFC8  7AFFBB  7AFF9F  7AFF7A  7AFF5A  7AFF3F
 60FFFF  60FFEA  60FFBD  60FFAE  60FF8C  60FF60  60FF39  60FF19
 4EFFFF  4EFFE7  4EFFB6  4EFFA5  4EFF7F  4EFF4E  4EFF23  4EFF00
 49EEEE  49EED8  49EEAA  49EE9A  49EE77  49EE49  49EE21  49EE00
 3FCDCD  3FCDBA  3FCD92  3FCD85  3FCD66  3FCD3F  3FCD1C  3FCD00
 2A8B8B  2A8B7E  2A8B63  2A8B5A  2A8B45  2A8B2A  2A8B13  2A8B00
 C8FFFF  C8FFF9  C8FFEC  C8FFE8  C8FFDF  C8FFD2  C8FFC8  C8FFBF
 91FFFF  91FFF3  91FFDA  91FFD2  91FFBF  91FFA6  91FF91  91FF7F
 5AFFFF  5AFFED  5AFFC8  5AFFBB  5AFF9F  5AFF7A  5AFF5A  5AFF3F
 39FFFF  39FFEA  39FFBD  39FFAE  39FF8C  39FF60  39FF39  39FF19
 23FFFF  23FFE7  23FFB6  23FFA5  23FF7F  23FF4E  23FF23  23FF00
 21EEEE  21EED8  21EEAA  21EE9A  21EE77  21EE49  21EE21  21EE00
 1CCDCD  1CCDBA  1CCD92  1CCD85  1CCD66  1CCD3F  1CCD1C  1CCD00
 138B8B  138B7E  138B63  138B5A  138B45  138B2A  138B13  138B00
 BFFFFF  BFFFF9  BFFFEC  BFFFE8  BFFFDF  BFFFD2  BFFFC8  BFFFBF
 7FFFFF  7FFFF3  7FFFDA  7FFFD2  7FFFBF  7FFFA6  7FFF91  7FFF7F
 3FFFFF  3FFFED  3FFFC8  3FFFBB  3FFF9F  3FFF7A  3FFF5A  3FFF3F
 19FFFF  19FFEA  19FFBD  19FFAE  19FF8C  19FF60  19FF39  19FF19
 00FFFF  00FFE7  00FFB6  00FFA5  00FF7F  00FF4E  00FF23  00FF00
 00EEEE  00EED8  00EEAA  00EE9A  00EE77  00EE49  00EE21  00EE00
 00CDCD  00CDBA  00CD92  00CD85  00CD66  00CD3F  00CD1C  00CD00
 008B8B  008B7E  008B63  008B5A  008B45  008B2A  008B13  008B00


Blue Based Tints and Shades

 FFFFFF  F9FFFF  ECFFFF  E8FFFF  DFFFFF  D2FFFF  C8FFFF  BFFFFF
 FFFFFF  F3FFFF  DAFFFF  D2FFFF  BFFFFF  A6FFFF  91FFFF  7FFFFF
 FFFFFF  EDFFFF  C8FFFF  BBFFFF  9FFFFF  7AFFFF  5AFFFF  3FFFFF
 FFFFFF  EAFFFF  BDFFFF  AEFFFF  8CFFFF  60FFFF  39FFFF  19FFFF
 FFFFFF  E7FFFF  B6FFFF  A5FFFF  7FFFFF  4EFFFF  23FFFF  00FFFF
 EEEEEE  D8EEEE  AAEEEE  9AEEEE  77EEEE  49EEEE  21EEEE  00EEEE
 CDCDCD  BACDCD  92CDCD  85CDCD  66CDCD  3FCDCD  1CCDCD  00CDCD
 8B8B8B  7E8B8B  638B8B  5A8B8B  458B8B  2A8B8B  138B8B  008B8B
 FFF9FF  F9F9FF  ECF9FF  E8F9FF  DFF9FF  D2F9FF  C8F9FF  BFF9FF
 FFF3FF  F3F3FF  DAF3FF  D2F3FF  BFF3FF  A6F3FF  91F3FF  7FF3FF
 FFEDFF  EDEDFF  C8EDFF  BBEDFF  9FEDFF  7AEDFF  5AEDFF  3FEDFF
 FFEAFF  EAEAFF  BDEAFF  AEEAFF  8CEAFF  60EAFF  39EAFF  19EAFF
 FFE7FF  E7E7FF  B6E7FF  A5E7FF  7FE7FF  4EE7FF  23E7FF  00E7FF
 EED8EE  D8D8EE  AAD8EE  9AD8EE  77D8EE  49D8EE  21D8EE  00D8EE
 CDBACD  BABACD  92BACD  85BACD  66BACD  3FBACD  1CBACD  00BACD
 8B7E8B  7E7E8B  637E8B  5A7E8B  457E8B  2A7E8B  137E8B  007E8B
 FFECFF  F9ECFF  ECECFF  E8ECFF  DFECFF  D2ECFF  C8ECFF  BFECFF
 FFDAFF  F3DAFF  DADAFF  D2DAFF  BFDAFF  A6DAFF  91DAFF  7FDAFF
 FFC8FF  EDC8FF  C8C8FF  BBC8FF  9FC8FF  7AC8FF  5AC8FF  3FC8FF
 FFBDFF  EABDFF  BDBDFF  AEBDFF  8CBDFF  60BDFF  39BDFF  19BDFF
 FFB6FF  E7B6FF  B6B6FF  A5B6FF  7FB6FF  4EB6FF  23B6FF  00B6FF
 EEAAEE  D8AAEE  AAAAEE  9AAAEE  77AAEE  49AAEE  21AAEE  00AAEE
 CD92CD  BA92CD  9292CD  8592CD  6692CD  3F92CD  1C92CD  0092CD
 8B638B  7E638B  63638B  5A638B  45638B  2A638B  13638B  00638B
 FFE8FF  F9E8FF  ECE8FF  E8E8FF  DFE8FF  D2E8FF  C8E8FF  BFE8FF
 FFD2FF  F3D2FF  DAD2FF  D2D2FF  BFD2FF  A6D2FF  91D2FF  7FD2FF
 FFBBFF  EDBBFF  C8BBFF  BBBBFF  9FBBFF  7ABBFF  5ABBFF  3FBBFF
 FFAEFF  EAAEFF  BDAEFF  AEAEFF  8CAEFF  60AEFF  39AEFF  19AEFF
 FFA5FF  E7A5FF  B6A5FF  A5A5FF  7FA5FF  4EA5FF  23A5FF  00A5FF
 EE9AEE  D89AEE  AA9AEE  9A9AEE  779AEE  499AEE  219AEE  009AEE
 CD85CD  BA85CD  9285CD  8585CD  6685CD  3F85CD  1C85CD  0085CD
 8B5A8B  7E5A8B  635A8B  5A5A8B  455A8B  2A5A8B  135A8B  005A8B
 FFDFFF  F9DFFF  ECDFFF  E8DFFF  DFDFFF  D2DFFF  C8DFFF  BFDFFF
 FFBFFF  F3BFFF  DABFFF  D2BFFF  BFBFFF  A6BFFF  91BFFF  7FBFFF
 FF9FFF  ED9FFF  C89FFF  BB9FFF  9F9FFF  7A9FFF  5A9FFF  3F9FFF
 FF8CFF  EA8CFF  BD8CFF  AE8CFF  8C8CFF  608CFF  398CFF  198CFF
 FF7FFF  E77FFF  B67FFF  A57FFF  7F7FFF  4E7FFF  237FFF  007FFF
 EE77EE  D877EE  AA77EE  9A77EE  7777EE  4977EE  2177EE  0077EE
 CD66CD  BA66CD  9266CD  8566CD  6666CD  3F66CD  1C66CD  0066CD
 8B458B  7E458B  63458B  5A458B  45458B  2A458B  13458B  00458B
 FFD2FF  F9D2FF  ECD2FF  E8D2FF  DFD2FF  D2D2FF  C8D2FF  BFD2FF
 FFA6FF  F3A6FF  DAA6FF  D2A6FF  BFA6FF  A6A6FF  91A6FF  7FA6FF
 FF7AFF  ED7AFF  C87AFF  BB7AFF  9F7AFF  7A7AFF  5A7AFF  3F7AFF
 FF60FF  EA60FF  BD60FF  AE60FF  8C60FF  6060FF  3960FF  1960FF
 FF4EFF  E74EFF  B64EFF  A54EFF  7F4EFF  4E4EFF  234EFF  004EFF
 EE49EE  D849EE  AA49EE  9A49EE  7749EE  4949EE  2149EE  0049EE
 CD3FCD  BA3FCD  923FCD  853FCD  663FCD  3F3FCD  1C3FCD  003FCD
 8B2A8B  7E2A8B  632A8B  5A2A8B  452A8B  2A2A8B  132A8B  002A8B
 FFC8FF  F9C8FF  ECC8FF  E8C8FF  DFC8FF  D2C8FF  C8C8FF  BFC8FF
 FF91FF  F391FF  DA91FF  D291FF  BF91FF  A691FF  9191FF  7F91FF
 FF5AFF  ED5AFF  C85AFF  BB5AFF  9F5AFF  7A5AFF  5A5AFF  3F5AFF
 FF39FF  EA39FF  BD39FF  AE39FF  8C39FF  6039FF  3939FF  1939FF
 FF23FF  E723FF  B623FF  A523FF  7F23FF  4E23FF  2323FF  0023FF
 EE21EE  D821EE  AA21EE  9A21EE  7721EE  4921EE  2121EE  0021EE
 CD1CCD  BA1CCD  921CCD  851CCD  661CCD  3F1CCD  1C1CCD  001CCD
 8B138B  7E138B  63138B  5A138B  45138B  2A138B  13138B  00138B
 FFBFFF  F9BFFF  ECBFFF  E8BFFF  DFBFFF  D2BFFF  C8BFFF  BFBFFF
 FF7FFF  F37FFF  DA7FFF  D27FFF  BF7FFF  A67FFF  917FFF  7F7FFF
 FF3FFF  ED3FFF  C83FFF  BB3FFF  9F3FFF  7A3FFF  5A3FFF  3F3FFF
 FF19FF  EA19FF  BD19FF  AE19FF  8C19FF  6019FF  3919FF  1919FF
 FF00FF  E700FF  B600FF  A500FF  7F00FF  4E00FF  2300FF  0000FF
 EE00EE  D800EE  AA00EE  9A00EE  7700EE  4900EE  2100EE  0000EE
 CD00CD  BA00CD  9200CD  8500CD  6600CD  3F00CD  1C00CD  0000CD
 8B008B  7E008B  63008B  5A008B  45008B  2A008B  13008B  00008B





:

apache+tomcat+jdk 설치 및 연동

ITWeb/서버관리 2008. 7. 30. 12:38

Download
* http://java.sun.com/javase/downloads/index_jdk5.jsp
JDK 5.0 Update 16 다운로드 받음
http://java.sun.com/j2se/1.5.0/install-linux.html

* http://httpd.apache.org/download.cgi
httpd-2.2.9.tar.gz

* http://tomcat.apache.org/
apache-tomcat-6.0.16.tar.gz

* http://tomcat.apache.org/connectors-doc/
tomcat-connectors-1.2.26-src.tar.gz
mod_jk-1.2.26-httpd-2.2.6.so

Installation
* JDK 설치
download 경로 및 설치 시작 위치 : /home/app/download/
설치 경로 : /home/app/java/jdk
설치하기
파일권한변경
$ /home/app/download/]chmod 744 jdk-1_5_0_16-linux-i586.bin
$ /home/app/download/]./jdk-1_5_0_16-linux-i586.bin
약관같은 내용 스킵(q 누르고 빠져 나옴)
yes 입력후 설치 시작
$ /home/app/download/]cd jdk1.5.xxx
$ /home/app/download/]mv -f * /home/app/java/jdk
$ /home/app/download/]cd ..
$ /home/app/download/]rm -rf ./jdk1.5.xxx
JAVA_HOME 과 path 설정
.cshrc 기준
setenv JAVA_HOME "/home/app/java/jdk"
set path=( $path $JAVA_HOME/bin )

기 설치된 java 삭제 (rpm 설치)
설치 pkg 확인 (root 로 실행)
삭제 및 java version 확인
$ /home/app/download/]rpm -qif /usr/lib/jvm/jre-1.4.2-gcj/bin/java
$ /home/app/download/]rpm -e java-1.4.2-gcj-compat
$ /home/app/download/]java -version

* tomcat 설치
$ /home/app/download/] tar -xvzf apache-tomcat-6.0.16.tar.gz
$ /home/app/download/]mv -f ./apache-tomcat-6.0.16 ../tomcat

.cshrc 기준
setenv CATALINA_HOME "/home/app/tomcat"
set path=( $path $CATALINA_HOME/bin )

tomcat 설치 테스트
$ /home/app/tomcat/bin]startup.sh

http://localhost:8080/

* apache 설치
# jsp 를 사용하기 땜시 기본 설치 합니다.
$ /home/app/download/httpd-2.2.9]./configure --prefix=/home1/irteam/naver/apache-2.2.9 --enable-so --with-mpm=worker
$ /home/app/download/httpd-2.2.9]make clean
$ /home/app/download/httpd-2.2.9]make
$ /home/app/download/httpd-2.2.9]make install

* apache tomcat connector
apache 와 tomcat 을 연동하기 위해서 설치
ref. ttp://tomcat.apache.org/connectors-doc/webserver_howto/apache.html
ref. http://www.akadia.com/download/soug/tomcat/html/tomcat_apache.html

    • source build 하기
      tar -xvzf tomcat-connectors-1.2.26-src.tar.gz
      cd tomcat-connectors-1.2.26-src/native
      ./buildconf.sh
      ./configure --with-apxs=/home/app/apache-2.2.9/bin/apxs ## <-- apxs 가 설치된 위치 지정
      make
      make install
      cd apache-2.0 ## <-- 들어가 보시면 mod_jk.so 가 생성되어 있습니다. apache 설치 경로의 ~/modules/ 아래 보시면 mod_jk.so 가 복사되어 있지 않으면 복사해서 넣기
    • httpd.conf 수정하기
      # tomcat.conf 설정은 LoadModule 설정 최상단에 위치
      # apache module load 순서와 연관
      include conf/tomcat.conf
      include extra/httpd-vhost.conf
    • tomcat.conf 수정하기
      # JkMount 와 같은 option 들은 virtualhost 설정에서 잡아주고 
      # 아래는 공통 설정
      LoadModule jk_module modules/mod_jk.so
      
      JkWorkersFile           conf/workers.properties
      JkShmFile               /home/app/logs/apache/mod_jk.shm
      JkLogFile               /home1/app/logs/apache/mod_jk.log
      JkLogLevel              debug
      JkLogStampFormat        "[%a %b %d %H:%M:%S %Y] "
      JkRequestLogFormat  "%w %V %T"
    • workers.properties 수정하기
      workers.tomcat_home=/home/app/tomcat
      workers.java_home=/home/app/java/jdk
      
      ps=/
      worker.list=tebs ## <-- tebs 는 property 또는 서비스 명
      
      worker.tebs.port=8009
      worker.tebs.host=localhost
      worker.tebs.type=ajp13
      worker.tebs.lbfactor=1
    • extra/httpd-vhost.conf 수정하기
      NameVirtualHost *
      
      #
      # VirtualHost example:
      # Almost any Apache directive may go into a VirtualHost container.
      # The first VirtualHost section is used for all requests that do not
      # match a ServerName or ServerAlias in any <VirtualHost> block.
      #
      <VirtualHost *>
          ServerName localhost
          ServerAlias localhost
          ServerAdmin admin@localhost
          DocumentRoot "/home/app/docs/tebs/web"
      
          ErrorLog "/home/app/logs/apache/error"
          CustomLog "/home/app/logs/apache/access" common
      
          JkMount             /*.jsp  tebs # 또는 /* tebs
      
      # htdocs 위치는 아래와 같음.
          <Directory "/home/app/docs/tebs/web">
              AllowOverride None
              Order deny,allow
              Allow from all
          </Directory>
      # 접근 금지
          <Directory "/home/app/docs/tebs/web/WEB-INF">
              AllowOverride None
              Order deny,allow
              Deny from all
              Allow from none
          </Directory>
      # 접근 금지
          <Directory "/home/app/docs/tebs/web/META-INF">
              AllowOverride None
              Order deny,allow
              Deny from all
              Allow from none
          </Directory>
      </VirtualHost>
    • server.xml 수정
      # 위치는 tomcat 설치 위치의 /home/app/tomcat/conf/server.xml
      # 기본 tomcat context root 변경을 위해서 아래와 같이 apache htdocs 설정한 경로로 변경
      <Host name="localhost"  appBase="/home/app/docs/tebs/web"
                  unpackWARs="true" autoDeploy="true"
                  xmlValidation="false" xmlNamespaceAware="false">
              <Context path="" docBase="." debug="0" reloadable="true"></Context>
      </Host>
    • jsp 파일 테스트

      아래 apache 와 tomcat 의 실행 순서 매우 중요
      tomcat daemon 이 먼저 떠 있어야 mod_jk 가 apache 모듈로 load 될때 정상적으로 connect 할 수 있음
      아파치설치경로/bin/apachectl stop
      톰켓설치경로/bin/shutdown.sh
      톰켓설치경로/bin/startup.sh
      아파치설치경로/bin/apachectl start
      # htdocs 로 이동
      cd /home/app/tomcat/webapps/ROOT // 또는 /home/app/tomcat/webapps서비스명 또는 프로젝트명/
      vi index.jsp
      # 브라우저에서 접속 테스트




 






 

:

[펌]최신 해킹 공격 동향

ITWeb/스크랩 2008. 7. 29. 13:57
음냐.. 무단전개 및 재배포 금지 라는데.. 이러다 잡혀 가는건 아닌지 모르겠내.. ㅡ.ㅡ;
(보안 뉴스 관계자님.. 나쁜 목적으로 개재 하는거 아닙니다.. 용서해 주세요.. ^^;)

아래 글은.. 읽어 보면.. IIS 에서 발생 하는 sql injection 에 대한 부분이다.

뭐.. 최소한의 input validation 만 거쳤어도.. 이런것들은.. 충분히 막을 수 있을텐데..
client side 에서 한번 거르고.. server side 에서 또 한번 거르고..
보안을 강화 하게 되면 사용성이나 퍼포먼스에 영향을 줄수 있겠지만.. 한번 뚤리면.. 그 악효과는.. 뭐.. 말하지 않아도.. 잘.. ^^*

암튼.. 장단점을 잘 활용하여.. 개발 합시다.. ㅎㅎ

ref. http://www.boannews.com/media/view.asp?idx=10729&kind=&sub_kind=

최신 해킹 공격 동향
[입력날짜: 2008-07-25]

  

Web Security Solution All Guide

Chapter 3. 웹 보안 전문가 노하우 훔쳐보기

 

적절한 보안대책 마련해야


2008 년 4월 초부터 전 세계 130만개 이상의 웹 사이트에 악성코드를 유포하는 SQL-Injection공격 코드가 숨어있는 것이 밝혀져 최근 가장 큰 이슈가 되고 있다. 하지만 언론으로부터 알려진 것은 4월이지만 보안전문가들 사이에서 이슈가 된 것은 2008년 1월 초부터이다. 처음 알려진 것은 아파치 보안 모듈인 Mod Security 프로젝트의 블로그에 공개되면서부터인데 우리나라의 많은 사이트들이 지금 현재도 공격을 받고 있는 중이다.


공 격 기법의 명칭은 Mass SQL-Injection이라 불리우며 기존의 SQL-Injection 기법보다 확장된 개념이다. 크게 2가지 방식으로 공격이 되며 공격 쿼리의 일부분을 HEX인코딩하거나 전체 쿼리를 HEX 인코딩하여 보안장비와 필터링 설정을 우회하는 기법이다.

Mass 라는 단어의 사전적인 의미는 대량의, 집단이라는 뜻을 가지고 있다. 즉, 한 번의 공격으로 대량의 DB값이 변조가 되어 해당 웹 사이트에 치명적인 악영향을 준다. DB값 변조 시 악성 스크립트를 삽입하여 이용자들이 감염되거나 봇이 설치되어 DDoS공격에 좀비컴퓨터로 이용이 가능해진다.

이 러한 Mass SQL-Injection은 IIS 환경의 MS-SQL을 사용 중인 ASP 기반 웹 애플리케이션에만 발생하며 언론에서 몇 차례 피해 사실을 보도하기도 했다. 피해를 당한 IIS의 로그를 보면 다음과 같은 로그가 기록되어 있다.


     


공격 코드의 중간 중간 00을 제거하고 ASCII 코드로 디코딩을 해보면 ;

 

    


다 음과 같은 SQL 쿼리가 나타난다. 이 구문은 테이블에서 테이블의 SQL sysobject type U(User) 모든 row를 가져오는 것이다. 모든 컬럼을 varcher(8000)으로 형식을 바꾸고 커서를 활용하여 각 오브젝트에 http://bannerupd.com/b.js 사이트 주소 코드를 추가하도록 업데이트 명령을 실행 시키는 일반적인 구문이다. 일반적인 구문에서 현재는 약간 변형된 형태의 공격쿼리 삽입시도도 이루어지고 있다.


       


스크립트 삽입 부분에서 일반적인 삽입형태와 달라진 부분은 "></tile>이 추가 된다.

기 존 <스크립트 ....></스크립트>와 다른 점은 ">추가 만으로 <input name="test" value=" ">과 같은 곳에 test의 값으로 삽입 될때 기존 스크립트는 단지value 값으로 스크립트가 실행이 되지 않지만 ">의 추가로 value 값이 정상적으로 닫히고 스크립트가 삽입되게 된다.

물 론 그 밖의 경우에도 "></title>부분은 무시되고 스크립트가 삽입되게 된다. 단순히 js 파일명을 바꿔가면서 웹셀 업로드 하는 것과는 다르게 모든 삽입되는 곳에서  스크립트가 실행 가능하도록 하게 만든 패턴이다. DB 테이블 중에서 TEXT 형태로 된 컬럼을 찾아서 <스크립트 src=http://s.see9.us/s.js></스크립트>를 추가한다. varchar 형태의 컬럼에는 <스크립트 src=http://s.see9.s.js></스크립트>이 추가되며 문제는 모든 테이블의 컬럼에 적용이 된다는 것이다.


이에 해당하는 공격을 사전에 방지하기 위해서는 아래와 같은 대책이 필요하다.

1. 디클리어 구문을 이용한 공격을 차단하기 위해서는 웹 소스상에서 쿼리스트링에 대한 길이제한 적용을 해야 한다. 대부분 소스 작성시 쿼리스트링 값의 제한을 적용하지 않는 경우가 많음. 따라서 웹 개발자와 상의하여 쿼리스트링 길이 값에 대한 제한을 적용 권고

2. SQL-Injection 취약점이 있으면 중·장기 대책으로 이에 대한 소스코드에 수정 권고

3. 입력되는 부분의 문자를 모두 제한하여 예상되는 문자 이외의 문자가 들어오면 필터링하는 방법으로 수정 필요

4. 정기적인 DB 및 시스템 백업 필요


또 한 디클리어 구문을 이용한 공격을 차단하기 위해서는 웹 소스상에서 쿼리스트링에 대한 길이 제한 적용을 해야 한다. 대부분 소스 작성시 쿼리스트링 값의 제한을 적용하지 않는 경우가 많다. 따라서 웹 개발자와 상의하여 쿼리스트링 길이 값에 대한 제한을 적용해야 한다.

<글· 박종성 NSHC 연구원(jspark@nshc.net)>

[정보보호21c (info@boannews.com)]


<저작권자: 보안뉴스(www.boannews.com) 무단전재-재배포금지>


:

[펌]Chapter 1. 웹 보안의 개념과 이해

ITWeb/스크랩 2008. 7. 29. 13:51
개발자 입장에서 보안은 참 중요한것 같다.
하지만 이런 보안에 대한 경험이 뒷받침 되지 않고서는 보안을 유지 하기가 쉽지 않다.
당연한 말이지만.. 방어 하는 자와 공격 하는자.. 과연 누가 이길까???

제일 아래 10가지 고려사항에 대해서 고민을 해보고 그에 적절한 개발을 하는것 역시 중요 하다.
무조건 장비만 도입 한다고 해서 모든게 해결 되지는 않을 테니..

몇몇 개발자 분들의 코드를 확인해 봤는데.. xss 와 sql injection 에 정말 대책 없이 개발 되어 있는걸 봤다..
열심히 설명은.. 해보겠으나.. 받아 들일 준비들이 안된듯.. 음냐..

모르면.. 배웁시다.. 고집 피우지 말고... ^^*


ref. http://www.boannews.com/know_how/view.asp?idx=2161&search=title&find=%B5%BF%C7%E2

Web Security Solution All Guide

Chapter 1. 웹 보안의 개념과 이해

 

Frost& Sullivan의 보고서는 이미 2004년 웹 애플리케이션 보안 시장이 전년대비 성장률 66.5%를 시작으로 매년 전년대비 50% 이상 급속도로 성장할 것으로 전망했다. 또한 웹에 대한 시장요구 사항이 변화됨에 따라 이를 반영하여 보안 영역을 구분했다.

 

예 를 들어 미국의 체크포인트사의 경우 네트워크 보안과 웹 보안, 내부 보안으로 영역을 구분하고 이 가운데 웹 보안이 가장 급속도로 성장할 것으로 예측했으며 관련 제품의 라인업을 갖추려고 노력하고 있다. 이 와는 별도로 웹을 포함한 메신저, 메일 등을 포함하는 애플리케이션 보안 분야에 중점을 두고 향후 이 시장이 급속히 성장할 것으로 예측하고 있다.


양 키그룹(Yankee Group)은 ‘Application Gateways Secure Business Communications’라는 보고서에서 이들 애플리케이션 보안을 전담하는 게이트웨이 시장을 분석하고 향후 20억 달러 이상의 시장을 형성할 것으로 예상했다. 각각의 기관이 조사한 자료에 따라 수치가 차이가 나긴 하지만 웹 애플리케이션 보안에 대한 수요의 폭발적 증가와 관련 시장의 성장을 동일하게 나타내고 있다.

 

특 히 기업이나 공공기관 애플리케이션 전산 환경이 하루가 다르게 웹 기반으로 바뀌고 있다. 언제 어디서나 내부망에 접속할 수 있으며 대 국민이나 고객대응에 대한 다양한 정보를 손쉽게 공유할 수 있다는 편리함이 그 이유이기 때문이다. 그러나 이러한 환경은 웹 특성상 서비스를 위해 80포트(HTTP)나 443포트 같은(HTTPS)같은 통로를 열어놔야 하는 구조상 근본적인 취약점을 안고 있다. 이에 따라 이곳을 통해 웹 프로그램의 설정 오류나 개발 오류로 인한 웹 애플리케이션 자체의 취약점을 이용한 홈 페이지와 웹 서버 해킹이 시도될 수 있다. 이러한 서비스 포트를 통한 침입 공격의 유형의 85% 이상이 웹 애플리케이션 서비스 포트를 통한 공격이다.

 

실 제로 웹 고객 정보를 빼돌리거나 콘텐츠 변조, 서비스거부공격(DoS), 홈페이지 위·변조, 내부 중요 시스템의 침입 등 해킹 사고가 최근 들어 눈에 띄게 늘고 있다. 업계 자료에 따르면 국내에서 발생된 해킹 시도의 70% 가량이 웹 애플리케이션의 취약점을 이용한 것으로 추정되고 있다.

웹 애플리케이션을 통한 보안 사고는 PHP 취약점 및 제로보드·그누보드·코웹로그 등 웹 게시판 프로그램의 취약점을 이용한 해커그룹이 홈페이지를 무차별 변조하면서 발생한 현상으로 전 세계적으로 ‘주의경보’ 발령과 더불어 즉각적인 수정 및 패치 업그레이드를 권장하고 있다.

 

당 시 구글 등 인터넷 검색엔진을 이용해 관련 취약점이 패치되지 않은 웹 서버들을 찾아 해킹 한 것으로 판단되며 단시일 내에 700여개 홈페이지가 변조되었고 이중 450개는 한 해커그룹에 의해 이뤄지기도 했다. 이는 하나의 취약성으로 인해 얼마나 많은 시스템이 피해를 입을 수 있는지를 보여준 사건이었다.

 

이 와 같은 사건에 대한 웹 보안 강화 방법으로 제일 먼저 고려할 수 있는 것은 개발자의 웹 프로그래밍 시 코드상의 오류를 근본적으로 고치는 것이다. 하지만 대부분의 웹 애플리케이션 프로젝트에서는 서비스의 편의성 및 기능 구현을 중요시하는 풍조, 프로젝트 오픈 완료 일정에 따른 소스 보안검증의 부실함으로 인해, 개발자 스스로도 취약성을 인지하면서도 보안성 강호를 무시하여 많은 취약성을 가진 웹 애플리케이션이 구축되는 경우가 많다.

 

그 러나 시스템 오픈 후 취약성이 존재하는 소스를 일일이 찾아내어 고친다는 것은 많은 시간과 비용을 필요로 하며 보안성 강화를 통한 프로세스의 변경 및 재개발, 성능 저하에 대한 우려를 이유로 대부분의 웹 사이트가 사고 발생 전까지 무방비 상태로 놓이게 되며 큰 사고로 연결되기도 한다. 초기 보안시스템의 이슈는 방화벽으로부터 시작해 침입탐지시스템(IDS) 또는 침입방지시스템(IPS)을 웹 서버의 앞 단에 구축해 불법적인 침입을 막는 역할을 했다.

 

이 러한 보안 시스템은 1세대 또는 2세대 보안시스템으로서 불특정한 침입자에 대한 보안을 하기 위한 것으로 네트워크 레벨에서 사용하지 않거나 인증되지 않은 포트를 차단하고 패킷에 대한 필터링을 통해서 비정상적인 침입자를 차단하기 위한 기능이 주였다.


그 러나 여기에는 커다란 문제가 존재한다. 웹의 특성상 방화벽을 설치하더라도 사용되는 서비스 포트는 항상 개방해야 하기 때문에 웹 서비스 포트를 통한 공격에 대해서는 무방비 상태로 노출된다는 것이다. 최근 지원영역을 애플리케이션 단까지 확장한 DPI(Deep Packet Inspection) 방화벽이나 IPS가 출시되고 있으나 네트워크 레벨 기반의 보안 시스템에서 애플리케이션 레벨의 방어를 하는 데는 한계를 갖고 있을 수 밖에 없다. 이들은 주로 시그니처에 의존한 패턴 매칭기술을 기반으로 애플리케이션 영역의 ‘이미 알려진’ 공격만을 차단하기 때문에 패턴데이터에 저장되지 않은 웹 애플리케이션 공격을 탐지하거나 기업에서 자체적으로 개발한 웹 애플리케이션의 취약점을 이용한 시그니처를 제공하지 못하는 한계가 있다.


CC인증 획득이 시장 선점의 열쇠

현 재 웹 방화벽은 제품의 기능이나 성능에 대한 검증이 어려워 CC인증 여부가 제품 구매의 주요 기준이 되고 있다. 따라서 CC인증의 중요성이 높고 기술적 경쟁력이 바탕이 된 제품의 CC인증 획득이 시장의 판도를 잡는 열쇠가 될 것으로 업계 관계자들은 내다보고 있다. 아울러 최근의 웹 해킹에 따른 웹 방화벽의 필요성과 관심이 증가함에 따라 올해 웹 방화벽 시장은 큰 상승세가 예상되고 있다. 특히 기존 많은 보안 업체들이 웨 방화벽을 개발하고 CC 인증을 획득하고 이를 준비하고 있어 공공기관을 중심으로 많이 도입될 것으로 전망되고 있다. 특히 CC 인증이 공공기관 납품에 있어 중요한 요소이기 때문에 각 업체들은 CC인증에 대해 촉각을 곤두세우고 있다.


올 해 추가 인증제품이 등장함에 따라 각 보안담당자들은 제품의 선택폭이 넓어졌다. 특히 제품의 기능 및 안정성 등 기술적인 면에서 치열한 경쟁이 전개될 전망이다. 그러나 업체간 지나친 과열경쟁으로 인한 가격적인 출혈경쟁이 있어서는 안 될 것이다. 한편 지난 해부터 공공기관을 중심으로 웹 방화벽의 도입이 이어지고 있어 향후 웹 방화벽 시장은 공공기관을 중심으로 확대될 전망이다.


웹 방화벽 도입시 고려사항


1. 기존 구성된 네트워크 환경 변경 없이 설치가 편리한가?

2. OWASP 10대 취약성 및 국가정보원 8대 웹 보안 취약점에 대한 보안 기능 수행을 하는가?

3. 피싱 같은 홈페이지 위·변조 해킹 공격이 들어와도 서비스는 자동 복구되어 연속적인 서비스가 지원되는가?

4. 웹 페이지 또는 웹 메일 내용에서 개인정보(주민등록번호, 카드번호, 계좌번호 등등)에 해당하는 내용까지 탐지 및 차단이 가능한가?

5. 게시판이나 웹메일에서 업로드 또는 다운로드되는 첨부파일에 대한 개인정보 탐지 및 차단이 가능한가?

6. 보안정책 및 관리부문에서 운영자의 편의성을 제공하는가?

7. 관리자 권한 제어 및 감사내역을 제공하는가?

8. 로그 정보를 통해 관리자가 직관하여 상황을 판단할 수 있는 유용한 정보를 제공하는가?

9. 문제 발생시 운영자가 알 수 있도록 알람 기능이 제공되는가?

10. 다양하고 고도화도어 가는 해킹에 대해 대응할 수 있는 방안이 있는가?

11. 실시간 서비스를 지원하기 위한 웹 애플리케이션 방화벽의 유지보수 지원이 원활한가?
:

[펌]Tomcat configuration

ITWeb/서버관리 2008. 7. 29. 10:32

ref. http://www.akadia.com/download/soug/tomcat/html/tomcat_apache.html

Tomcat Configuration

The Tomcat server.xml file allows you to configure Tomcat using a simple XML descriptor. This XML file is at the heart of Tomcat.

The <Context> element is the most commonly used element in the server.xml file. It represents an individual Web Application that is running within a defined <Host>. There is no limit to the number of contexts that can be defined within a <Host> element. Each <Context> definition must have a unique context path, which is defined by the path attribute.

1. Creating the Web Application Context (Location of the Web Application):

<!-- Tomcat Root Context -->
<Context path="/jsp" docBase="/www/webapp/jsp" debug="0" reloadable="false" />

  • docBase: Defines the directory for the Web application associated with this <Context>. This is the pathname of a directory that contains the resources for the Web application.

  • path: Defines the context path for this Web application. This value must be unique for each <Context> defined in a given <Host>.

  • reloadable: If set to true, causes Tomcat to check for class changes in the WEB-INF/classes/ and WEB-INF/lib directories. If these classes have changed, the application owning these classes will automatically be reloaded. This feature should only be used during development. This setting will cause severe performance degradation, and therefore should be set to false when in a production environment.

2. Disable Port 8080 (Port 8080 is only used in stand-alone mode)

<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
<!-- (Uncommented for Productive Environment)

<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="20000"
useURIValidationHack="false" />
-->


Creating the Web Application Directory Structure

The container that holds the components of a web application is the directory structure in which it exists. The first step in creating a web application is creating this structure. The following table contains the sample web application and what each of its directories should contain.

The Web Application Directory Structure (Example)

Directory

Contains

/www/webapp/jsp

This is the root directory of the web application. All JSP and XHTML files are stored here.

/www/webapp/jsp/WEB-INF

This directory contains all resources related to the application that are not in the document root of the application. This is where your web application deployment descriptor is located. Note that the WEB-INF directory is not part of the public document. No files contained in this directory can be served directly to a client.

/www/webapp/jsp/WEB-INF/classes

This directory is where servlet and utility classes are located.

/www/webapp/jsp/WEB-INF/lib

This directory contains Java Archive files that the web application depends upon. For example, this is where you would place a JAR file that contained a JDBC driver.



Add a servlet entry into the web application's web.xml file

If you are deploying a servlet, then you have to add a servlet entry into the web application's web.xml file. An example <servlet> element can be found in the following code snippet.

<servlet>
  <servlet-name>MyServlet</servlet-name>
  <servlet-class>packagename.MyServlet</servlet-class>
  <init-param>
    <param-name>parameter</param-name>
    <param-value>value</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>

It isn't necessary to add all servlets to the web.xml file; it's only necessary when the servlet requires additional information, such as initialization parameters.

The Sub-elements of a <servlet>

Sub-element

Description

<servlet-name>

The <servlet-name> element is simply the canonical name of the deployed servlet.

<servlet-class>

The <servlet-class> sub-element references the fully qualified class name of the servlet.

<init-param>

The <init-parameter> sub-element is an optional parameter containing a name-value pair that is passed to the servlet on initialization. It contains two sub-elements, <param-name> and <param-value>, which contain the name and value, respectively, to be passed to the servlet.

<load-on-startup>

The <load-on-startup> sub-element indicates the order in which each servlet should be loaded. Lower positive values are loaded first. If the value is negative or unspecified, then the container can load the servlet at anytime during startup.



Demystifying Tomcat 4's server.xml File

The Tomcat server.xml file allows you to configure Tomcat using a simple XML descriptor. This XML file is at the heart of Tomcat. In this article, I will focus on the configuration of all of the major Tomcat components found in the server.xml file. To examine these components, open your server.xml file, which can be found in the conf/ directory of your Tomcat installation. The following listing contains a simplified version of the default server.xml file.

Note: We will be focusing on the server.xml file as it is configured for Tomcat 4.0.4.

A simple server.xml file

<Server port="8005" shutdown="SHUTDOWN" debug="0">
  <Service name="Tomcat-Standalone">
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
      port="8080" minProcessors="5" maxProcessors="75"
      enableLookups="true" redirectPort="8443"
      acceptCount="10" debug="0" connectionTimeout="60000"/>
    <Engine name="Standalone" defaultHost="localhost" debug="0">
      <Logger className="org.apache.catalina.logger.FileLogger"
        prefix="catalina_log." suffix=".txt"
        timestamp="true"/>
      <Realm className="org.apache.catalina.realm.MemoryRealm" />
      <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">
        <Valve className="org.apache.catalina.valves.AccessLogValve"
          directory="logs" prefix="localhost_access_log." suffix=".txt"
          pattern="common"/>
        <Logger className="org.apache.catalina.logger.FileLogger"
         directory="logs" prefix="localhost_log." suffix=".txt"
         timestamp="true"/>
        <Context path="/examples" docBase="examples" debug="0"
         reloadable="true">
          <Logger className="org.apache.catalina.logger.FileLogger"
          prefix="localhost_examples_log." suffix=".txt"
          timestamp="true"/>
         </Context>
      </Host>
    </Engine>
  </Service>
</Server>

The <Server> Element

The first element found in the server.xml file is the <Server> element. This element represents the entire Tomcat container. It is used as a top-level element for a single Tomcat instance.

The <Server> element is defined by the org.apache.catalina.Server interface. The Server interface is a simple singleton element that represents the entire Tomcat JVM. Each <Server> may contain one or more Service instances. The following list defines the possible attributes that can be set for the <Server> element.

className: Names the fully-qualified Java class name of the class that implements the org.apache.cataline.Server interface. If no class name is specified, the implementation will be used, which is the org.apache.catalina.core.StandardServer.

port: Names the TCP/IP port number to which the server listens for a shutdown command. The TCP/IP client that issues the shutdown command must be running on the same computer that is running Tomcat. This attribute is required.

shutdown: Defines the command string to shut down Tomcat. It must be received by the server on the named port. This attribute is required.

The <Server> element defined in the default server.xml file is contained in the following code snippet:

<Server port="8005"
  shutdown="SHUTDOWN"
  debug="0">

Note: The debug attribute is available to all Tomcat elements. It states the debug level to use when logging messages to a defined Logger. We will look at a Logger definition later in this article.

The <Server> element cannot be configured as a child of any elements. It can be configured as a parent to the <Service> element.

The <Service> Element

The next element in the server.xml file is the <Service> element, which acts as a container for one or more <Connector> elements that share a single <Engine> element. One or more <Service> elements may be nested inside of a single <Server> element. The <Service> element is defined by the org.apache.catalina.Service interface. The following list describes the possible <Service> element attributes.

className: Names the fully-qualified Java class name of the class that implements the org.apache.cataline.Service interface. If no class name is specified, the implementation will be used, which is the org.apache.catalina.core.StandardService.

shutdown: Defines the command string to shut down Tomcat. It must be received by the server on the named port. This attribute is required.

The <Service> element found in our server.xml file describes a service that represents a stand-alone Tomcat service that will handle all direct requests received by Tomcat.

<Service name="Tomcat-Standalone">

Note: I will discuss how to add additional <Service> elements in a subsequent article.

The <Service> element can be configured as a child of the <Server> element. It can be configured as a parent to the <Connector> and <Engine> elements.

The <Engine> Element

The third element in the server.xml file is the <Engine> element, which represents the Catalina servlet container. There can only be one <Engine> element for each defined <Service>. This single <Engine> component will receive all requests received by all of the defined <Connector> components. The <Engine> element must be nested immediately after the <Connector> elements, inside of its owning <Service> element.

The <Engine> element is defined by the org.apache.catalina.Engine interface. The following list describes the possible <Engine> element attributes.

className: Names the fully-qualified Java class name of the class that implements the org.apache.cataline.Engine interface. If no class name is specified, the implementation will be used, which is the org.apache.catalina.core.StandardEngine.

defaultHost: Names the host name to which all requests will be defaulted if not otherwise named. The named host must be defined by a child <Host> element.

name: Defines the logical name of this engine. The name selected is arbitrary, but it is required.

The following code snippet contains the <Engine> element defined in the server.xml file. The element defines an engine named Standalone with a default host of localhost.

<Engine name="Standalone" defaultHost="localhost" debug="0">

The <Engine> element can be configured as a child of the <Service> element. It can be configured as a parent to the following elements:

  • <Logger>
  • <Realm>
  • <Valve>
  • <Host>

The <Host> Element

The <Host> element defines the virtual hosts that are contained in each instance of a Catalina <Engine>. Each <Host> can be a parent to one or more Web applications, which are represented by a <Context> component, which will be described in the following section.

You must define at least one <Host> for each Engine element. The possible attributes for the <Host> element are described below.

className: Names the fully-qualified Java class name of the class that implements the org.apache.catalina.Host interface. If no class name is specified, the implementation will be used, which is the org.apache.catalina.core.StandardHost.

appBase: Defines the directory for this virtual host. This directory is the pathname of the Web applications to be executed in this virtual host. This value can be an absolute path, or a path that is relative to the <CATALINA_HOME> directory. If this value is not specified, the relative value webapps will be used.

unpackWARs: Determines if WAR files should be unpacked, or run directly from the WAR file. If not specified, the default value is true.

name: Defines host name of this virtual host. This attribute is required, and must be unique among the virtual hosts running in this servlet container.

The <Host> element defined for the Standalone <Engine> is listed in the following code snippet:

<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">

The host definition defines a host named localhost that can be accessed by opening the URL http://localhost:8080/.

Note: The port 8080 appended to the previous URL is defined by the <Connector> element, which will be described later in this article.

The <Host> element is configured as a child of the <Engine> element. It can be configured as a parent to the following elements:

  • <Logger>
  • <Realm>
  • <Valve>
  • <Context>

The <Context> Element

The <Context> element is the most commonly used element in the server.xml file. It represents an individual Web application that is running within a defined <Host>. There is no limit to the number of contexts that can be defined within a <Host> element. Each <Context> definition must have a unique context path, which is defined by the path attribute. The possible attributes for the <Context> element are described below.

className: Names the fully-qualified Java class name of the class that implements the org.apache.catalina.Host interface. If no class name is specified, the implementation will be used, which is the org.apache.catalina.core.StandardContext.

cookies: Determines if you want cookies to be used for session identifier. The default value is true.

crossContext: When set to true, allows the ServletContext.getContext() method to successfully return the ServletContext for other Web applications running in the same host. The default value is false, which will prevent the access of cross-context access.

docBase: Defines the directory for the Web application associated with this <Context>. This is the pathname of a directory that contains the resources for the Web application.

path: Defines the context path for this Web application. This value must be unique for each <Context> defined in a given <Host>.

reloadable: If set to true, causes Tomcat to check for class changes in the WEB-INF/classes/ and WEB-INF/lib directories. If these classes have changed, the application owning these classes will automatically be reloaded. This feature should only be used during development. This setting will cause severe performance degradation, and therefore should be set to false when in a production environment.

wrapperClass: Defines the Java class name of the org.apache.catalina.Wrapper implementation class that will be used to wrap servlets managed by this Context. If not specified, the standard value org.apache.catalina.core.StandardWrapper will be used.

useNaming: Set this value to true if you want Catalina to enable JNDI. The default value is true.

override: Set this value to to override the DefaultContext configuration.The default value is false.

workDir: Defines the pathname to a scratch directory that will be used by this <Context> for temporary read and write access. The directory will be made visible as a servlet context attribute of type java.io.File, with the standard key of java.servlet.context.tempdir. If this value is not specified, Tomcat will use the work directory.

The <Context> element that defines the /examples application is included in the following code snippet:

<Context path="/examples" docBase="examples" debug="0"
reloadable="true">

The context definition defines a Web application named /examples that will have all of its resources stored in the directory <TOMCAT_HOME>/Webapps/examples. This context also states that this application will be reloaded when class files are changed.

The <Context> element is configured as a child of the <Host> element. It can be configured as a parent to the following elements:

  • <Logger>
  • <Loader>
  • <Realm>
  • <Manager>
  • <Ejb>
  • <Environment>
  • <Parameter>
  • <Resource>
  • <ResourceParams>

Note: If you do not have special configuration needs, you can use the default context configuration that is described in the default web.xml file, which can be found in the <CATALINA_HOME>/conf/ directory.

The <Connector> Element

The final element we are going to examine is the <Connector> element. The <Connector> element defines the component that does the actual managing of requests and responses to and from a calling client. The <Connector> element is defined by the org.apache.catalina.Connector interface. The <Connector> element's attributes are described below.

className: Names the fully-qualified Java class name of the class that implements the org.apache.catalina.Host interface. If no class name is specified, the implementation will be used, which is the org.apache.catalina.Connector interface.

enableLookups: Determines whether DNS lookups are enabled. The default value for this attribute is true. When DNS lookups are enabled, an application calling request.getRemoteHost() will be returned the domain name of the calling client. Enabling DNS lookups can have an unfavorable impact on performance, so this value should most often be set to false.

redirectPort: Names the TCP/IP port number to which a request should be redirected, if it comes in on a non-SSL port, and is subject to a security constraint with a transport guarantee that requires SSL.

name: Defines host name of this virtual host. This attribute is required, and must be unique among the virtual hosts running in this servlet container.

The <Connector> element is configured as a child of the <Service> element. It cannot be configured as a parent to any element.

The HTTP Connector

The most common Tomcat connector is the HTTP connector, which is preconfigured with Tomcat. Like all connectors, the HTTP connector implements the org.apache.catalina.Connector interface, which automatically associates it with the connector attributes described above, but it also defines a set of attributes that are specific to the HttpConnector. These additional attributes are listed here.

port: Names the TCP/IP port number on which the connector listens for requests. The default value is 8080. If you want Tomcat to process requests using the default HTTP port of 80, simply set this attribute to 80.

address: This attribute is used for servers with more than one IP address. It specifies which address will be used for listening on the specified port. If this attribute is not specified, this named port number will be used on all IP addresses associated with this server.

bufferSize: Specifies the size, in bytes, of the buffer to be provided for use by input streams created by this connector. Increasing the buffer size can improve performance, at the expense of higher memory usage. The default value is 2048 bytes.

className: Names the fully-qualified Java class name of the HTTP connector class. This value must equal org.apache.cataline.connector.http.HttpConnector.

enableLookups: Same for all connectors.

proxyName: Specifies the server name to use if this instance of Tomcat is behind a firewall. This is an optional attribute.

proxyPort: Specifies the HTTP port to use if this instance of Tomcat is behind a firewall. An optional attribute.

minProcessors: Defines the minimum number of processors, or instances, to start at initialization time. The default value is 5.

maxProcessors: Defines the maximum number of allowed processors, or instances, that can be started. The default value is 20. An unlimited number of processors can be started if the value of the maxProcessors attribute is set to a number less than zero.

acceptCount: Specifies the number of requests that can be queued on the listening port. The default value is 10.

connectionTimeout: Defines time, in milliseconds, before a request terminates. The default value is 60000 milliseconds. To disable connection timeouts, the connectionTimeout value should be set to -1.

An example <Connector> defining a HTTP connector is contained in the following code snippet:

<Connector className="org.apache.catalina.connector.http.HttpConnector"
  port="8080"
  minProcessors="5"
  maxProcessors="75"
  enableLookups="true"
  redirectPort="8443"
  acceptCount="10"
  debug="0"
  connectionTimeout="60000"/>

This <Connector> defines an HttpConnector that listens for requests on port 8080. It starts with a minimum of five processors and can start up to as many as 75 processors.


: