'ITWeb/서버관리'에 해당되는 글 125건

  1. 2012.03.21 apache, tomcat 링크모음.
  2. 2012.03.07 cygwin 패키지 설치/재설치 & SSH 설정
  3. 2012.03.06 cygwin 설치
  4. 2012.02.29 visudo nopasswd 설정하기.
  5. 2012.02.28 Tomcat lb 를 이용해서 Weighted 구현하기.
  6. 2012.02.28 Tomcat 6.0.35 Session Clustering
  7. 2012.02.13 PHP 설치 on Windows.
  8. 2011.11.02 ldd - shared library 확인 command.
  9. 2011.10.26 무료 배포 - Web Load Testing For Dummies
  10. 2011.09.21 svn 실행

apache, tomcat 링크모음.

ITWeb/서버관리 2012. 3. 21. 16:11
:

cygwin 패키지 설치/재설치 & SSH 설정

ITWeb/서버관리 2012. 3. 7. 11:15
[패키지 설치/재설치]

1. setup.exe 파일 실행
2.  다음 버튼 6번 클릭

3. select package 화면이 뜨면 설치 하고자 하는 패키지 검색 하셔서 선택 하신 후 다음 버튼 클릭
4. 패키지 특성상 PC 재부팅 필요할 수도 있음



[SSH 설정]

1. 위 패키지 설치 과정을 통해서 ssh 설치
2. ssh-host-config -y 명령어로 설치
3. net start sshd 로 실행 (또는  cygrunsrv --start sshd)
4. putty 같은 터미널 프로그램으로 접속 : 일반 사용자 계정으로 테스트 함.
5. 윈도 계정 동기화
-  mkpasswd -l > /etc/passwd
- mkgroup -l > /etc/group 


:

cygwin 설치

ITWeb/서버관리 2012. 3. 6. 18:54
[참고사이트]


[설치하기]

- 위 사이트에서 setup.exe 파일을 다운로드 받으세요. (글 하단에도 있습니다.)
- 다운로드 받은 파일을 클릭 하셔서 실행 시키면 됩니다.
- 특별히 주의 할 건 없구요.
- D:\Application\cygwin 에 설치 했고
- D:\Temp\cygwin 에 패키지 다운로드 했습니다.
- 중간에 오류창 하나 뜨는데 그냥 ok 하고 넘어 가시고 next 버튼 눌러서 진행 하시면 설치 완료 됩니다. 



참 쉽죠잉~ 
잘 모르시겠다면.. 구글링

:

visudo nopasswd 설정하기.

ITWeb/서버관리 2012. 2. 29. 14:30

흔히 구글링하면 잘나와 있습니다.

sudo visudo 후

# User privilege specification
root    ALL=(ALL:ALL) ALL
henry    ALL=(ALL) NOPASSWD: ALL

위와 같이 henry 라는 계정에 sudo 사용시 nopasswd 설정을 끝냈습니다.
:

Tomcat lb 를 이용해서 Weighted 구현하기.

ITWeb/서버관리 2012. 2. 28. 17:36
[Tomcat Load Balancer 로 Weighted 구현]

ps=/

#worker.list=tomcat1, tomcat2, loadBalancer

worker.list=loadBalancer


worker.tomcat1.port=8009

worker.tomcat1.host=10.67.8.113

worker.tomcat1.type=ajp13

worker.tomcat1.lbfactor=2   # tomcat1 이 2번


worker.tomcat2.port=8109

worker.tomcat2.host=10.67.8.113

worker.tomcat2.type=ajp13

worker.tomcat2.lbfactor=1   # tomcat2 가 1번 씩 번갈아 가면서 호출 됩니다.


worker.loadBalancer.type=lb

worker.loadBalancer.method=T

worker.loadBalancer.balance_workers=tomcat1,tomcat2

worker.loadBalancer.sticky_session=0



※ 이전에 작성한 글들 참고하세요.
http://jjeong.tistory.com/581 : httpd mod_proxy 를 이용한 load balancing
http://jjeong.tistory.com/580 : Tomcat Session Clustering

[참고정보]
http://tomcat.apache.org/connectors-doc/generic_howto/workers.html 
http://tomcat.apache.org/connectors-doc/reference/workers.html 

DirectiveDefaultDescription
balance_workers - A comma separated list of workers that the load balancer need to manage.

This directive can be used multiple times for the same load balancer.

This directive replaces old balanced_workers directive and can be used only with mod_jk versions 1.2.7 and up.

As long as these workers should only be used via the load balancer worker, there is no need to also put them into the worker.list property.

sticky_session True Specifies whether requests with SESSION ID's should be routed back to the same Tomcat worker. If sticky_session is set to True or 1sessions are sticky, otherwise sticky_session is set to False. Set sticky_session to False when Tomcat is using a Session Manager which can persist session data across multiple instances of Tomcat.
sticky_session_force False Specifies whether requests with SESSION ID's for workers that are in error state should be rejected. If sticky_session_force is set to True or1 and the worker that matches that SESSION ID is in error state, client will receive 500 (Server Error). If set to False or 0 failover on another worker will be issued with loosing client session. This directive is used only when you set sticky_session=True.

This feature has been added in jk 1.2.9.

method Request Specifies what method load balancer is using for electing the best worker. Please note, that session stickiness and perfect load balancing are conflicting targets, especially when the number of sessions is small, or the usage of sessions is extremely varying For huge numbers of sessions this usually is not a problem.

Some methods note, that they aggregate in a sliding time window. They add up accesses, and on each run of the global maintain method, the load counters get divided by 2. Usually this happens once a minute, depending on the setting of worker.maintain. The value of the load counters can be inspected using the status worker.

If method is set to R[equest] the balancer will use number of requests to find the best worker. Accesses will be distributed according to the lbfactor in a sliding time window. This is the default value and should be working well for most applications.

If method is set to S[ession] the balancer will use number of sessions to find the best worker. Accesses will be distributed according to the lbfactor in a sliding time window. Because the balancer does not keep any state, it actually does not know the number of sessions. Instead it counts each request without a session cookie or URL encoding as a new session. This method will neither know, when a session is being invalidated, nor will it correct its load numbers according to session timeouts or worker failover. This method should be used, if sessions are your limiting resource, e.g. when you only have limited memory and your sessions need a lot of memory.

If set to T[raffic] the balancer will use the network traffic between JK and Tomcat to find the best worker. Accesses will be distributed according to the lbfactor in a sliding time window. This method should be used, if network to and from the backends is your limiting resource.

If set to B[usyness] the balancer will pick the worker with the lowest current load, based on how many requests the worker is currently serving. This number is divided by the workers lbfactor, and the lowest value (least busy) worker is picked. This method is especially interesting, if your request take a long time to process, like for a download application.

This feature has been added in jk 1.2.9. The Session method has been added in jk 1.2.20.

lock Optimistic Specifies what lock method the load balancer will use for synchronising shared memory runtime data. If lock is set to O[ptimistic] balancer will not use shared memory lock to find the best worker. If set toP[essimistic] balancer will use shared memory lock. The balancer will work more accurately in case of Pessimistic locking, but can slow down the average response time.

This feature has been added in jk 1.2.13.

retries 2

This directive also exists for normal workers. For those it has adifferent meaning.

If the load balancer can not get a valid member worker or in case of failover, it will try again a number of times given by retries. Before each retry, it will make a pause define by retry_interval directive.

Until version 1.2.16 the default value was 3.

 
:

Tomcat 6.0.35 Session Clustering

ITWeb/서버관리 2012. 2. 28. 11:09
Tomcat 6.0.35 Session Clustering 


[준비사항]

- Apache 2.4.1 다운로드 받기 : http://httpd.apache.org/download.cgi#apache24

- Tomcat 6.0.35 다운로드 받기 : http://mirror.khlug.org/apache/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.zip

- Tomcat Connecter 다운로드 받기 : http://ftp.daum.net/apache//tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.32-src.zip

- 다운로드 링크가 깨졌다면 해당 사이트에 직접 다운로드 받으시면 됩니다.


[설치]

- Windows 에 설치 하는 것이기 때문에 대부분 압축만 푸시고 적당한 위치에 가져다 놓으시면 됩니다.
- 편의상 D:\Application\ 아래 놓도록 하겠습니다.
- 그 이외 자세한 설치 방법은 제 블로그 이전 글 참고 하시면 됩니다. (linux 버전이지만 참고 정도는 됩니다. ^^;)
- httpd 설치 : http://jjeong.tistory.com/421
- tomcat 설치 : http://jjeong.tistory.com/435
- tomcat connector 설치 : http://jjeong.tistory.com/433
- httpd+tomcat+jdk 연동 : http://jjeong.tistory.com/230

 
[설정]

- httpd 설정하기
httpd 가 설치된 경로에서 conf 폴더에 있는 httpd.conf 파일을 에디터창에서 수정.

# 이 설정에 주석을 제거해 줍니다.
# 이유는 httpd 의 proxy balancer 기능을 이용하기 위해서 입니다.
# tomcat 의 경우 기본 worker 설정에서 type 을 lb 로 지정해 주면 httpd 관계 없이 loadbalancer 기능을 이용 할 수 있습니다. 
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so

# 이 설정에 주석을 제거해 줍니다.
Include conf/extra/httpd-vhosts.conf

# 아래 파일을 include 해 줍니다.
Include D:/Application/httpd/conf/session-cluster/tomcat.conf

 
[httpd-vhost.conf 설정하기]

<VirtualHost dev.session-cluster.com:80>
    ServerAdmin jjeong@tistory.com
    DocumentRoot "D:\Application\httpd\htdocs\session_cluster\web"
    ServerName dev.session-cluster.com
    ServerAlias dev.session-cluster.com
    ErrorLog "D:\Application\httpd\logs\dev.session-cluster.com-error.log"
    CustomLog "D:\Application\httpd\logs\dev.session-cluster.com-access.log" common
jkMount /* loadBalancer
DirectoryIndex index.html index.jsp

<Directory "D:\Application\httpd\htdocs\session_cluster\web">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from All
</Directory>
</VirtualHost>

 
[tomcat.conf 설정하기]

LoadModule jk_module modules/mod_jk.so

JkWorkersFile            D:/Application/httpd/conf/session-cluster/workers.properties
JkShmFile               D:/Application/httpd/logs/mod_jk.shm
JkLogFile                D:/Application/httpd/logs/mod_jk.log
JkLogLevel               debug
JkLogStampFormat      "[%a %b %d %H:%M:%S %Y] "
JkRequestLogFormat   "%w %V %T"

 
[workers.properties 설정하기]

ps=/
worker.list=tomcat1, tomcat2, loadBalancer

worker.tomcat1.port=8009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor=1

worker.tomcat2.port=8109
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1

worker.loadBalancer.type=lb
worker.loadBalancer.balanced_workers=tomcat1,tomcat2
worker.loadBalancer.sticky_session=1

 
[Tomcat1 server.xml 설정하기]

- 파일을 열어 보시면 <Cluster /> 섹션이 있습니다.
- 주석 처리 되어 있는 부분을 해제 합니다.
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
- <Engine /> 섹션에 jvmRoute 코드 추가 합니다.
<Engine defaultHost="localhost" jvmRoute="tomcat1" name="Catalina">

이전 버전과 다른 점은 
previous : org.apache.catalina.cluster.tcp.SimpleTcpCluster
current : org.apache.catalina.ha.tcp.SimpleTcpCluster
해당 패키지의 경로 입니다.

 
[Tomcat2 server.xml 설정하기]

- Tomcat1 설정과 동일하게 주석을 제거 합니다.
- <Engine /> 섹션에 jvmRoute 코드 추가 합니다.
<Engine defaultHost="localhost" jvmRoute="tomcat2" name="Catalina">

 
[Tomcat1, Tomcat2 서버의 web.xml 설정하기]

- 설정 파일 제일 하단에 아래 코드 추가 합니다.
<distributable />

 
[Tomcat 설정 시 주의사항]

- 위 설정들은 PC 한 대에서 설정하는 내용으로 기술을 하였습니다.
- 각 port 충돌이 발생 하지 않도록 주의 하시기 바랍니다.

 
[Tomcat1 서버의 index.jsp]

<%
  session.setAttribute("a","a");
%>
<html>
<head>
<title>Test JSP</title>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="#CCCCCC">
    <td width="13%">Tomcat1 Machine</td>
    <td width="87%">&nbsp;</td>
  </tr>
  <tr>
    <td>Session ID :</td>
    <td><%=session.getId()%></td>
  </tr>
</table>
</body>
</html>


 
 
[Tomcat2 서버의 index.jsp]

<%
  session.setAttribute("a","a");
%>
<html>
<head>
<title>Test JSP</title>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="#CCCCCC">
    <td width="13%">Tomcat2 Machine</td>
    <td width="87%">&nbsp;</td>
  </tr>
  <tr>
    <td>Session ID :</td>
    <td><%=session.getId()%></td>
  </tr>
</table>
</body>
</html>




Eclipse 에서 Tomcat1, 2 를 번갈아 가면서 start, stop 해 보시면 lb 동작 하는걸 확인 하실 수 있습니다.
그리고 session 유지 되는 것도 확인 가능 합니다.
 
[Eclipse 에서 Tomcat 서버 등록 및 실행하기]

- Server 창에서 New -> Server -> Apache -> Tomcat v6.0 Server 선택
- Server name 에 Tomcat Session Cluster 1 이라고 작성
- Next 버튼 클릭 또는 Server runtime environment 에서 Add 클릭
- Browse 버튼 클릭 후 설치된 Tomcat1 서버의 경로를 지정 합니다.
- 이런 방식으로 Tomcat2 서버도 등록을 합니다.


 

[참고사이트]
http://www.easywayserver.com/implementation-tomcat-clustering.htm
http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html


※ 위 내용은 성능 튜닝을 고려하지 않은 내용입니다.
실제 서비스에 적용하시기 전에 충분한 튜닝 과정을 거치시기 바랍니다.

※ 서버 한대를 기준으로 설정한 내용입니다.
서버 여러대를 묶기 위해서는 <Cluster /> 섹션에 추가 설정을 해줘야 합니다.
이 부분은 추후 작성 업데이트 하겠습니다.  

 
:

PHP 설치 on Windows.

ITWeb/서버관리 2012. 2. 13. 14:22

[참고사이트]
http://www.websiteadministrator.com.au/articles/install_guides/installing_php536.html 

PHP 다운로드 페이지 들어가 보면.

- VC6 vs VC9
    왼쪽에 설명이 잘 나와 있기는 합니다.
    웹 서버로 IIS 를 사용할 경우 VC9 을 선택
    웹 서버로 Apache 를 사용할 경우 VC6 를 선택

- Thread Safe vs Non Thread Safe 
    윈도우 환경에 Apache 에 사용할 경우 Thread Safe 를 선택 


뭔 이렇게 정리되어 있지요.
자세한 건 위에 참고사이트와 php.net 사이트 참고 바랍니다.
( http://windows.php.net/download/ )

저는 참고로 windows7 환경에
- apache 랑 php VC9 thread safe 버전으로 설치 했습니다. 


[httpd.conf]
- 아래는 PHP 설치 시 apache conf 의 위치를 지정해 주면 자동 등록 되는 코드 이나 간혹 빨간색 부분이 누락 될때가 있으니 주의하세요.

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"

ScriptAlias /php/ "C:/Program Files/PHP/"

Action application/x-httpd-php "C:/Program Files/PHP/php-cgi.exe"

#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL



:

ldd - shared library 확인 command.

ITWeb/서버관리 2011. 11. 2. 12:35
가끔 명령어가 생각 안날때 참 많습니다..ㅡ.ㅡ;;
http://www.google.co.kr/search?aq=f&gcx=w&sourceid=chrome&ie=UTF-8&q=ldd

undefined symbol ..... 나오길래 도대체 뭘 참조하나 볼려고.. ㅎㅎ

NAME


ldd - print shared library dependencies  

SYNOPSIS


ldd [OPTION]... FILE...  

DESCRIPTION


ldd prints the shared libraries required by each program or shared library specified on the command line.  

OPTIONS


--version

Print the version number of ldd.

-v --verbose

Print all information, including e.g. symbol versioning information.

-d --data-relocs

Perform relocations and report any missing objects (ELF only).

-r --function-relocs

Perform relocations for both data objects and functions, and report any missing objects or functions (ELF only).

--help

Usage information.

:

무료 배포 - Web Load Testing For Dummies

ITWeb/서버관리 2011. 10. 26. 17:28

아래 short url 클릭 하시면 받아 보실 수 있습니다.
불편하실 까봐.. 파일도 첨부 합니다.. ㅎㅎ


이거 저작권법 위반이면.. 삭제 하겠습니다.


[아이뉴스 기사 인용]

컴퓨웨어는 초보 사용자들을 위한 웹 로드 테스팅 전자책(ebook)인 '웹 로드 테스팅 포 더미즈(Web Load Testing for Dummies)'를 공식 배포한다고 25일 밝혔다.

웹 로드 테스팅 포 더미즈의 저자인 컴퓨웨어의 웹 로드 테스팅 제품 매니저 콜린 메이슨(Colin Mason)과 미국의 소프트웨어 테스팅 전문기업인 퍼프테스트플러스의 설립자겸 최고기술경영자 스콧 바버(Scott Barber)는 e북을 통해 웹 로드 테스팅의 중요성 및 비즈니스에 미치는 영향에 대해 설명한다.

성능이 뛰어난 웹 애플리케이션은 기업의 브랜드 및 명성을 제고하고 고객 충성도를 높일 수 있지만, 반대로 성능이 낮은 웹 애플리케이션은 기업의 위험 요인을 증가시키게 된다. 웹 로드 테스팅은 웹 애플리케이션의 위험 요인을 관리하는데 매우 중요한 요소다.

웹 로드 테스팅 포 더미즈는 ▲웹사이트 성능을 높일 수 있는 웹 로드 테스팅 방안 ▲로드 테스트 시기 ▲웹 성능이 비즈니스에 직접적으로 미치는 영향에 대한 내용을 상세히 담고 있다.

웹 로드 테스팅 포 더미즈는 웹 로드 테스팅에 관심이 있는 개발자 및 개인 사용자라면 누구나 컴퓨웨어의 웹사이트(http://bit.ly/mRRKKl)를 통해 무료로 다운로드 해 활용할 수 있다. 
:

svn 실행

ITWeb/서버관리 2011. 9. 21. 10:20
#!/bin/sh

sudo svnserve -d -r /home/svn
: