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.


:

[펌]OSCON 네째날 III - 웹 사이트 성능 향상

ITWeb/스크랩 2008. 7. 28. 14:09
아래 내용도 참 들어 보고 싶은 내용 이내요..
한가지 추천 할만한 사이트가 있어서 추가 합니다.. ^^*
다들 아시겠지만.. 서도. ㅎㅎ
동영상 강좌 사이트 : http://developer.yahoo.com/yui/theater/
퍼포먼스 : http://developer.yahoo.com/performance/

Dav Glass — Rich Text Editing with YUI

Senior YUI engineer Dav Glass.

36 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Senior YUI engineer Dav Glass introduces you to the YUI Rich Text Editor in this October 2007 tech talk.

Nate Koechley — The YUI CSS Foundation

Senior YUI engineer Nate Koechley.

42 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Senior YUI engineer Nate Koechley guides you through the YUI CSS foundation in this October 2007 tech talk.

Julien Lecomte — "High Performance Ajax Applications"

Yahoo engineer Julien Lecomte.

49 minutes; source: YUIBlog (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Yahoo engineer and YUI contributor Julien Lecomte covers seven key areas of performance relating to modern web applications in this December 2007 tech talk.

Matt Mlinac — The YUI ImageLoader Utility

Yahoo! Engineer Matt Mlinac introduces you to the ImageLoader Utility.

9 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Yahoo! Engineer Matt Mlinac introduces you to the YUI ImageLoader Utility.

Todd Kloots — "The YUI Menu Control"

Todd Kloots, author of the YUI Menu Control.

25 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

The YUI Menu Control comprises three rich, powerful UI tools. In this 25 minute video, YUI Menu developer Todd Kloots orients you to the Menu Control's structure, design, and implementation.

Nicholas Zakas — Maintainable JavaScript

My Yahoo! engineer and Wrox author Nicholas Zakas dispenses pearls of wisdom about the creation of maintainable applications in the browser.

42 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Nicholas Zakas is an engineer on the team that brings you My Yahoo!, one of the most popular personalized portals on the web. In this talk, Zakas focuses on some fundamental concepts in the world of frontend engineering with an eye toward making code more maintainable.

Matt Sweeney — "Web 2.0: Getting It Right the Second Time"

Matt Sweeney speaking on frontend architecture at Yahoo!'s Open Hack Day.

34 minutes; source: Yahoo! Video

Matt Sweeney, author of YUI's Animation Utility, Dom Collection and TabView Control, spoke to hackers gathered for Yahoo!s first Open Hack Day September 29, 2006. In this talk, Matt argues for the strict separation of presentation, content and behavior, providing a historical perspective on the evolution of available tools for engineering stable, scalable, applications using semantic approaches.

Iain Lamb — "The New Hacker's Toolkit"

Oddpost cofounder Iain Lamb speaks at Yahoo!'s Open Hack Day.

28 minutes; source: Yahoo! Video

Iain Lamb, cofounder of the Oddpost webmail startup that was acquired by Yahoo! and eventually became the basis for the all-new Yahoo! Mail, speaks at Yahoo!'s Open Hack Day on the skills needed by hackers in the new network ecosystem of mashups and web services.

Eric Miraglia — "Applying Ajax: Speeding the Journey from Idea to Information"

40 minutes; source: Sys-Con WebCast

Eric Miraglia, YUI engineer and technical evangelist, addresses the RealWorld Ajax conference in San Jose in April 2006. Miraglia's talk focuses on applying Ajax techniques to power real-world interaction problems and looks at autocomplete as a pattern that illustrate's the power of XMLHttpRequest.

YUI-Related Podcasts

Douglas Crockford reviews the current state of the web in the age of asynchronous (but insecure) Ajax transactions.

Douglas Crockford — "The State of Ajax"

38 minutes; source: YUIBlog (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Yahoo! JavaScript Architect Douglas Crockford reprises his talk on "The State of Ajax", putting the popular technique through the critical lens of history and subjecting it to a review of how it stacks up against the current state-of-the-art in computer programming.

Douglas Crockford — "The JavaScript Programming Language"

Douglas Crockford provides a comprehensive introduction to the JavaScript Programming Language.

111 minutes; source: Yahoo! Video

Yahoo! JavaScript Architect Douglas Crockford provides a comprehensive introduction to the JavaScript Programming Language in this four-part video:

Douglas Crockford — "Advanced JavaScript"

67 minutes; source: Yahoo! Video

Yahoo! JavaScript Architect Douglas Crockford lectures on the nuances of the JavaScript programming language in this three-part video:

Douglas Crockford speaks on the nuances of the JavaScript language.

Douglas Crockford — "An Inconvenient API: The Theory of the DOM"

78 minutes; source: Yahoo! Video

Yahoo! JavaScript Architect Douglas Crockford discusses the nexus between JavaScript and the browser, exploring the history of the BOM and DOM APIs and their impact on frontend engineering today. This presentation is archived in three parts:

Douglas Crockford discusses the intersections of JavaScript and the browser.

Douglas Crockford — "Quality"

Douglas Crockford discusses the 40-year-old Software Crisis and what can be done to combat it.

48 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Yahoo! JavaScript Architect Douglas Crockford provided the anchoring keynote for Yahoo!'s annual internal web-development conference in March, 2007. The subject of the talk is "Quality" — the processes by which we engineer quality into our software and, of course, the processes by which we often fail to do so.

Douglas Crockford — "JavaScript: The Good Stuff"

40 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Douglas Crockford delivers the keynote at the 2007 Konfabulator Developer Day.

Yahoo! JavaScript Architect Douglas Crockford keynotes the 2007 Konfabulator Developer Day at Yahoo! on June 7, 2007. In this talk, he describes his own journey from skepticism about JavaScript to a deep appreciation for its power and elegance.

Browser Wars Episode II: Attack of the DOMs

42 minutes; source: Yahoo! Video (Flash) | download.yahoo.com (M4V)

This event brought together at Yahoo! Mike Shaver from Mozilla, Chris Wilson from Microsoft's IE team, CTO Håkon Lie from Opera, and moderator Douglas Crockford from Yahoo! to talk about the current state of the browser landscape. Recorded on February 28, 2007.

Gopal Venkatesan — "Writing Efficient JavaScript"

22 minutes; source: Yahoo! Video (Flash) | download.yahoo.com (M4V)

Gopal Venkatesan was the first frontend engineer hired by Yahoo! in India. In this talk, he explores some core characteristics of performant JavaScript. Recorded on March 8, 2007.

Dion Almaer — "Google, Back to Front"

Google's Dion Almaer.

56 minutes; source: YUIBlog (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Google developer evangelist and Ajaxian cofounder Dion Almaer discusses the Google App Engine and the Gears project in a tech talk at Yahoo in June 2008.

Steve Souders — High Performance Web Sites: 14 Rules for Faster Pages

Yahoo! Performance guru Steve Souders offers 14 rules for faster websites.

37 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Steve Souders is Yahoo's former chief peformance guru and the author of High Performance Web Sites. While at Yahoo, Steve led a team investigating the root causes of poor page performance and applying the lessons learned to Yahoo!'s high-traffic, media-rich properties. Steve now serves in a similar role at Google.

Bill Scott — Designing the Rich Web Experience: Principles and Patterns for Rich Interaction Design on the Web

Former Yahoo Ajax Evangelist Bill Scott

51 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Bill Scott served as a Yahoo Ajax Evangelist and engineering manager from 2005-7. In this talk, given at nearly a dozen conferences around the world, Bill taxonomizes the rich interaction patterns that characterize the evolving web — a must-see for web designers and frontend engineers. (Slides, in Apple Keynote format, can be downloaded here [253MB].)

Peter-Paul Koch (PPK) — Fronteers: Guild of Front-End Developers

PPK, author of quirksmode.ort

29 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

PPK is best-known as the author of the essential frontend engineering site quirksmode. In this talk, he discusses his more recent work — the formation of a professional guild for frontend engineers in Holland.

Joseph Smarr — High-performance JavaScript: Why Everything You've Been Taught Is Wrong

Joseph Smarr, Chief Platform Architect at Plaxo

51 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Joseph Smarr is the Chief Platform Architect at Plaxo, Inc., where he's led the engineering of Plaxo's address-book integration application. In this talk, Smarr explores the core lessons that he and his Plaxo team have learned in the development of their apps and the details of how they've leveraged maximum performance from the web browser.

Joe Hewitt — "Welcome to Firebug 1.0"

Joe Hewitt introduces Firebug to a developer audience at Yahoo!.

48 minutes; source: Yahoo! Video (Flash) | download.yahoo.com (MP4; recommended)

Joe Hewitt is a Mozilla developer who has written software dear to the heart of all web developers, including the original Mozilla DOM Inspector. Joe's newest Mozilla tool is Firebug, an integral logging and debugging extension for Firefox that sets a new standard for its category. Joe provided a power-user tour while announcing Firebug 1.0's release on January 25, 2007, at Yahoo!. Joe is a co-founder of Parakey, Inc.

Joe Hewitt — "An Introduction to iUI"

15 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Firefox co-founder and Firebug author Joe Hewitt discusses his newest project, iUI — a JS/CSS bundle empowering rapid development of web applications for iPhone that emulate the iPhone's native visual elements and transtions. Recorded in July 2007, a few weeks after the release of the iPhone, this talk also provides an excellent early overview of the state of iPhone web development and an orientation to standards support in the iPhone implementation of Safari.

Grady Booch — "The Promise, the Limits, the Beauty of Software"

Grady Booch, co-creator of UML and IBM Fellow

56 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Grady Booch is an IBM Fellow and one of the co-creators of UML. In this talk, he discusses the complex matrix of decisions and processes, both intentional and unintentional, that lead to the software designs and architectures upon which we increasingly rely in everyday life. This is a version of a talk originally given to the British Computer Society in honor of Alan Turing.

John Resig — "Advancing JavaScript with Libraries"

John Resig

57 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

John Resig of Mozilla Corp., author of the popular JQuery JavaScript library, describes the role of libraries in the world of frontend engineering, the problems they solve, and the things we can learn from how developers use and think about libraries in their projects.

Lars Knoll and George Staikos: "From KHTML to Webkit"

Lars Knoll and George Staikos of the KHTML development team speak at Yahoo! about KHTML and WebKit on December 8, 2006.

26 minutes; source: Yahoo! Video

Lars Knoll and George Staikos from the KHTML project visited Yahoo! to give a talk on the history of KHTML and Konqueror and the connection between those projects and Apple’s open-source WebKit (which was built upon KHTML and announced in January of 2003 as the foundation of Apple’s Safari browser). See the accompanying YUIBlog article for more details.

A Conversation with David Weinberger

David Weinberger, author of 'Everything Is Miscellaneous.

55 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

Author David Weinberger speaks with Yahoo!'s Bradley Horowitz about the nature of our evolving relationship to information — a relationship that is at the heart of the growing network of web-services-dependent applications on the web.

YUI Theater on del.icio.us:

bookmark on del.icio.us

be the first to bookmark this page!

YUI Theater Accessibility Series

  1. Victor Tsaran: An Introduction to Screen Readers (27 minutes): Flash | MPEG-4
  2. Karo Caran: An Introduction to Screen Magnification Software (16 minutes): Flash | MPEG-4
  3. Shawn Lawton Henry: Web Content Accessibility Guidelines Update (75 minutes): Flash | MPEG-4 | Transcript

Doug Geoffray — "From the Mouth of a Screenreader"

Doug Geoffray

47 minutes; source: Yahoo! Video (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

GW Micro founder Doug Geoffray discusses the evolution of screen readers on the desktop and the nature of the challenges we face as we start addressing similar issues in the context of rich internet applications.

Implementation Focus — LinkedIn

An interview with frontend engineers at LinkedIn disucssing their use of YUI.

10 minutes; source: YUIBlog (Flash) or download.yahoo.com (M4V, iPod/iPhone-compatible)

An interview with frontend engineers at LinkedIn disucssing their use of YUI.

Implementation Focus — "OurStory.com"

10 minutes; source: Yahoo! Video

OurStory.com co-founder Chris Lunt, Chief Architect Tim Correia, and Senior Engineer Jerome Poichet talk about their extensive use of YUI as well as a host of Yahoo! APIs provided by the Yahoo! Developer Network in creating their product.

Jon Chambers — "Screencast: Thinkature Co-founder on Developing with YUI"

Jon Chambers, co-founder of Thinkature, explores YUI integration in his product with YUI engineer Eric Miraglia.

6 minutes; source: YUI Blog (QuickTime) or Yahoo! Video (Flash)

Thinkature co-founder Jon Chambers discusses the Thinkature collaborative ideation interface and how he used YUI in creating it.

Paul Colton — "Screencast: YUI Support in the Aptana IDE"

Aptana founder Paul Colton demos YUI support in the Aptana editor.

7 minutes; source: YUI Blog (QuickTime) or Yahoo! Video (Flash)

Aptana founder Paul Colton provides an overview of the Aptana IDE and its built-in support for the YUI Library; more Aptana screencasts are available on Aptana TV.

Ross Harmes — "Screencast: YUI Bundle for TextMate"

9 minutes; source: YUI Blog (QuickTime) or Yahoo! Video (Flash)

Ross Harmes of Yahoo! Small Business demos his YUI bundle for the popular Mac OS X code editor TextMate. See the YUIBlog post on the screencast for full details.




ref. http://channy.creation.net/blog/538

OSCON에서는 단순히 오픈 소스만 다루는 것이 아니라 웹 서비스와 연관되어 있기 때문에 상대적으로 웹과 관련된 세션도 적지 않은 비중을 차지하고 있습니다.

오늘은 이 블로그 독자들의 비중이 높은 “Front-end” 개발자를 위한 세션 두개에 들어갔습니다. 하나는 CSS를 통한 자바스크립트 UI 성능 향상이고 또 하나는 자바스크립트를 이용한 웹 사이트 성능 향상에 대한 것입니다.

CSS for High Performance JavaScript UI
Gavin Doughtie는 구글에서 파카사웹을 만드는 사람이고 XDraw는 JS 기반 드로잉 서비스를 만들기도 했습니다. 자바스크립트로 도형을 그리거나 하는 것은 어렵고 복잡한 코딩에 속도도 느리기 때문에 이를 위해 CSS를 이용하는 것이 편리함을 강조했습니다.

CSS로 박스, 테이블, 텍스트, 이미지 등을 그리고 크기를 바꾸거나 할 때 CSS의 기초적인 float, positioning, negative margins, relative units, pseudo-selectors 등을 사용하면 편리하게 할 수 있음을 보여 주었습니다. 즉, body {
margin: 0; padding: 0; height: 100%; width: 100%; overflow: hidden;}
으로 미리 정의해 놓고 position을 absolute로 한 후 좌표값을 계산하는 것이죠. 특히 도형을 그릴 때는 img { position: relative; width: 100%; height: 100%; } 처럼 img를 정의하고 계산하면 편리하다는 방법입니다.

자신만의 노하우를 담은 샘플 예제를 중심으로 발표를 진행했는데 곧 발표 자료를 홈페이지에 올린 답니다. 샘플을 계속해서 보여주어서 제대로 설명하기는 좀 힘들 군요.

이 친구 발표 중에 이런 이야기를 하더군요. 자기는 뭐든지 자유롭게 구현 가능한 Safari와 Webkit 엔진을 가장 좋아한다고 합니다. 특히, 요즘 웹 브라우저들로 할 수 있는 것이 많기 때문에 자신이 제시한 구현을 통해 좀 더 좋은 기능을 제공하려면 IE6를 포기하는 것도 고려해 볼만 하다는 거죠.

즉 IE7+, Firefox 3+, Safari 3+, Opera 9.5+ 등과 같이 높은 사양의 웹 브라우저만을 지원하는 것인데 만약 서비스가 매우 유용하다면 사용자들이 바꿀 것이라는 겁니다. (즉, IE6이 문제가 아니라 개발자 우리 자신에게 문제가 있는 것이라는 이야기입니다.)

Even Faster Web Sites
이 세션을 진행한 구글에 계신 Steve Souders 이름을 들어본 분이 많을 겁니다. 야후!에 웹 서비스 기술 책임자로 있을 때 14가지 웹 서비스 성능 최적화 기법이라는 것을 소개하고 High Performance Web Sites라는 책도 발간하셨던 유명한 분입니다. 특히, Firebug 기반의 Y!Slow라는 퍼포먼스 측정 도구를 만드신 분이기도 합니다.

그의 성능 향상의 결론은 바로 ‘프론트 엔드의 자바스크립트를 경량화’하라는 것입니다. 그의 이야기에 따르면 서버 기반 코드가 생성되는 것은 전체 웹 로딩 속도의 10%에 불과하고 80~90%는 프론트 엔드 코드의 렌더링에 따른 것이고 아무리 백엔드 코드 성능을 향상 시켜도 사용자 체감 속도는 별로 안높아진다는 겁니다.

이번 세션에서는 이전의 14가지 기법을 재탕하는 것은 아니구요. 새롭게 2탄으로 추가된 내용입니다.

기존의 1탄

새로운 2탄

2탄에 있는 10가지를 다 알려 주면 얼마나 좋겠습니까마는 이번 세션에서는 앞의 3가지만 해준다고 합니다. 2탄의 대부분은 자바스크립트에 관한 것인데 그 이유는 자바스크립트가 문제의 대부분이기 때문에 그렇다고 합니다. 그가 Y!Slow를 통해 여러 웹 사이트의 문제점을 보여주었는데 로딩 타임의 대부분이 자바스크립트 병목에서 오고 있었습니다. (Cuzillan의 결과 참조)

로딩 부담을 나눠라! Split the initial payload
첫번째 방법은 js파일의 로딩 부담을 나누라는 것입니다. js파일을 웹 페이지가 렌더링 되는 중간 중간 나눠서 로딩하고 이를 위해 doloto같은 도구를 이용하라고 조언 합니다.

중단 없이 스크립트를 읽어라! Load scripts without blocking
대개 js파일은 대개 직렬적으로 읽고스타일 시트가 로딩 되는 동안 다른 것이 block 되는 등 초기의 여러 조건에 따라 로딩 속도가 차이가 나게 되는데 이를 위해 block이 되는 조건을 잘 찾아서 적절한 방법을 사용하라고 조언 합니다.

이를 위해 대개 다음 6가지 방법을 제시했습니다. (상세한 방법론은 PT에 있는데 밖으로 유출하지 말라는 구글 회사 계약 내용 때문에 웬만하면 사진을 찍지말라고 했지만 제가 찍긴 했습니다. 필요하시면 저에게 메일로 알려주시길…)

  1. XHR Eval (must have same domain as page)
  2. XHR Injection (same domain)
  3. Script in iFrame (same domain)
  4. Script DOM Element (domains can differ)
  5. Script Defer (only supported in IE, domains can differ)
  6. document.write (not recommended, parallelization only works in IE)

그런데 위의 기능을 사용하는 데 있어서도, 웹 페이지에 따라 스크립트와 CSS 파일의 위치와 로딩 순서 등 몇 가지 조건이 있고 조건에 따라 다른 방법을 사용해야 한다고 합니다. 가급적 Cuzillan과 Y!Slow를 이용해서 자신의 웹 페이지에 있는 css, javascript 등의 로딩 순서를 한번 체크해 보고 가장 맞는 방법으로 최적화 하는 것이 좋겠습니다.

인라인 스크립트를 남발하지 말라! Don’t scatter inline scripts
Firefox에서는 스타일 시트가 스크립트의 병렬 다운로드를 막고, IE는 인라인 스크립트에서 스타일시트를 막습니다. 따라서 가급적 인라인 스크립트를 안쓰는 게 좋다는 이야기입니다. 방법은 인라인 스크립트를 스타일시트 위에서 먼저 실행하거나 또는 @import를 쓰지 말고 link로 css를 부르는 것이 좋습니다.

그 밖에 Mozilla 프로젝트가 Firebug 개발을 지원하기 시작했고, Firebug Light 버전과 HTTPWatch for Firefox이 출시된다는 점을 소개했습니다. 아마 이분 위의 10가지를 가지고 책하나 더 쓰실 예정인가 봅니다.

: