1. sqlite 설치

# wget http://www.sqlite.org/sqlite-amalgamation-3.6.16.tar.gz

# tar xvfz sqlite-amalgamation-3.6.16.tar.gz

# cd sqlite-3.6.16

# ./configure

# make

# make install


2.  python 설치


1) 패키지 다운로드 작업 디렉토리 진입

# cd

# wget http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz

# tar xvfz Python-2.6.6.tgz

# cd Python-2.6 


2) 기존 python 덮어 쓰지 않게끔 설정

# ./configure --prefix=/opt/python2.6 --with-threads --enable-shared


3) 컴파일 설치

# make

# make install


4) root .bash_profile 추가

alias python='/opt/python2.6/bin/python'


5) 심볼릭 링크 생성

# ln -s /opt/python2.6/bin/python /usr/bin/python2.6


6) 공용라이브러리 등록

# cat >> /etc/ld.so.conf.d/opt-python2.6.conf

/opt/python2.6/lib (hit enter)

(hit ctrl-d to return to shell)

# ldconfig


7) setuptool 설치

# cd

# wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg

# sh setuptools-0.6c9-py2.6.egg --prefix=/opt/python2.6

  

8) MySQLdb 패키지 설치:

# cd

# wget http://sourceforge.net/projects/mysql-python/files/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz/download

# tar xvfz MySQL-python-1.2.3c1.tar.gz

# cd MySQL-python-1.2.3c1

# python setup.py build

# python setup.py install

 

- 빌드 과정 에러가 발생하면 MySQL-dev 관련 패키지를 추가로 설치한다. (yum install mysql-dev*)

- $ python2.6 setup.py build  /usr/bin/ld: cannot find -lpython2.6 에러발생하면 python2.6 setup.py build_ext --library-dirs=/opt/python2.6/lib/ 시도

 

9) PIL(Python Image Library) 설치

# cd

# wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz

# tar xvfz Imaging-1.1.6.tar.gz

# cd Imaging-1.1.6

# python setup.py install

 

10) 파이썬 2.6 설치 검증:

# cd

# python

Python 2.6.2 (r262:71600, Aug  5 2009, 00:51:31)

[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import sqlite3

>>> import MySQLdb

>>> import Image

>>>

 

MySQLdb 임포트시 경고 메시지가 출력되는 경우가 있는데 재로그인 하면 사라진다. (이유는 모름. 누가 설명 .)


* Genshi

easy_install 설치시 버전이 설치되어 trac 에서 요구하는 버전을 설치 없다. 다운 받아서 설치.

# svn export http://svn.edgewall.org/repos/genshi/trunk genshi

# cd genshi

# python setup.py install


* 한글 설정을 위한 babel, Locale Data 설치.

babel 다운로드


# mkdir temp

# cd temp

# svn co http://svn.edgewall.org/repos/babel/trunk babel

# cd babel


* Locale Data 설치

# wget http://unicode.org/Public/cldr/1.6.1/core.zip

# unzip core.zip



* Element Tree 패키지 설치 - locale 적용을 위해 필요하다.

# easy_install ElementTree



* 빌드 설절 CLDR 데이터의 변환하고 설치를 진행한다.

# python ./setup.py egg_info

# python ./scripts/import_cldr.py ./   <-  ./ 설치 경로(babel 폴더에 core.zip 풀었으므로)


# python ./setup.py install

# python ./setup.py test   <- test




* 옵션 사항.

# easy_install pytz

# easy_install docutils

# easy_install epydoc

# easy_install Pygments


3.  mod_python 설치


yum install mod_python


하니 apache 같이 받아져서 다운 받아서 깔았다.


다운로드 : http://www.modpython.org/


# tar zxvf mod_python-3.3.1.tgz

#cd mod_python-3.3.1

#./configure --with-apxs=/usr/local/web/apache/bin/apxs --with-python=/usr/bin/python

#make

#make install


./configure 옵션은 자기 환경에 맞는 값을 넣어주면 된다.


make mod_python-3.3.1/src/connobject.c 부분에서 에러

mod_python-3.3.1/src/connobject.c 열어

while ((bytes_read < len || len == 0) &&

           !(b == APR_BRIGADE_SENTINEL(bb) ||

             APR_BUCKET_IS_EOS(b) || APR_BUCKET_IS_FLUSH(b))) {


하면 된다.



4.  trac 설치

# svn export https://svn.edgewall.com/repos/trac/trunk trac-trunk

# cd trac-trunk

# python ./setup.py complile_catalog --use-fuzzy   <= po 파일을 mo 파일로 변환.

# python ./setup.py install

# trac-admin --version



버전 확인하면 현재(trac-admin 0.12dev) 라고 뜬다.


5. trac와 svn, apache  연동

# mkdir /home/trac/test

# trac-admin /home/trac/test initevn

# chown apache.apache -R /home/trac/test



httpd.conf 수정


<Location /trac>

  SetHandler mod_python

  PythonHandler trac.web.modpython_frontend

  PythonOption TracEnv /home/trac/test

  #PythonOption TracEnvParentDir /home/trac  <= 첫페이지에 프로젝트 리스트가 뜬다.

  PythonOption TracUriRoot /trac/

</Location>



아파치 재실행후


http://localhost/trac 확인.


svn 연결이 제대로 안되어 있을 것이다.계정도 없고.


에러사항들

* 화면이 하얗게 나오고 로그에 아래와 같이 나올때

- Python에서 참조하고 있는 expat verison이랑 Apache 소스 컴파일시에 아파치에서 사용하는 expat library version 맞지 않으면 mod_python에서 문제가 발생한다.


해결방안.

mv /usr/local/apache2/lib/libexpat.so.0.1.0 /usr/local/apache2/lib/libexpat.so.0.1.0.old

ln -s /lib/libexpat.so.0.5.0 /usr/local/apache2/lib/libexpat.so.0.1.0


* mod_python 에러

페이지 마지막 줄에 db read _write 권한이 있어야 한다고 뜨는 경우. 기본 apache httpd.conf User, Group Daemon 으로 되어 있어서 그렇다.

apache 설정 주었으므로 부분을 수정하여 주면 된다.

mod_python 설정 참고 페이지 : http://trac.edgewall.org/wiki/TracModPython

Posted by 나랑살자
,

In order to use interceptors with Annotation-based controllers, you need to configure the DefaultAnnotationHandlerMapping used by the Spring container.

<bean id="annotationMapper" class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
	<property name="interceptors">
		<list>
			<ref bean="myInterceptor1"/>
			<ref bean="myInterceptor2"/>
			<ref bean="myInterceptor3"/>
		</list>
	</property>
</bean> 

URL Specific Interceptors for Annotation-based controllers

Unfortunately, using the DefaultAnnotationHandlerMapping for interceptors configures the interceptors for all defined annotation based controllers.
In some cases, you might want to have interceptors apply only to specific controllers. 

I have created two HandlerMappings that will accomplish this task:

The SelectedAnnotationHandlerMapping and theIgnoreSelectedAnnotationHandlerMapping.java classes which can both be downloaded from www.springplugins.org

SelectedAnnotationHandlerMapping

The SelectedAnnotationHandlerMapping allows you to specify which urls will be interecepted. It is configured as follows:

<bean id="publicMapper" class="org.springplugins.web.SelectedAnnotationHandlerMapping">
	<property name="urls">
		<list>
			<value>/interceptOnly.do</value>
		</list>
	</property>
	<property name="interceptors">
		<list>
			<ref bean="myInterceptor"/>
		</list>
	</property>
</bean>

The above configuration causes all requests to /interceptOnly.do to be intercepted by myInterceptor.

IgnoreSelectedAnnotationHandlerMapping.java

The IgnoreSelectedAnnotationHandlerMapping allows you to specify which urls will not be interecepted. This is similar to Spring'sDefaultAnnotationHandlerMapping in that it will map all Annotation based controllers except it will not map the defined urls. It is configured as follows:

<bean id="publicMapper" class="org.springplugins.web.IgnoreSelectedAnnotationHandlerMapping">
	<property name="order">
		<value>0</value>
	</property>
	<property name="urls">
		<list>
			<value>/doNotIntercept.do</value>
		</list>
	</property>
	<property name="interceptors">
		<list>
			<ref bean="myInterceptor"/>
		</list>
	</property>
</bean>

Here all annotation-based controllers will be intercepted with myInterceptor except the one usign /doNotIntercept.do url.
Notice that this interceptor specifies the order attribute. This is necessary because if you are using this controller, you are most likely using another mapper for the specified urls. The order was set to 0 here because it is assumed that the mapping to /doNotIntercept.do will be defined with an order > 0.



출처 : http://www.scottmurphy.info/spring_framework_annotation_based_controller_interceptors
Posted by 나랑살자
,

Flush dns to get a new name resolution. Also flush dns cache when you can’t access a newly registered domain name. You can simply flush your dns cache anytime to get new entry. So, Flush your dns cache now.

To flush DNS cache in Microsoft Windows (Win XP, Win ME, Win 2000):-

- Start -> Run -> type cmd
- in command prompt, type ipconfig /flushdns
- Done! You Window DNS cache has just been flush.

To flush the DNS cache in Linux, restart the nscd daemon:-

- To restart the nscd daemon, type /etc/rc.d/init.d/nscd restart in your terminal
- Once you run the command your linux DNS cache will flush.

To flush the DNS cache in Mac OS X Leopard:-

- type lookupd -flushcache in your terminal to flush the DNS resolver cache.
ex: bash-2.05a$ lookupd -flushcache
- Once you run the command your DNS cache (in Mac OS X) will flush.

To flush the DNS cache in Mac OS X:-

- type dscacheutil -flushcache in your terminal to flush the DNS resolver cache.
ex: bash-2.05a$ dscacheutil -flushcache
- Once you run the command your DNS cache (in Mac OS X Leopard) will flush. 


출처 : http://www.techiecorner.com/35/how-to-flush-dns-cache-in-linux-windows-mac/


Posted by 나랑살자
,