https://waspro.tistory.com/183

 

 

반응형

webtob minproc은
webtob에 붙어있는 모든 was container 의 thread pool 갯수의 합보다 같거나 크게 설정

webtob respose timeout 시간 설정시
webtob에 대한 요청이 해당 시간안에 이뤄지지 않을경우 webtob 는 web log에 exception을 남김.
thread pool (maxprox) 이 다 차서 처리를 못할 경우 해당 시간까지 pool 을 기다림.
요청서버 입장에선 해당시간이 초과할경우 readtimeout이 발생

반응형

1. 접근 허용 IP 제한 설정.

방법1) 웹어드민서버 웹페이지에 접속 후 설정

Servers -> admin Server 선택 -> Engine 탭 -> Web Connections 탭 -> ADMIN-HTTP 선택

Server Access Control: check 

Allowed Server: 10.*.*.* (접근허용 IP 대역 설정)

 

방법2) 터미널에서 작업

$JEUS_HOME/domains/노드/config/domain.xml 수정: 47, 48, 49라인 참고

※ JEUS v7.0 이상은 domain.xml, 이하 버전은 JEUSmain.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<web-connections>
   <http-listener>
      <name>http1</name>
      <postdata-read-timeout>50000</postdata-read-timeout>
      <max-post-size>-1</max-post-size>
      <max-parameter-count>-1</max-parameter-count>
      <max-header-count>-1</max-header-count>
      <max-header-size>-1</max-header-size>
      <max-querystring-size>8192</max-querystring-size>
      <server-listener-ref>http-server</server-listener-ref>
      <thread-pool>
         <use-auto-tuning>false</use-auto-tuning>
         <limit>0</limit>
         <min>10</min>
         <max>20</max>
         <max-idle-time>300000</max-idle-time>
         <max-queue>-1</max-queue>
      </thread-pool>
      <server-access-control>false</server-access-control>
   </http-listener>
   <http-listener>
      <name>ADMIN-HTTP</name>
      <output-buffer-size>8192</output-buffer-size>
      <postdata-read-timeout>50000</postdata-read-timeout>
      <max-post-size>-1</max-post-size>
      <max-parameter-count>-1</max-parameter-count>
      <max-header-count>-1</max-header-count>
      <max-header-size>-1</max-header-size>
      <max-querystring-size>8192</max-querystring-size>
      <server-listener-ref>BASE</server-listener-ref>
      <thread-pool>
         <use-auto-tuning>false</use-auto-tuning>
         <limit>0</limit>
         <min>1</min>
         <max>32</max>
         <max-idle-time>300000</max-idle-time>
         <max-wait-queue>0</max-wait-queue>
         <max-queue>-1</max-queue>
         <thread-state-notify>
            <max-thread-active-time>0</max-thread-active-time>
            <interrupt-thread>false</interrupt-thread>
            <active-timeout-notification>false</active-timeout-notification>
            <notify-threshold-ratio>0.0</notify-threshold-ratio>
            <restart-threshold-ratio>0.0</restart-threshold-ratio>
         </thread-state-notify>
      </thread-pool>
      <server-access-control>true</server-access-control>
      <allowed-server>10.149.153.*</allowed-server>
      <allowed-server>10.253.44.*</allowed-server>
   </http-listener>
</web-connections>
cs

 

 

2. DAS(DomainAdminServer) 재기동

startDomainAdminServer -u adminId -p adminPw
stopServer -host ip:port  -u adminId -p adminPw

 

참고:

steemit.com/jeus/@ckolivia/jeus-server-access-control

 

 

 

반응형

'Server' 카테고리의 다른 글

jeus charset encoding 수정  (0) 2021.07.15
webtob minproc maxproc  (0) 2021.05.26
MobaXTerm : SSH Tunneling (터널링) 사용하기  (0) 2019.10.01

톰캣을 내렸다 올렸다 하다보면

실제로 톰캣은 내려갔음에도 위와같은 에러로 인해 런칭이 불가한 경우가 자주 발생한다.

이땐 IDE 를 껐다 켜도 서버를 런칭할 수 없다.

아래와 같이 프로세스를 죽일 수 있다.

 

1. 현재 사용중인 tomcat port 의 PID 확인. (cmd)

>netstat -ao tcp

 

2. PID 기준으로 프로세스 죽이기

>taskkill /f /pid PID

 

3. 톰캣 재시작

 

반응형

MobaXTerm : SSH Tunneling (터널링) 사용하기

 

[사용하는 케이스]

로컬 >> 특정 외부 서버가 방화벽이 뚫려 있지 않아 로컬에서 특정 외부 서버의 api 호출이 불가(로컬 : 테스트 불가)

개발 >> 특정 외부 서버가 방화벽이 뚫려 있어 개발 서버에서 특정 외부 서버의 api 호출이 가능(개발 : 테스트 가능)

위와 같을 때 단위 테스트를 위해 매번 개발 서버에 소스를 배포 후 테스트 하는게 여간 번거로운게 아니다.

 

이 때, 개발서버 Tunneling 설정을 통해 로컬에서 특정 외부 서버 호출이 가능하다.

실제론 로컬 >> 개발서버(터널링) >> 특정 외부 서버 순서의 흐름으로 호출됨

 

[설정방법]

1. Tunneling 클릭

 

2. New SSH tunnel 클릭

 

1 : 포워딩할 포트

2 : 순서대로, 터널링 시켜줄 서버(개발서버)의 ip/login ID/port(22)

3 : 순서대로, 목적지 서버(로컬과 방화벽이 뚫리지 않은, 개발서버와 방화벽이 뚫린 외부 서버)의 ip/port

입력 후 Save.

 

※ local port forwarding 을 사용하므로 (상단부 라디오 버튼 참고) property 수정 필요

소스상에서 본래 목적지인 100.0.0.1:8080 외부서버에 통신을 요청하고 있었다면

로컬호스트:1번에적은포트 (예시-127.0.0.1:8085)

로 요청을 하도록 소스를 수정해야함.

(로컬(예시-127.0.0.1:8085) 호출 > 개발서버 > 실제 목적지인 외부서버 순서로 호출됨)

 

추가한 세팅에서 Start 버튼을 눌러주어야 실질적인 터널링이 작동함.

 

 

※ MobaXterm personal edition 을 설치한 경우, 터널링은 최대 3개만 지원가능하다..

반응형

.session is already registered Exception

 

위와 같은 로그가 찍히면서 jboss 구동이 되지 않는 경우가 있다.

sometimes jboss server can not be launched with the above exception msg.

서버재시작, 서버 제거, server clean 해도 해당 exception 이 해결이 되지 않는다.

server restart, delete server/add server, server clean ways can not solve this.

이 경우 아래와 같이 해결한다.

in this case, follow below steps.

 

1. wildfly/standalone/deployments/ 경로 이동

move to wildfly/standalone/deployments/

2. 경로 밑의 사용하지 않는 .war file 들 제거

delete .war files not used

 

참고(ref) :

https://stackoverflow.com/questions/38507794/duplicateserviceexception-jboss-server

 

 

 

 

반응형

[ JSP 수정 후 저장시 서버 재시작 되는 현상 해결법 ]

1. 프로젝트 클린 : project 탭 > clean

2. 서버 클린 : Servers Preview 에서 사용 중인 Server 우클릭 > clean

 

Servers Preview 에서 사용 중인 Server 더블클릭시 서버 Overview 화면이 나오는데,

  Publishing 탭을 보면 아래와 같은 3가지 퍼블리싱 옵션이 존재.

1) Never publish automatically : 저장해도 자동 서버 반영 하지 않는다

2) Automatically publish when resources change : 소스가 바뀔 경우 자동 서버 반영 

3) Automatically publish after a build event : 빌드할 경우에만 자동 서버 반영

 

해당 설정은 default 인 Automatically publish when resources change 을 사용(건들필요 없다)

반응형

로컬에서 awstats 설치 및 사용

 

awstats 을 사용하여 access.log 를 분석해보자

 

1. perl 설치

2. awstats 설치

3. 사용

 

순서로 진행.

 

 

1. perl 설치

딸기가 가장 많이 쓰이는것 같으니 스트로베리로 설치.

http://strawberryperl.com/

접속

빨간 테두리로 둘러쌓인 Recommended version에서 본인pc 환경에 맞는걸로 다운로드

 

다운로드 끝나면 실행 및 설치..(생략)

 

 

2. awstats 설치

1) http://www.awstats.org/#DOWNLOAD  접속 후, 

빨간 테두리로 둘러쌓인 링크 중, awstats~.zip 클릭하여 다운로드

 

2) 압축 해제

 

3) wwwroot/cgi-bin/awstats.model.conf 파일을 복사 후

awstats.프로젝트명.conf 와 같이 카피.

(awstats.model.conf 는 예제 파일)

 

4) 해당 파일을 문서편집기로 열어 아래 부분들을 수정

a) LogFile="E:/awstats/logs/access.log"   (분석 대상인 로그파일의 경로)

b) SiteDomain="localhost" (로컬에서 돌려볼거니 로컬호스트로 설정)

c) HostAliases="localhost 127.0.0.1" 

d) DirIcons="../icon" (레포트로 나오는 html상의 이미지 파일 경로를 상대경로로 지정)

e) LogFormat="분석대상인 apache서버 로그(access.log)의 포맷을 확인하여 작성"   (분석 대상인 로그파일의 포맷 지정)

apache 서버접속 후 conf 디렉토리 및의 httpd.conf 에서 access.log 포맷을 확인

(빨간 테두리로 둘러쌓인 부분 확인)

 

아파치 로그 포맷의 문법?과 awstats 에서 사용되는 문법이 약간씩 다르기 때문에,

https://www.internetofficer.com/awstats/log-format/

위 사이트를 참고하여 apache access.log의 약어들이 각각 어떤 awstats 약어와 일치하는지 확인 후,

LogFormat 을 작성한다.

 

* 매칭되지 않는 access.log 의 %D (duration microseconds) 같은 경우 extra1 와 같이 선언 후 기타 설정을 해줘야 한다는데..

   나중에 필요하면 알아보는걸로.

 

3. 사용(실행)

1) 실행(awstats)

cmd console 창을 띄워

wwwroot/cgi-bin/ 경로로 이동후

>awstats.pl -update -config=프로젝트명(awstats.프로젝트명.conf 에서 프로젝트명에 해당)

명령어 입력

 

2) 레포트 생성

awstats.pl  -staticlinks -config=sample -output > result/awstats.프로젝트명.html
* 이외에도 여러가지 종류의 레포트를 뽑아낼 수 있는듯 하나 자세한건 나중에 알아보는걸로.

 

 

awstats.프로젝트명.html 을 열어본다.

 

awstats.프로젝트명.html 

 

 

참고 : https://reiphiel.tistory.com/entry/awstats-local-execution

거의 모든 부분을 위의 블로그에서 참고했다.(감사합니다)

 

 

분석결과로 뽑아낸 레포트를 보고 로그를 분석하기가 쉽지 않을 듯하여 그냥 쉘스크립트를 작성하는걸로.....(awstats은 나중에 다시 써보는걸로..)

 

 

 

반응형

Jboss 이미지 경로 설정 (정적 컨텐츠 경로 지정)

 

jboss home directory/standalone/configuration/ 경로에 위치한

standalone.xml 를 수정해준다.

standalone.xml 에 

아래의 설정을 추가해 준다.

<location name="/images" handler="Images"/>
<file name="Images" path="/usr/local/images" directory-listing="true"/>
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  <subsystem xmlns="urn:jboss:domain:undertow:2.0">
            <buffer-cache name="default"/>
            <server name="default-server">
                <http-listener name="default" socket-binding="http"/>
                <host name="default-host" alias="localhost">
                    <location name="/" handler="welcome-content"/>
                    <location name="/images" handler="Images"/>
                    <filter-ref name="server-header"/>
                    <filter-ref name="x-powered-by-header"/>
                </host>
            </server>
            <servlet-container name="default">
                <jsp-config development="true" check-interval="2" modification-test-interval="2" recompile-on-fail="true"/>
                <websockets/>
            </servlet-container>
            <handlers>
                <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
                <file name="Images" path="/usr/local/images" directory-listing="true"/>
            </handlers>
            <filters>
                <response-header name="server-header" header-name="Server" header-value="WildFly/9"/>
                <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
            </filters>
</subsystem>
cs

domain/images/sample.jpg와 같이 /images 경로가 포함된 호출이 들어오면

/usr/local/images (WAS가 설치된 경로를 기준 D:에 설치되어있다면 D:~)경로에서 파일을 찾는다.

 

[설정 확인]

설정을 마쳤으면

http://localhost:8082/images/ 를

호출해본다.

위와 같은 화면이 나오면 성공.

 

[설정확인2]

/usr/local/images 경로에

.html, .jpg, .css 등의 정적 파일들을 올려주고

 

jboss 서버 호출시 파일을 가져오는 모습을 볼 수 있다.

ex) http://domain/images/파일명

 

 

참고 : https://developer.jboss.org/thread/258975

반응형

jboss/wildfly 는 설치시 bin 디렉토리 밑에

서버 시작 스크립트(standalone.sh)가 존재하나, 서버 종료 스크립트가 없다.

 

jboss home directory/bin/standalone.sh 로 서버 실행 후 ctrl+c 로 서버 종료가 가능하나,

특별한 경우가 아니라면 standalone.sh & 와 같은 옵션을 주어 백그라운드에서 서버를 실행시킨다.

이 경우, 서버를 어떻게 죽여야 할까?

 

[1. 프로세스 죽이기]

ps -ef | grep wildfly 

로 프로세스 찾은 후

 

kill -9 프로세스No.

와 같이 서버를 죽일 수 있다..

하지만 뭔가 찜찜하니 매뉴얼을 읽어본다.

 

[2. jboss/wildfly 매뉴얼 따라하기]

jboss/wildfly 매뉴얼에 따르면

 

The first thing to do after the CLI has started is to connect to a managed WildFly instance. This is done using the command connect, e.g.

./bin/jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server
or 'help' for the list of supported commands.
[disconnected /]
 
[disconnected /] connect
[domain@localhost:9990 /]
 
[domain@localhost:9990 /] quit
Closed connection to localhost:9990

localhost:9990

 is the default host and port combination for the WildFly CLI client.

The host and the port of the server can be provided as an optional parameter, if the server is not listening on localhost:9990.

./bin/jboss-cli.sh
You are disconnected at the moment. Type 'connect' to connect to the server
[disconnected /] connect 192.168.0.10:9990
Connected to standalone controller at 192.168.0.1:9990

The :9990 is not required as the CLI will use port 9990 by default. The port needs to be provided if the server is listening on some other port.

 To terminate the session type quit.

 

The jboss-cli script accepts a --connect parameter: ./jboss-cli.sh --connect

The --controller parameter can be used to specify the host and port of the server: ./jboss-cli.sh --connect --controller=192.168.0.1:9990

Help is also available:

[domain@localhost:9990 /] help --commands
Commands available in the current context:
batch               connection-factory  deployment-overlay  if                  patch               reload              try
cd                  connection-info     echo                jdbc-driver-info    pwd                 rollout-plan        undeploy
clear               data-source         echo-dmr            jms-queue           quit                run-batch           unset
command             deploy              help                jms-topic           read-attribute      set                 version
connect             deployment-info     history             ls                  read-operation      shutdown            xa-data-source
To read a description of a specific command execute 'command_name --help'.

해석&정리하자면 

 

1. jboss-cli.sh 스크립트 실행

> jboss home directory/bin/jboss-cli.sh 실행

 

2. 관리자 접속

기본 아이피:포트 사용하고 있는 경우

> connect

 

connect 시 기본 아이피:포트 를 사용하지 않는 경우 

> connect 할당한 아이피:포트 

 

* 여기서 아이피와 포트는 관리자 포트와 아이피를 적어주어야 한다. 

(jboss home dir/standalone/configuration/standalone.xml 파일의 제일 밑에 쪽에 위치한 management-http 참고. (vi 모드에서 파일 끝으로 이동은 :$ (깨알팁))

<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9992}"/>  )

(domain으로 관리하고 있을 경우 domain.xml 을 참고하면 될 것같고, https 사용하는 경우 management-https 에 할당된 아이피 및 포트를 확인하면 될 것 같다)

3. shutdown 명령어로 서버 죽이기.

 

> ./jboss-cli.sh --connect --controller=localhost:port shutdown 와 같이 한 줄로 서버를 죽일 수도 있다.

매번 쓰기 힘드니 stop.sh 이름으로 쉘스크립트를 작성하여 사용하면 편하다..

 

 

[ stop.sh 작성 ]

#!/bin/bash
./jboss-cli.sh --connect --controller=localhost:port shutdown

 

반응형

+ Recent posts