Apache log 분리하기

WEB/WAS/Apache 2017. 8. 11. 14:32 Posted by 알 수 없는 사용자

Apache Log에서 특정 문자열만 별도로 분리할 경우가 생겨서

작업 진행해보았습니다.



httpd.conf 내에

==============================================================

SetEnvIfNoCase Request_URI "/download/temp/pdfexport" customlog2

SetEnvIfNoCase Request_URI "exportword" customlog2

CustomLog "|/app/apache/bin/rotatelogs -l /app/log/apache/export_%Y%m%d.log 86400" combined env=customlog2

==========================================================

설정 추가


access로그에

"/download/temp/pdfexport"

"exportword"

라는 문자열이 있는 Log는 

export_날짜.log 형태로 분리시키는 설정


출처: http://eun2jong.com/ [< eun2jong.com > 은이종]

'WEB/WAS > Apache' 카테고리의 다른 글

mod_define  (0) 2016.05.17
Apache rewrite 정리  (0) 2016.01.28
SSL 인증서 비밀번호 제거 확인  (0) 2015.12.30
SSL 인증서 알고리즘 정리  (0) 2015.12.16
Apache pagespeed 설치  (0) 2015.03.18

Tomcat 6, 7에서 8로 마이그레이션 시 유의해야할 사항

WEB/WAS/Tomcat 2017. 2. 7. 18:46 Posted by 알 수 없는 사용자

Tomcat 6, 7에서 8로 마이그레이션 시 유의해야할 사항


1. MaxPermSize 명칭 변경

- MaxPermSize => MaxMetaspaceSize

- PermSize => MetaspaceSize


2. conf/server.xml

- maxActive => maxTotal

- maxWait = maxWaitMillis

- remobeAbandoned => removeAbandonedOnBorrow or removeAbandonedOnMaintenance

- validationInterval => validationQueryTimeout 으로 변경

- mysql 사용시 initiaiSize 관련 오류가 발생하는 것 => jennifer에서 enable_jdbc_wrapper = true enable_reserved_sql_pointcut=false로 설정 변경 필요


3. conf/web.xml

- jsp 스펙 변화에 따른 내용 수정을 해야함

-- auth-constraint절 제거 또는 security-role절 추가

    <security-role>

        <role-name>manager</role-name>

    </security-role>

auth-constraint role-name manager 추가


4. Catalina 하위에 있는 manager.xml 제거 그리고 webapps/manager 제거


5. conf/web.xml 혹은 ~~~war/WEB-INF/web.xml

- jsp 스펙 변화에 따른 내용 수정을 해야함

- resource-ref에서 description 제거


6. jdbc 드라이버는 반드시 $TOMCAT/lib에 위치해야함

 

etc. tomcat HTTP2 채용으로 인한 native apr 관련해서 업데이트 필요

'WEB/WAS > Tomcat' 카테고리의 다른 글

Tomcat MaxPermSize  (0) 2016.09.06
Tomcat connector (mod_jk) 관련 주의사항  (0) 2015.11.04
JK FAQ  (0) 2013.11.22

EV 인증서

WEB/WAS 2016. 10. 5. 15:15 Posted by 알 수 없는 사용자

'WEB/WAS' 카테고리의 다른 글

weblogexpert  (0) 2016.04.22
AJP vs HTTP  (0) 2016.01.28
cronolog symblic log 설정  (0) 2015.04.24
Advanced Rest Client (크롬 플러그인)  (0) 2014.11.26
SSL 인증서 SHA1 알고리즘 지원불가 관련 내역  (0) 2014.11.17

Tomcat MaxPermSize

WEB/WAS/Tomcat 2016. 9. 6. 10:43 Posted by 알 수 없는 사용자

Java8부터 메타정보 관리 영역의 메모리 구조가 변경 됨에 따라 pre-java8 옵션을 더 이상 사용 할 수 없습니다.

하지만, 지금까지 pre-java8 옵션으로 설치되어 왔습니다.

 

As-is

-XX:MaxPermSize=256m

 

To-be

-XX:MaxMetaspaceSize=256m

 

 

Java8에 기존 설정 (-XX:MaxPermSize)을 적용하면 다행히도(?) 설정이 무시되고 기본으로 -XX:MaxMetaspaceSize=unlimited 설정됩니다.

MaxMetaspaceSize의 기본 값이 unlimited이기 때문에 어플 특성에 따른 native 메모리 누수 발생시 최악의 경우 아예 OS가 뻗을 수 있을 것 같습니다.

native메모리 누수가 없다고 100% 장담 할 수 없기 때문에 제한을 두어야 한다고 봅니다.

 

대응

l  설치 스크립트에 java8의 경우 -XX:MaxMetaspaceSize=256m 가 적용되게 변경

l  기존 Java8 탑재 Tomcat MaxMetaspaceSize 모니터링

n  MaxMetaspaceSize에 특이사항이 없는지 확인(너무 과도하게 점유하지 않는지)

n  각 서비스 WAS 옵션 변경

'WEB/WAS > Tomcat' 카테고리의 다른 글

Tomcat 6, 7에서 8로 마이그레이션 시 유의해야할 사항  (0) 2017.02.07
Tomcat connector (mod_jk) 관련 주의사항  (0) 2015.11.04
JK FAQ  (0) 2013.11.22

mod_define

WEB/WAS/Apache 2016. 5. 17. 11:55 Posted by 알 수 없는 사용자

 

This module is contained in the mod_define.c file. It provides the definition variables for arbitrary directives, i.e. variables which can be expanded on any(!) directive line. It is compatible with Apache httpd 2.0 and 2.2. It is not compiled into the server by default. To use mod_define you have to enable the following line in the server build Configuration file:

    AddModule  modules/extra/mod_define.o

 

 

http://people.apache.org/~rjung/mod_define/

 

mod_define.c

 


첨부한 파일을 옮긴 후

 

apxs –i – a –c mod_define.c

으로 설치

 

httpd.conf에

----------------------------------------------------

LoadModule define_module    modules/mod_define.so

--------------------------------------------------

자동으로 기입된다.

 

해당 소켓파일은 /apache/module에 위치하니 확인

'WEB/WAS > Apache' 카테고리의 다른 글

Apache log 분리하기  (0) 2017.08.11
Apache rewrite 정리  (0) 2016.01.28
SSL 인증서 비밀번호 제거 확인  (0) 2015.12.30
SSL 인증서 알고리즘 정리  (0) 2015.12.16
Apache pagespeed 설치  (0) 2015.03.18

weblogexpert

WEB/WAS 2016. 4. 22. 15:55 Posted by 알 수 없는 사용자

 

Apache Log 분석툴을 찾다가 사용하기 괜찮아 보이는 툴이 있어서

정보 공유합니다.

clip_image001

Apache Access 파일을 로딩하면 위와 같은 카테고리로 분석이 됩니다.

 

Gernral 은

image

등으로 표시가 되며

 

기본적인 Access 및 Error 로그도 분석이 됩니다.

 

기타 접속 브라우저 등도 깔끔하게 표시가 되어, 월간리포트나 분석용으로 사용하기 좋을 것 같습니다.

 

image

 

세부 내역은 직접 확인 부탁드립니다. 테스트 페이지 입니다.

https://www.weblogexpert.com/sample/index.htm

'WEB/WAS' 카테고리의 다른 글

EV 인증서  (0) 2016.10.05
AJP vs HTTP  (0) 2016.01.28
cronolog symblic log 설정  (0) 2015.04.24
Advanced Rest Client (크롬 플러그인)  (0) 2014.11.26
SSL 인증서 SHA1 알고리즘 지원불가 관련 내역  (0) 2014.11.17

Apache rewrite 정리

WEB/WAS/Apache 2016. 1. 28. 14:10 Posted by 알 수 없는 사용자

[Rewrite 지시자]

. : 다수의 한문자
? : 0개 이상의 한문자
* : 0개 이상의 문자 또는 문자열
+ : 1개 이상의 문자 또는 문자열
(chars) : (, ) 안의 문자또는 문자열을 그룹으로 묶는다.
          이 문자그룹은 Substitution(return URL)에서 $N 의 변수로 활용할수 있다.
^ : 문자열의 첫문(열)을 지정
$ : 문자열의 끝 문자(열)을 지정
(역슬래쉬) : 정규표현식에서 특별한 의미로 사용되는 문자의 특수기능을 제거
{n} : 정확히 n번 반복
{n,} : n번 이상 반복
{n,m} : n 이상 m 이하 반복
[chars] : 문자들의 범위 또는 표현할 수 있는 문자들을 설정합니다.
예) [a-z] : a 부터 z 까지의 소문자, [tT] : 소문자 t 또는 대문자 T

[Rewrite Subrutine 지시자]

L : 뒤구문 여부를 무시하고 그 줄에서 끝낸다.
N : 새로운 Rule이 시작된다는 의미.
R : Redirection. 무조건 넘긴다. 뒤 주소로 넘긴다는 의미.
NC : 대소문자를 구별하지 않는다.
OR : 프로그래밍의 or와 유사.
QSA : Cond의 내용을 지난 결과에 덧붙인다.
NE : Out 될 값에 특수문자가 HexCode로 되어 포함되어 있는 경우.


=======================================================================================


예제)


[test.com을 www.test.com으로 리다이렉트]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(test\.com)
RewriteRule (.*)  http://www.test.com/$1  [L]


[www.test.com, test.com으로 시작하는 주소를 www.sample.co.kr로 리다이렉트]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.test\.com|test\.com)
RewriteRule (.*)  http://www.sample.co.kr/$1  [L]


[www.test.com으로 시작하는 주소를 www.sample.co.kr로 리다이렉트]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.test\.com)
RewriteRule (.*)  http://www.sample.co.kr/$1  [L]


[test.com을 test.com/sub 로 리다이렉트]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(test\.com|www\.test\.com)
RewriteRule (.*)  /sample/$1  [L]


[test.com/sample를 하위 주소까지 ccc.co.kr로 리다이렉트 (영구 이동)]

RewriteEngine On
RewriteRule (.*)  http://www.ccc.co.kr/$1  [R=301,L]

또는

RewriteEngine On
RewriteRule  ^sample/(.*)  http://www.ccc.co.kr/$1  [R=301,L]
(여기서 R=301은 그 주소로 영구이동.
 이렇게 하면 도메인 주소를 바꿨을 때에 검색기들이 알아 차리고, 옛 주소를 새 주소로 갱신할 수 있다.)


[test.com이 들어가는 모든 주소(서브도메인 포함)를 sample.co.kr로 리다이렉트]

RewriteEngine On
RewriteCond %{HTTP_HOST} test\.com
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.test\.com(.*)  http://$1.sample.co.kr/$2  [L]
RewriteRule ^test\.com(.*)  http://sample.co.kr/$1  [L]


[모든 요청을 SSL로 리다이렉트]

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]


[https://www.test.com/m 하위 세부경로 표기]

RewriteRule !^/m https://www.test.com/m%{REQUEST_URI} [R=301,L]

'WEB/WAS > Apache' 카테고리의 다른 글

Apache log 분리하기  (0) 2017.08.11
mod_define  (0) 2016.05.17
SSL 인증서 비밀번호 제거 확인  (0) 2015.12.30
SSL 인증서 알고리즘 정리  (0) 2015.12.16
Apache pagespeed 설치  (0) 2015.03.18

AJP vs HTTP

WEB/WAS 2016. 1. 28. 11:51 Posted by 알 수 없는 사용자
AJP
  • Not a binary protocol
    • Common headers and values encoded
    • Other values in plain text
    • Request and response bodies in plain text
  • Request headers must fit in a single AJP message
    • Default 8192
    • Max 65536
  • Supports passing of SSL termination information
  • Does not directly support encryption
    • IPSec, VPN, SSH tunnel, etc.
 
HTTP
  • Clear text protocol
    • Easy to read
  • No limit on request header size
  • Does not directly support providing SSL termination information
    • Can be added by httpd using custom headers
    • Can be processed by Tomcat using the SSLValve (undocumented)
  • Supports encryption via HTTPS
 
AJP vs. HTTP
  • If terminating SSL at httpd and you need the SSL information
    • Use AJP
  • If you need to encrypt the httpd to Tomcat channel
    • Use HTTP
  • If you need both
    • Use HTTP
    • It is (usually) easier to pass SSL information over HTTP than it is to encrypt AJP
  • If you need neither
    • Pick the one you are more familiar with – debugging problems will be easier
 
mod_jk
  • Only supports AJP
  • Developed by the Tomcat committers
  • Non-httpd style configuration
  • More complex URL mappings are simpler to write
  • Binaries only provided for Windows
 
 
mod_proxy
  • Supports AJP and HTTP
  • Included as standard with httpd
  • Uses httpd style configuration
  • More complex URL mappings are trickier to write
  • Binaries provided for most platforms

 

 

참고

http://wiki.apache.org/tomcat/FAQ/Connectors

'WEB/WAS' 카테고리의 다른 글

EV 인증서  (0) 2016.10.05
weblogexpert  (0) 2016.04.22
cronolog symblic log 설정  (0) 2015.04.24
Advanced Rest Client (크롬 플러그인)  (0) 2014.11.26
SSL 인증서 SHA1 알고리즘 지원불가 관련 내역  (0) 2014.11.17

SSL 인증서 비밀번호 제거 확인

WEB/WAS/Apache 2015. 12. 30. 11:21 Posted by 알 수 없는 사용자

 

nginx 같은 경우에는 인증서 비밀번호를 제거하는 경우가 있는데,

제거가 되었는지 확인하는 명령어

 

opensssl rsa –check –in 인증서.key –noout

 

image

위에 키파일이 패스워드 있는 상테

아래 상태가 패스워드 제거가 된 상태

'WEB/WAS > Apache' 카테고리의 다른 글

mod_define  (0) 2016.05.17
Apache rewrite 정리  (0) 2016.01.28
SSL 인증서 알고리즘 정리  (0) 2015.12.16
Apache pagespeed 설치  (0) 2015.03.18
Apache RedirectMatch  (0) 2015.01.21

SSL 인증서 알고리즘 정리

WEB/WAS/Apache 2015. 12. 16. 14:42 Posted by 알 수 없는 사용자

SSL 인증서 알고리즘 정리


SHA1

현재는 모든 브라우저와 웹서버 등에서 지원하고 있으나

2016년 하반기부터 (06월부터는 지원불가) 점차 지원 중단하여 페이지를 볼 수 없도록 바뀔 예정



SHA2

OS 요구 사항

Windows XP SP3 이상

OSX 10.5 이상

IOS 3.0 이상

안드로이드 2.3(진저브레드) 이상

브라우저 요구 사항

IE 6 이상(단 이 경우 Win XP SP3 이상)

IE8 이상(Win 7의 경우)

크롬 1.0 이상

파이어폭스 1.0 이상

사파리 3 이상

JDK 요구 사항

java1.4.2 이상

OpenSSL 요구 사항

0.9.8o 이상

웹서버 요구 사항

Apache 2.0.63 이상(그리고 OpenSSL 0.9.8o 이상 필수)

NGINX OpenSSL 버전에 의존적

참조

https://support.globalsign.com/customer/portal/articles/1499561-sha-256-compatibility


 

ECC

OS 요구 사항

Windows XP 기반 브라우저 지원 불가

Windows Vista, 7 이상

OSX 10.6 이상

안드로이드 4.0(킷캣) 이상

브라우저 요구 사항

IE 7 with ECC 지원 OS

IE 8 이상

크롬 25 이상

파이어폭스 19 이상

JDK 요구 사항

jdk 5 with ECC

jdk 1.7 이상

OpenSSl 요구 사항

OpenSSL 1.0 이상

웹서버 요구 사항

Apache 2.2.26 이상(권장 2.4)

Nginx 1.1.0

참조

https://www.namecheap.com/support/knowledgebase/article.aspx/9503/38/what-is-an-ecc-elliptic-curve-cryptography-certificate

https://support.globalsign.com/customer/portal/articles/1995283-ecc-compatibility

'WEB/WAS > Apache' 카테고리의 다른 글

Apache rewrite 정리  (0) 2016.01.28
SSL 인증서 비밀번호 제거 확인  (0) 2015.12.30
Apache pagespeed 설치  (0) 2015.03.18
Apache RedirectMatch  (0) 2015.01.21
Apache method 설정  (0) 2014.11.25