posted by 은이종 2017. 8. 11. 14:31

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 형태로 분리시키는 설정


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

mod_define  (0) 2016.05.17
Apache conf 표준설정  (0) 2016.04.21
Apache socket_timeout , reply_timeout 설정  (0) 2015.12.30
Apache pagespeed 설치  (0) 2015.03.18
Apache method 설정  (0) 2014.11.25
posted by 은이종 2017. 2. 7. 18:45

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
Session ID Check 용 jsp파일  (0) 2016.07.28
Tomcat manager 설정시 주의사항  (0) 2015.09.14
Tomcat Instance(인스턴스)명 변경하기 스크립트  (0) 2014.11.12
posted by 은이종 2016. 9. 6. 10:42

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 옵션 변경

posted by 은이종 2016. 7. 28. 17:48

Tomcat Session Cluster

작업 후에 정상적으로 Session이 유지되는지 확인하는 jsp 파일입니다


내용은

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

session_check.jsp


<%@ page language="java" contentType="text/html; charset=EUC-KR"
        pageEncoding="EUC-KR"%>
<%@ page import="java.text.*"%>
<%@ page import="java.util.*"%>
<%
        String RsessionId = request.getRequestedSessionId();
        String sessionId = session.getId();
        boolean isNew = session.isNew();
        long creationTime = session.getCreationTime();
        long lastAccessedTime = session.getLastAccessedTime();
        int maxInactiveInterval = session.getMaxInactiveInterval();
        Enumeration e = session.getAttributeNames();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Session Test</title>
</head>
<body>
<table border=1 bordercolor="gray" cellspacing=1 cellpadding=0
        width="100%">
        <tr bgcolor="gray">
                <td colspan=2 align="center"><font color="white"><b>Session
                Info</b></font></td>
        </tr>
        <tr>
                <td>Server HostName</td>
                <td><%=java.net.InetAddress.getLocalHost().getHostName()%></td>
        </tr>
        <tr>
                <td>Server IP</td>
                <td><%=java.net.InetAddress.getLocalHost()
                                                                        .getHostAddress()%></td>
        </tr>
        <tr>
                <td>Request SessionID</td>
                <td><%=RsessionId%></td>
        </tr>
        <tr>
                <td>SessionID</td>
                <td><%=sessionId%></td>
        </tr>
        <tr>
                <td>isNew</td>
                <td><%=isNew%></td>
        </tr>
        <tr>
                <td>Creation Time</td>
                <td><%=new Date(creationTime)%></td>
        </tr>
        <tr>
                <td>Last Accessed Time</td>
                <td><%=new Date(lastAccessedTime)%></td>
        </tr>
        <tr>
                <td>Max Inactive Interval (second)</td>
                <td><%=maxInactiveInterval%></td>
        </tr>
        <tr bgcolor="cyan">
                <td colspan=2 align="center"><b>Session Value List</b></td>
        </tr>
        <tr>
                <td align="center">NAME</td>
                <td align="center">VAULE</td>
        </tr>
        <%
                String name = null;
                while (e.hasMoreElements()) {
                        name = (String) e.nextElement();
        %>
        <tr>
                <td align="left"><%=name%></td>
                <td align="left"><%=session.getAttribute(name)%></td>
        </tr>
        <%
                }
        %>


</table>

        <%

                int count = 0;

                if(session.getAttribute("count") != null)
                        count = (Integer) session.getAttribute("count");

                count += 1;

                session.setAttribute("count", count);

                out.println(session.getId() + "     :     " + count);
        %>
</body>
</html>

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


페이지를 띄우면 아래와 같은 화면이 나오는데


SessionID 가 동일하게 유지가 되면서 호출한 카운트가 나온다

server hostName이 바뀌는데도 Session ID 정상적으로 유지되면서 카운트가 증가하면

정상적으로 설정되었다고 보면 된다.



posted by 은이종 2016. 5. 17. 11:54

 

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 2개로 분리하기  (0) 2017.08.11
Apache conf 표준설정  (0) 2016.04.21
Apache socket_timeout , reply_timeout 설정  (0) 2015.12.30
Apache pagespeed 설치  (0) 2015.03.18
Apache method 설정  (0) 2014.11.25
posted by 은이종 2016. 4. 21. 14:16

참고용 Apache conf 표준 설정 내역입니다.

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

1. httpd.conf

 


ServerRoot "/app/apache"

Listen 80
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>

User daemon
Group daemon

</IfModule>
</IfModule>

ServerAdmin 메일주소@메일

ServerName localhost
CoreDumpDirectory /app/log/apache/coredump

DocumentRoot "/app/docroot/apache"

#
<Directory />
Options None
AllowOverride None
Order deny,allow
Deny from all
</Directory>

# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/app/docroot/apache">
Options None
AllowOverride None
Order allow,deny
Allow from all

<LimitExcept GET POST>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

<Directory "/app/apache/cgi-bin">
AllowOverride None
Options None
Order deny,allow
Deny from all
</Directory>

<LocationMatch "/WEB-INF">
Deny from all
</LocationMatch>

<LocationMatch "/META-INF">
Deny from all
</LocationMatch>

<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>

<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>

LogLevel warn

<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D %I %O" combinedio
</IfModule>
</IfModule>

SetEnvIfNoCase User-Agent "Zabbix" do_not_log
SetEnvIfNoCase Request_URI "/wscript.jsp" do_not_log
SetEnvIfNoCase Request_URI "/wscript.php" do_not_log
SetEnvIf Remote_Addr "@@ZABBIX_SERVER@@" do_not_log
#SetEnvIf Remote_Addr "127.0.0.1" do_not_log

ErrorLog "|/app/apache/bin/rotatelogs -l /app/log/apache/error_%Y%m%d.log 86400"
CustomLog "|/app/apache/bin/rotatelogs -l /app/log/apache/access_%Y%m%d.log 86400" combined env=!do_not_log

Alias /errors/ "/app/docroot/apache/errors/"

ErrorDocument 400 "Error"
ErrorDocument 401 "Error"
ErrorDocument 402 "Error"
ErrorDocument 403 "Error"
ErrorDocument 404 "Error"
ErrorDocument 405 "Error"
ErrorDocument 406 "Error"
ErrorDocument 407 "Error"
ErrorDocument 408 "Error"
ErrorDocument 409 "Error"
ErrorDocument 410 "Error"
ErrorDocument 411 "Error"
ErrorDocument 412 "Error"
ErrorDocument 413 "Error"
ErrorDocument 414 "Error"
ErrorDocument 415 "Error"
ErrorDocument 416 "Error"
ErrorDocument 417 "Error"
ErrorDocument 422 "Error"
ErrorDocument 423 "Error"
ErrorDocument 424 "Error"
ErrorDocument 426 "Error"
ErrorDocument 500 "Error"
ErrorDocument 501 "Error"
ErrorDocument 502 "Error"
ErrorDocument 503 "Error"
ErrorDocument 504 "Error"
ErrorDocument 505 "Error"
ErrorDocument 506 "Error"
ErrorDocument 507 "Error"
ErrorDocument 508 "Error"
ErrorDocument 510 "Error"

<IfModule cgid_module>
</IfModule>

DefaultType text/plain

<IfModule mime_module>
TypesConfig conf/mime.types

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz

AddType application/x-httpd-php .php .php3 .inc .ph .htm
AddType application/x-httpd-php-source .phps
</IfModule>

FileETag None

<ifmodule mod_expires.c>
<Filesmatch "\.(jpg|jpeg|png|gif|swf)$">
ExpiresActive on
ExpiresDefault "access plus 4 years"
</Filesmatch>

<Filesmatch "\.(vss|js)$">
ExpiresActive on
ExpiresDefault "access plus 1 month"
</Filesmatch>
</ifmodule>

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

DeflateCompressionLevel 9

<Location />
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip

BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|jpg|swf)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:xml)$ no-gzip dont-vary

</Location>

# TRACE-TRACK 제거

RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]

# all request ssl rewrite
#RewriteCond %{HTTPS} off
#RewriteCond %{REQUEST_URI} !^/jkmanager/*
#RewriteCond %{REQUEST_URI} !^/server-status*
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

#RewriteEngine on
#RewriteCond %{HTTP_HOST} ^skplanetoneid\.com
#RewriteRule (.*)
https://www.%{HTTP_HOST}%{REQUEST_URI} [R]

UserDir disabled

Include conf/extra/httpd-default.conf
Include conf/extra/httpd-mpm.conf

Include conf/extra/httpd-vhosts.conf

#Include conf/extra/httpd-languages.conf
#Include conf/extra/httpd-ssl.conf

##### Tomcat 연동시 아래설정 주석해재 #####

#LoadModule jk_module modules/mod_jk.so

#<IfModule jk_module>
# JkWorkersFile conf/workers.properties
# JkLogFile "|/app/apache/bin/rotatelogs -l /app/log/apache/mod_jk.%Y%m%d.log 86400"
# JkLogLevel info
# JkShmFile logs/mod_jk.shm
# JkWatchdogInterval 60
# JkOptions +FlushPackets +FlushHeader
#</IfModule>

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

extra/httpd-default.conf

#
Timeout 15
KeepAlive Off
MaxKeepAliveRequests 1000
KeepAliveTimeout 5
UseCanonicalName Off
AccessFileName .htaccess
ServerTokens Prod
ServerSignature Off
HostnameLookups Off
TraceEnable Off

LimitRequestFieldsize 10000
LimitRequestBody 10000000

Include conf/extra/httpd-mpm.conf (활성화)

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>

ServerLimit 8
StartServers 8
MinSpareThreads 124
MaxSpareThreads 372
ThreadsPerChild 62
MaxClients 496
MaxRequestsPerChild 10000

</IfModule>

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

extra/httpd-vhosts.conf

#NameVirtualHost _default_:80
<VirtualHost _default_:80>
ServerName _default_:80
DocumentRoot /app/docroot/apache/
CustomLog "|/app/apache/bin/rotatelogs -l /app/log/apache/
www.domain.com-access_log-%Y%m%d.log 86400" combined env=!do_not_log
ErrorLog "|/app/apache/bin/rotatelogs -l /app/log/apache/
www.domain.com-error_log-%Y%m%d.log 86400"
JkMount /*.jsp Tomcat
JkMount /*.do Tomcat
</VirtualHost>

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

extra/httpd-languages.conf (필요시)

#
# Settings for hosting different languages.
#
# Required modules: mod_mime, mod_negotiation

# DefaultLanguage and AddLanguage allows you to specify the language of
# a document. You can then use content negotiation to give a browser a
# file in a language the user can understand.
#
# Specify a default language. This means that all data
# going out without a specific language tag (see below) will
# be marked with this one. You probably do NOT want to set
# this unless you are sure it is correct for all cases.
#
# * It is generally better to not mark a page as
# * being a certain language than marking it with the wrong
# * language!
#
# DefaultLanguage nl
#
# Note 1: The suffix does not have to be the same as the language
# keyword --- those with documents in Polish (whose net-standard
# language code is pl) may wish to use "AddLanguage pl .po" to
# avoid the ambiguity with the common suffix for perl scripts.
#
# Note 2: The example entries below illustrate that in some cases
# the two character 'Language' abbreviation is not identical to
# the two character 'Country' code for its country,
# E.g. 'Danmark/dk' versus 'Danish/da'.
#
# Note 3: In the case of 'ltz' we violate the RFC by using a three char
# specifier. There is 'work in progress' to fix this and get
# the reference data for rfc1766 cleaned up.
#
# Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
# English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
# Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
# Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
# Norwegian (no) - Polish (pl) - Portugese (pt)
# Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
# Turkish (tr) - Simplified Chinese (zh-CN) - Spanish (es)
# Traditional Chinese (zh-TW)
#
AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage tr .tr
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw

# LanguagePriority allows you to give precedence to some languages
# in case of a tie during content negotiation.
#
# Just list the languages in decreasing order of preference. We have
# more or less alphabetized them here. You probably want to change this.
#
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-CN zh-TW

#
# ForceLanguagePriority allows you to serve a result page rather than
# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
# [in case no accepted languages matched the available variants]
#
ForceLanguagePriority Prefer Fallback

#
# Commonly used filename extensions to character sets. You probably
# want to avoid clashes with the language extensions, unless you
# are good at carefully testing your setup after each change.
# See
http://www.iana.org/assignments/character-sets for the
# official list of charset names and their respective RFCs.
#
AddCharset us-ascii.ascii .us-ascii
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .arb .arabic
AddCharset ISO-8859-7 .iso8859-7 .grk .greek
AddCharset ISO-8859-8 .iso8859-8 .heb .hebrew
AddCharset ISO-8859-9 .iso8859-9 .latin5 .trk
AddCharset ISO-8859-10 .iso8859-10 .latin6
AddCharset ISO-8859-13 .iso8859-13
AddCharset ISO-8859-14 .iso8859-14 .latin8
AddCharset ISO-8859-15 .iso8859-15 .latin9
AddCharset ISO-8859-16 .iso8859-16 .latin10
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5.Big5 .big5 .b5
AddCharset cn-Big5 .cn-big5
# For russian, more than one charset is used (depends on client, mostly):
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8 .koi8
AddCharset KOI8-E .koi8-e
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-U .koi8-u
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-7 .utf7
AddCharset UTF-8 .utf8
AddCharset UTF-16 .utf16
AddCharset UTF-16BE .utf16be
AddCharset UTF-16LE .utf16le
AddCharset UTF-32 .utf32
AddCharset UTF-32BE .utf32be
AddCharset UTF-32LE .utf32le
AddCharset euc-cn .euc-cn
AddCharset euc-gb .euc-gb
AddCharset euc-jp .euc-jp
AddCharset euc-kr .euc-kr
#Not sure how euc-tw got in - IANA doesn't list it???
AddCharset EUC-TW .euc-tw
AddCharset gb2312 .gb2312 .gb
AddCharset iso-10646-ucs-2 .ucs-2 .iso-10646-ucs-2
AddCharset iso-10646-ucs-4 .ucs-4 .iso-10646-ucs-4
AddCharset shift_jis .shift_jis .sjis

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

extra/httpd-ssl.conf

#
Listen 443

AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl

SSLPassPhraseDialog builtin
#SSLPassPhraseDialog
exec:/app/apache/conf/sslkey/pass.sh
SSLSessionCache "shmcb:/app/apache/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
SSLMutex "
file:/app/apache/logs/ssl_mutex"

################################################
#Redirect 404 /favicon.ico
#<Location /favicon.ico>
# ErrorDocument 404 "No favicon"
#</Location>
#
#SetEnvIf Request_URI "favicon.ico" do_not_log

#NameVirtualhost *:443

<VirtualHost _default_:443>

# General setup for the virtual host
DocumentRoot "/app/docroot/apache"
ServerName _default_:443
ServerAdmin 메일주소@메일

# default single domain
CustomLog "|/app/apache/bin/rotatelogs -l /app/log/apache/ssl_access_log-%Y%m%d.log 86400" combined env=!do_not_log
ErrorLog "|/app/apache/bin/rotatelogs -l /app/log/apache/ssl_error_log-%Y%m%d.log 86400"
CustomLog "|/app/apache/bin/rotatelogs -l /app/log/apache/ssl_request_log.%Y%m%d 86400" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" env=!do_not_log

# for multi domain
#CustomLog "|/app/apache/bin/rotatelogs -l /app/log/apache/
www.domain.com-ssl_access_log-%Y%m%d.log 86400" combined env=!do_not_log
#ErrorLog "|/app/apache/bin/rotatelogs -l /app/log/apache/
www.domain.com-ssl_error_log-%Y%m%d.log 86400"
#CustomLog "|/app/apache/bin/rotatelogs -l /app/log/apache/
www.domain.com-ssl_request_log.%Y%m%d 86400" \
# "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" env=!do_not_log

JkMount /*.jsp Tomcat
JkMount /*.do Tomcat

SSLEngine on
SSLProtocol ALL -SSLv2
SSLHonorCipherOrder on
SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:RC4-SHA:RC4-MD5:AES256-SHA256:AES128-SHA256:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!SSLv2

SSLCertificateFile        "인증서"
SSLCertificateKeyFile    "인증서
"
SSLCertificateChainFile "인증서
"
SSLCACertificateFile    "인증서
"

<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/app/apache/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
</VirtualHost>

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

Apache Log 2개로 분리하기  (0) 2017.08.11
mod_define  (0) 2016.05.17
Apache socket_timeout , reply_timeout 설정  (0) 2015.12.30
Apache pagespeed 설치  (0) 2015.03.18
Apache method 설정  (0) 2014.11.25
posted by 은이종 2015. 12. 30. 17:05

 

socket_timeout & reply_timeout ERROR CODE

· - socket_timeout 발생시, access log에 502(Bad GateWay)이 발생.

· - reply_timeout 발생 시 access log에 504(Gateway Time-out) 이 발생.

 

mod_jk(worker.properties) 의 socket_timeout 옵션

ex) socket_timeout 을 10초로 설정

worker.worker1.socket_timeout=10
worker.worker1. retries=1


◾클라이언트 요청 이후 10초 이상 응답이 지연되면 클라이언트로 502 리턴 (retries 설정 1 기준)
◾비정상 응답이라 하더라도 클라이언트에게 빠르게 응답을 줄 수 있고, 클라이언트<->웹서버 부하에 대한 timeout 컨트롤을 할 수 있다.
◾다만 WAS의 부하와는 무관한 설정으로, WAS 행업에는 도움이 되지 않는다.


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

mod_define  (0) 2016.05.17
Apache conf 표준설정  (0) 2016.04.21
Apache pagespeed 설치  (0) 2015.03.18
Apache method 설정  (0) 2014.11.25
Apache 멀티 Redirect시 주의점  (0) 2014.11.05
posted by 은이종 2015. 9. 14. 18:23

 

1. tomcat-user.xml

에서 계정 제대로 되어있는지.

 

2.manager.xml 에 제대로 설정되어있는지.

posted by 은이종 2015. 6. 30. 10:19

각 Client 서버 내 conf 백업 스크립트 생성


ex) conf_Backup.sh


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

#!/bin/sh
 
# 6/25 rsync
/bin/mkdir -p /tmp/conf_empty
  
CODE=`hostname awk -F- '{print $1}'`
HOST=`hostname`
SERVER_IP=`/sbin/ifconfig eth0 | grep "inet addr" cut -d: -f2 | awk '{printf $1}'`
DATE0=$(date +%Y%m%d)
RSYNC_TS_IP=0.0.0.0 
# Conf Backup 서버 IP를 설정
 
for TYPE in apache tomcat nginx
do
  if [ -d /app/$TYPE ]
  then
        # mkdir
        /usr/bin/rsync -a /tmp/conf_empty/ $RSYNC_TS_IP::MW-CONF/${CODE}/
        /usr/bin/rsync -a /tmp/conf_empty/ $RSYNC_TS_IP::MW-CONF/${CODE}/${HOST}_${SERVER_IP}/
        /usr/bin/rsync -a /tmp/conf_empty/ $RSYNC_TS_IP::MW-CONF/${CODE}/${HOST}_${SERVER_IP}/${DATE0}/
        /usr/bin/rsync -a /tmp/conf_empty/ $RSYNC_TS_IP::MW-CONF/${CODE}/${HOST}_${SERVER_IP}/${DATE0}/${TYPE}/ 
 
    if [ $TYPE = tomcat ]
    then
        # Tomcat
        /usr/bin/rsync -avzP /app/$TYPE/bin/startsvr_*.sh $RSYNC_TS_IP::MW-CONF/${CODE}/${HOST}_${SERVER_IP}/${DATE0}/${TYPE}/
        for INSTANCE in `/bin/ls /app/$TYPE/ | grep svr_`
        do
            /usr/bin/rsync -avzP /app/$TYPE/${INSTANCE}/conf/server.xml $RSYNC_TS_IP::MW-CONF/${CODE}/${HOST}_${SERVER_IP}/${DATE0}/${TYPE}/${INSTANCE}/
        done
    else
        # Apache, Nginx
        /usr/bin/rsync -avzP /app/$TYPE/conf/httpd.conf $RSYNC_TS_IP::MW-CONF/${CODE}/${HOST}_${SERVER_IP}/${DATE0}/${TYPE}/
        /usr/bin/rsync -avzP /app/$TYPE/conf/extra/*.conf $RSYNC_TS_IP::MW-CONF/${CODE}/${HOST}_${SERVER_IP}/${DATE0}/${TYPE}/
    fi
  fi
done
 
/bin/rm -rf /tmp/conf_empty

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


특이사항 

1. rsync로는  1Depth 디렉토리 뿐이 생성을 하지 못한다

그래서 /tmp/conf_empty 폴더를 만들어서 옮기는 Tip을 이용하여

여러 depth 의 경로를 만들었다.


apache, tomcat, nginx 등은

/app/ 절대경로가 같아서 해당 스크립트로 생성하여 사용



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

cronolog symblic log 설정  (0) 2015.04.24
Advanced Rest Client (크롬 플러그인)  (0) 2014.11.26
WAS 란  (0) 2013.01.09
posted by 은이종 2015. 4. 24. 18:03

ㅇ cronolog 사용 이용

보통 Web/WAS log는 하루 단위로 끊어서 설정을 하는데,

현재 ONM이라는 Tool로 log 설정을 하는 경우에 아래와 같이 문제가 생겨서

a. 단일 파일이 2GB 이상인 경우, log 모니터링 불가

b. 파일명이 년월일+시간 의 형식인 경우 모니터링 불가

cronolog 의 symblic 설정을 통하여 log 분할을 진행하였다.

 

 

ㅇ 설치

1. configure

특별한 옵션은 필요없다

configure —prefix로 경로 설정만 하여 설치

 

2. apache log 설정

기존 Customlog 을 상황에 맞춰서 설정 (1시간 단위로 해당 log가 symbolic 으로 설정되게)

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

Customlog “|/app/cronolog/sbin/cronolog –symlink=/app/log/apache/access80.log –period=1hours /app/log/apache/access80_%Y%m%d_%H.log” combined80

 

3. apche 재구동


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

각 M/W conf 백업  (0) 2015.06.30
Advanced Rest Client (크롬 플러그인)  (0) 2014.11.26
WAS 란  (0) 2013.01.09
posted by 은이종 2015. 3. 18. 11:21

웹페이지 가속 기술중에 하나인 pagespeed

기본적으로는 사이트 속도를 개선하기 위해서 페이지 로딩 타임을 줄이고 이를 바탕으로 페이지의 호출 시간과 네트워크 대역폭의 최적화해서 속도를 개선하는 쪽에 방점을 가지고 있는 모양이다.

이런 세부적인 기술적인 요인들을 하나의 결과물로 만들어  아파치 웹서버 모듈의 일종으로 규합한 것이다. 일단, 개발자 블로그에 올라온 내용에 따르면 현재 콘텐츠 및 워크로드 수정 없이 CSS, 자바스크립트, 이미지를 건들이지 않고 성능 개선할 수 있다고 한다

- 설치 -

1. at 패키지 확인. 없으면 설치

yum install at

 

2. mod_pagespeed 땡겨오기

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm

 

3. 설치

설치할 곳으로 이동

cd /root/job/mod_pagespeed

rpm2cpio mod-pagespeed-stable_current_x86_64.rpm | cpio -idmv

 

4. socket 복사

- apache 2.2.X
cp /root/job/usr/lib64/httpd/module/mod_pagespeed.so /app/apache/modules/
- apache 2.4.X
cp /root/job/mod_pagespeed/usr/lib64/httpd/modules/mod_pagespeed_ap24.so /app/apache/modules/

- 설정파일 copy
cp /root/job/mod_pagespeed/etc/httpd/conf.d/pagespeed.conf  /app/apache/conf/

cp /root/job/mod_pagespeed/etc/httpd/conf.d/pagespeed_libraries.conf /app/apache/conf/

-복사한 파일들의 소유권 및 소유자 변경

mkdir /app/pagespeed

mkdir /app/pagespeed/bin

mkdir /app/pagespeed/cache 
mkdir /app/pagespeed/files

cp /root/job/mod_pagespeed/usr/bin/pagespeed_js_minify /app/pagespeed/bin

chown -R daemon.daemon /app/pagespeed

chown -R daemon.daemon /app/apache/conf/pagespeed*.conf

chown -R daemon.daemon /app/apache/modules/mod_pagespeed*

chmod 660 /app/apache/modules/mod_pagespeed*

 

5. 환경설정

가. httpd.conf Include 설정

vi httpd.coonf에 추가

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

Include pagespeed.conf

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

나. Load 추가 설정

vi /app/apache/conf/pagespeed.conf

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

LoadModule pagespeed_module modules/mod_pagespeed.so

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

 

6. 테스트 방법

PageSpeed는 두 가지 방법으로 실행할 수 있다.

첫 번째는 https://developers.google.com/speed/pagespeed/insights/에 들아가서 URL을 입력하는 방법이다.

두 번째는 크롬 플러그인을 설치해서 크롬에서 '요소검사' 화면에 들어가서 보는 방법이다. 특히, 크롬에서는 아직 공개된 URL로 들어갈 수 없는 로컬 프로그램이나 회사 내부 프로그램까지 돌려볼 수 있다. 크롬은 역시나 개발을 위한 브라우저이다.

실행결과는 모바일과 PC 버전으로 각각 보여주고, 결과를 3가지 수준(Red, Yellow, Green)으로 나눠서 보여준다. 그리고 결과를 종합해 100점 만점으로 점수를 내준다. 정확한 '의미'를 부여하기는 어렵지만 재밌는 수치이다.

posted by 은이종 2014. 11. 26. 11:55


http://eun2jong.com/entry/Apache-method-%EC%84%A4%EC%A0%95

method 관련하여 간단히 포스팅했는데,

이번엔 해당 method를 체크하는 방법입니다.

일반적으론 Telnet이나 Curl을 통하여 진행하는데,

크롬에서 플러그인으로 Advanced Rest Client을 이용하면 좀더 쉽게 확인 할 수 있습니다.

크롬 사용자시면 아래 링크를 통하여 설치를 하면 됩니다.

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo

테스트 방법은

URL을 넣고, Method 타입을 정한 후, 조회 진행하면 됩니다.





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

각 M/W conf 백업  (0) 2015.06.30
cronolog symblic log 설정  (0) 2015.04.24
WAS 란  (0) 2013.01.09
posted by 은이종 2014. 11. 25. 17:13

Method 정의

================================================================================================
HTTP/1.1에서 사용되는 일반적인 method 세트를 아래에 규정하였다. 이 세트를 확장할 수 있지만
추가된 method를 별도로 확장된 클라이언트와 서버가 동일한 의미를 공유하고 있다고 가정할 수 없다.
호스트 Request-Header 필드(14.23 절)는 반드시 모든 HTTP/1.1 요구를 따라야 한다.

GET - 지정된 URL 정보를 요청한다.(이때 전달해야 하는 파라메터를 URL에 포함시켜서 전달한다.)

POST - 지정된 URL 정보를 요청한다. (이때 전달해야 하는 파라메터를 메시지 본문(Request Message Body)을 통해서 전달한다.)

HEAD - HTTP Header 정보만 요청한다.

TRACE - 클라이언트의 요청을 그대로 응답한다. (Request의 Loop Back 테스트)

DELETE - 요청하는 URL의 자원을 삭제한다.

OPTIONS - 응답 가능한(서버에서 지원하는) HTTP 메소드를 요청

PUT - 요청하는 URL의 자원을 생성한다.   예를 들면  파일 업로드가 가능하다.

CONNECT - 터널링의 목적으로 연결 요청

** HTTP 버전별 지원 Method **

HTTP/0.9 - GET

HTTP/1.0 - GET, POST, HEAD

HTTP/1.1 - GET, POST, HEAD, OPTIONS, PUT, DELETE, TRACE, CONNECT

# 아파치는 서버 전체에는 옵션을 줄 수 없습니다. 해당 디렉터리 별로 각각 설정하셔야 합니다.

1.

<Directory /home>

    <Limit PUT DELETE OPTIONS>
        Order allow,deny
        Allow from all

      </Limit>

</Directory>

또는

2.

<Directory /home>

    <LimitExcept GET POST>

    Order deny,allow
    Deny from all
    </LimitExcept>

</Directory>

두 가지 방법 중 편한 걸로 사용하면 된다.

다 열고 특정 Method를 설정하거나 (PUT, DELETE, OPTIONS)

다 막고 허용할Method를 설정하거나, (GET, POST)



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


Web-WAS 구조이면

WAS쪽도 같이 진행해줘야 한다.



 

posted by 은이종 2014. 11. 12. 18:53


 가끔 필요할 때가 있어서 스크립트 생성해보았습니다.

Instance 변경시 주의해야할 점은
1. Instance 폴더 변경
2. 사용하는 Docroot / Deploy 쪽 폴더 변경
3. 구동 및 정지 배치파일
4. loging, server.xml, 등 설정 파일 변경

파일명은 간단히 change_instance.sh

 
처음에 설정하는 디렉토리명 등 상황에 맞춰서 설정 후 사용하면 됩니다. 

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



#!/bin/sh

## 디렉토리명 설정##
FORCE=0
[ ! -z $1 ] && [ "$1" == "-f" ] && FORCE=1
[ ! -z $1 ] && [ "$1" == "-ff" ] && FORCE=2
APPNAME=tomcat
APP_PREFIX=/app/tomcat
DOCROOT=/app/docroot
DEPLOY=/app/deploy

echo
echo "============================= "
echo "Java 실행중인지 체크!!!!!     "
echo "============================= "
echo

ps aufx | grep svr_*

echo; echo
echo "============================= "
read -p "실행 중인지 확인됐나요?"
echo "============================= "
echo "Tomcat Instacne Check!! Enter "
echo "============================= "

/bin/ls -l $APP_PREFIX/ | grep svr_*

echo "=============================="
echo " Now Intance, Chagne Instance "
echo " Now : " & read l
echo " Change : " & read i
echo "============================"
echo " N  o w : $l"
echo " Change : $i"
echo "============================"

if [ $FORCE -lt 1 ];then
    read -p "Are you Continue [y/N] : " cont
    if ! [ "0$cont" == "0Y" -o "0$cont" == "0y" ];then
        echo "Bye~!"
        exit 1
    fi
fi

mv ${APP_PREFIX}/${l} ${APP_PREFIX}/${i}
mv ${DOCROOT}/${APPNAME}/${l} ${DOCROOT}/${APPNAME}/${i}
mv ${DEPLOY}/${APPNAME}/${l} ${DEPLOY}/${APPNAME}/${i}

mv ${APP_PREFIX}/bin/start${l}.sh ${APP_PREFIX}/bin/start${i}.sh
mv ${APP_PREFIX}/bin/stop${l}.sh ${APP_PREFIX}/bin/stop${i}.sh

/usr/bin/perl -p -i -e "s/${l}/${i}/g" ${APP_PREFIX}/bin/start${i}.sh
/usr/bin/perl -p -i -e "s/${l}/${i}/g" ${APP_PREFIX}/bin/stop${i}.sh  
/usr/bin/perl -p -i -e "s/${l}/${i}/g" ${APP_PREFIX}/${i}/conf/logging.properties
/usr/bin/perl -p -i -e "s/${l}/${i}/g" ${APP_PREFIX}/${i}/conf/server.xml 
/usr/bin/perl -p -i -e "s/${l}/${i}/g" ${APP_PREFIX}/${i}/conf/Catalina/localhost/manager.xml


echo
echo " ====================================="
echo " == Instance Name $APP_PREFIX/========"
echo " ====================================="
/bin/ls -l $APP_PREFIX/ | grep svr_*
echo
echo " ====================================="
echo " === start script $APP_PREFIX/bin ===="
echo " ====================================="
/bin/ls -l $APP_PREFIX/bin/*${i}.sh
echo
echo " ====================================="
echo " === DOCROOT ${DOCROOT}/${APPNAME} ==="
echo " ====================================="
/bin/ls -l ${DOCROOT}/${APPNAME}/ | tail -1
echo
echo " ====================================="
echo " === DEPLOY ${DEPLOY}/${APPNAME} ====="
echo " ====================================="
/bin/ls -l ${DEPLOY}/${APPNAME}/ | tail -1
echo " ====================================="
echo " ====================================="
echo " =  End                              ="
echo " ====================================="

========================================================================
 
 
posted by 은이종 2014. 11. 5. 19:03



 

 mod_rewrite 모듈을 이용한 특정 페이지 redirect

1. 
 RewriteEngine On
 RewriteCond %{HTTPS} off
 RewriteRule ^/user/login(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R, L]
 
사용한 변수들)

 RewriteEngine: rewrite 모듈의 사용 여부 [On/Off]
 RewriteCond: rewrite 실행할 조건
 RewriteRule: 조건이 만족할 경우 실제로 rewrite가 일어날 원본 주소와 rewrite 된 주소
 
%{HTTPS} : SSL 사용 여부 [on/off] - mod_ssl 필요
 %{HTTP_HOST} : 호출된 서버의 domain. 포트 번호 있을 경우에는 port 번호 포함.
   ex) http://www.gmate.co.kr/myurl.html?var=value => www.gmate.com.kr
 %{REQUEST_URI} : 도메인 이후의 리소스 절대 경로 및 파라미터
   ex) http://www.gmate.co.kr/myurl.html?var=value => /myurl.html?var=value
 [R] : 강제로 redirect 시킴 (http status code에 따라 분기할 수 있습니다.)
 [L] : 마지막 RewriteRule 표시. (이후의 RewriteRule은 무시됨)

2. 
다중 Apache Port를 Redirect 시, 302 에러 발생할때 체크사항

1대의 서버에, 
80, 81 port 처럼 다중으로 사용시, 각각 443,444로 Redirect시 

SERVER IP = 123.123.123.123 일때, 81port를 444Port로 Redirect할때

 RewriteCond (.*) https://%{HTTP_HOST}:444%{REQUEST_URI}
으로 설정할 경우
123.123.123.123:81  처럼 :81가 붙어서 표시가 되면 제대로 Redirect가 안될경우가 있다.

기존에 사용하던 HTTP_HOST말고 SERVER_NAME으로 바꿔 사용하면


 RewriteCond (.*) https://%{SERVER_NAME}:444%{REQUEST_URI}


으로 정상적으로 진행된다.

참고 )




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

설정시 정확한 log 파악을 위해서

Rewritelog "/경로"
Rewriteloglevel 3
처럼 log설정해서 정확한 오류가 무엇인지 확인하면서 진행하길 추천한다.


 

posted by 은이종 2014. 7. 8. 19:22


ssl 설정시 아파치를 가동하면 비밀번호를 묻게 된다.
비밀번호 입력없이 실행되게 하기 위해서는 비밀번호를 파일로 생성후 파일을 읽어들여 구동되도록 변경한다.

# 비밀번호 파일 생성
[root@localhost home]# vi /usr/local/apache/conf/ssl/passwd.sh

#!/bin/sh
echo "비밀번호"


chmod 700 /usr/local/apache/conf/ssl/passwd.sh

위와 같이 입력후 httpd.conf 파일을 수정한다.

# httpd.conf 파일 수정 (혹은 extra/httpd-ssl.conf)
[root@localhost home]# vi /usr/local/apache/conf/httpd.conf

<IfModule mod_ssl.c>
..
..
# SSLPassPhraseDialog  builtin
SSLPassPhraseDialog  exec:/usr/local/apache/conf/ssl/passwd.sh
</ifModule>

httpd.conf 파일 내용중
SSLPassPhraseDialog builtin을 위에서 저장한 비밀번호 파일 경로로 변경한다.
SSLPassPhraseDialog exec:/usr/local/apache/conf/ssl/passwd.sh


변경 완료후.. 아파치 실행 테스트
/usr/local/apache/bin/apachect1 startssl


1. apache 비밀번호를 파일로 생성
2. apache 구동시 비밀번호를 파일에서 입력되도록 변경
3. apache 실행 확인.

최근 이슈가 되고있는 Openssl 업데이트 후에는 apache 재구동해야하는데
보통 사용하고있는 apachectl graceful로는 적용이 안되니, 필히 stop / start 로 재구동해야한다
 


SSL 인증서 멀티 패스워드 입력 방법

) 패스워드 스크립트 파일을 pass.sh 라고 설정했을시 해당 파일을 열어서 편집

vi pass.sh

  www.aaa.com:      443)          echo "aaaaa";;  

   도메인 부분       포트부분      패스워드 부분


+20170308 추가분

현재 Apache 2.2 버전 이상부터는 SNI지원으로
443 Port 1개에 2개이상의 도메인이 가능한 상황
그래서



등의 형태도 가능하니 꼭 설정할때 httpd-ssl.conf Port 확인



Copy&Paste 용

#!/bin.sh
case $1 in
 www.aaa.com:443) echo "aaaaa";;
 www.bbb.com:444) echo "bbbbb";;
esac

exit0

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

#!/bin.sh
case $1 in
 www.aaa.com:443) echo "aaaaa";;
 www.bbb.com:443) echo "bbbbb";;
esac

exit0
====================================================================================


Nginx SSL 설정

nginx.conf
-------------------------------------------------------
  server {

        listen 443;
        server_name ur.domain.name;

        ssl on;
        ssl_certificate /etc/nginx/ssl/ur_domain_name.crt.cat;
        ssl_certificate_key /etc/nginx/ssl/ur_domain_name.key;

        location / {
            root /var/www/html;
        }
    }

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

 참고로
Nginx 는 Apache와 다르게 SSLPassPhraseDialg 기능이 없다
비밀번호 자동입력은 불가능하고 방법은

아래처럼 인증서 비밀번호 자체를 제거해야한다.
(Private 인증서나, 상용 인증서 둘 다 가능)

cp ur_domain_name.key ur_domain_name.key.bak

openssl rsa -in  ur_domain_name.key.bak -out ur_domain_name.key

 


 

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

Apache socket_timeout , reply_timeout 설정  (0) 2015.12.30
Apache pagespeed 설치  (0) 2015.03.18
Apache method 설정  (0) 2014.11.25
Apache 멀티 Redirect시 주의점  (0) 2014.11.05
apache 재시작 스크립트  (0) 2013.05.24
posted by 은이종 2013. 5. 24. 15:56
간단하게 http stop 후 start하는 스크립트
start 후 http 데몬이 0인지 체크해서, 다시 시작하는 설정

내용상의 
/app/apache/bin/startHttpd.sh는
apachectl start가 포함되어있는 스크립트이다
(apache 데몬 소유 권한떄문에 스크립트를 만들어서 구동)

---------------------------------------------------------
#!/bin/bash
date

DAEMON=http
COUNT=$(ps acx | grep -c $DAEMON)

/app/apache/bin/startHttpd.sh stop

while [ 1 ]
do
COUNT=$(ps acx | grep -c $DAEMON)
if [ "$COUNT" -ne "0" ]; then
echo $COUNT
sleep 1
else
break;
fi
done

/app/apache/bin/startHttpd.sh
sleep 1

COUNT=$(ps acx | grep -c $DAEMON)
### http daemon check ###
if [ "$COUNT" -eq "0" ]; then
echo "$DAEMON is no running. "
echo "$DAEMON is re-start."
/app/apache/bin/startHttpd.sh
fi

echo "Apache restart done!"

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


/app/apache/bin/startHttpd.sh 
posted by 은이종 2013. 1. 9. 12:17

WAS는 웹 프로그램(혹은 웹 시스템, 웹 사이트, 웹 서비스 등)을 실행할 수 있는 기초적인 환경을 제공


종류로는 WebLogic, WebShpere, tomcat, Jeus, JBoss 등이 있다.

 



Web Application ?  웹을 기반으로 실행되는 프로그램을 의미.


웹브라우저            1.요청

웹서버                 2.처리를 요청

웹어플리케이션서버 3.처리를 수행

DB                     4.처리를 수행

웹어플리케이션      5.서버(처리결과 웹서버로 돌려보낸다)

웹서버                 5.응답

웹 브라우저 

 
 

Web Server

대표적으로 Apache, WebtoB 등이 있다. 
웹서버는 말그래도 작성된 html페이지 등을 네트워크망에 종속되지 않고, 웹서비스를 할 수 있도록 어플리케이션이라고 생각하면 간단하다.

HTTP를 통해 웹 브라우저에서 요청하는 HTML 문서나 오브젝트(이미지 파일 등)을 전송해주는 서비스 프로그램을 말한다

 

WAS는 이름에서 알수있듯이 web application을 수행할 수 있는 환경을 제공해주는 서버입니다.


 

Web Server 와 Web Application Server의 차이는 ??

웹서버의 아파치나 IIS와 같은 소프트웨어는 HTML/CGI나 기타 웹 문서들을 HTTP규약에 따라 웹 클라이언트와 주고받으며 통신하는 것이 주 역할입니다.

웹애플리케이션서버는 우선 규모가 크고 엔터프라이즈 환경에 필요한 트랜잭션, 보안, 트래픽관리, DB커넥션 풀, 사용자 관리 등등의 다양하고 강력한 기능을 제공하는 s/w를 의미합니다.

 

웹서버에 화면을 동적으로 보여주기위해 여러가지 로직이 들어가게되는데 한서버에 로직이 집중되어 있다보니 무거워지고 속도및 보안에 문제가 생긴다. 그래서 화면에 뿌려주는 로직(Presentation Logic)은 웹서버(Servlet Engine)에 실제돌아가는 로직(Business Logic)은 WAS에서 일을 나누어 역할 분담 시키는 것입니다.

[출처] WAS 란?|작성자 러브

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

각 M/W conf 백업  (0) 2015.06.30
cronolog symblic log 설정  (0) 2015.04.24
Advanced Rest Client (크롬 플러그인)  (0) 2014.11.26