1. 설치
# cd /usr/local
# yum install epel-release
# rpm -ivh https://rhel6.iuscommunity.org/ius-release.rpm
# yum install git python27 python27-devel python27-pip python27-setuptools python27-virtualenv python27-libs
# git clone https://github.com/certbot/certbot
# chattr -i /usr/bin/gcc /usr/bin/g++
# cd /usr/local/certbot
# /usr/local/certbot/certbot-auto certonly
# chmod 700 /usr/bin/gcc /usr/bin/g++;chattr +i /usr/bin/gcc /usr/bin/g++
# cd /usr/local/certbot
# ./certbot-auto certonly --server https://acme-v01.api.letsencrypt.org/directory \
                   --rsa-key-size 4096 --agree-tos --email enteroa.j@gmail.com \
                   --webroot -w /free/home/enteroa/html/ \
                   -d wp.enteroa.kr
 
2. 아파치 설정(/extra/httpd-ssl.conf)
SSLProtocol            ALL -SSLv2 -SSLv3
SSLCipherSuite         ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK
SSLHonorCipherOrder    on
 
Listen 443
<VirtualHost *:443>
DocumentRoot /free/home/enteroa/html
ServerName wp.enteroa.kr
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/wp.enteroa.kr/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/wp.enteroa.kr/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/wp.enteroa.kr/chain.pem
SSLCACertificateFile /etc/letsencrypt/live/wp.enteroa.kr/fullchain.pem
Header always set Strict-Transport-Security "max-age=15552000"
</VirtualHost>

 

블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,

* MyBatis

출처 : http://syaku.tistory.com/267

 

'java, jsp, spring, egov' 카테고리의 다른 글

javac 사용법  (0) 2018.07.17
hudson 자동배포 구성  (0) 2017.10.20
spring 3.x 인터셉터(interceptor) 설정  (0) 2016.04.11
spring3.1.1에서 3.2.8로 버전업  (0) 2016.04.11
spring 3.x 타일즈(tiles2) 적용  (0) 2016.04.09
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,

1. servlet-context.xml 설정

<interceptors>
	<interceptor>
		<mapping path="/**/*" />
			<exclude-mapping path="/main/*" />
			<exclude-mapping path="/login/*" />
		<beans:bean class="com.jeyun.controllers.HelloInterceptor"></beans:bean>
	</interceptor>
</interceptors>

2. interceptor.java 설정

package com.text.controllers;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

public class Interceptor implements HandlerInterceptor {

	public boolean preHandle(HttpServletRequest req, HttpServletResponse res, Object handler) {
		return true;
	}

	public void postHandle(HttpServletRequest req, HttpServletResponse res, Object handler, ModelAndView mv) {
		//
	}
  
	public void afterCompletion(HttpServletRequest req, HttpServletResponse res, Object handler, Exception ex) {
		//
	}
  
}

 

블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,

* pom.xml

- 변경전

<properties>
  <java-version>1.6</java-version>
  <org.springframework-version>3.1.1.RELEASE</org.springframework-version>
  <org.aspectj-version>1.6.10</org.aspectj-version>
  <org.slf4j-version>1.6.6</org.slf4j-version>
</properties>

- 변경후

<properties>
  <java-version>1.6</java-version>
  <org.springframework-version>3.2.8.RELEASE</org.springframework-version>
  <org.aspectj-version>1.6.10</org.aspectj-version>
  <org.slf4j-version>1.6.6</org.slf4j-version>
</properties>

* "3.1.1"을 "3.2.8"로 변경하면 끝(Interceptor를 설정하다가 exclude-mapping이 Spring 3.2.0부터 지원해서 버전업)

블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,

* pom.xml

<properties>
  <org.apache.tiles-version>2.2.2</org.apache.tiles-version>
</properties>

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-orm</artifactId>
  <version>${org.springframework-version}</version>
</dependency>

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-test</artifactId>
  <version>${org.springframework-version}</version>
</dependency>

<dependency>
  <groupId>org.apache.tiles</groupId>
  <artifactId>tiles-core</artifactId>
  <version>${org.apache.tiles-version}</version>
</dependency>

<dependency>
  <groupId>org.apache.tiles</groupId>
  <artifactId>tiles-servlet</artifactId>
  <version>${org.apache.tiles-version}</version>
</dependency>

<dependency>
  <groupId>org.apache.tiles</groupId>
  <artifactId>tiles-jsp</artifactId>
  <version>${org.apache.tiles-version}</version>
</dependency>

* servlet-context.xml(기존 resolver 주석)

<beans:bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
  <beans:property name="definitions">
    <beans:list>
      <beans:value>/WEB-INF/views/layouts.xml</beans:value>
    </beans:list>
  </beans:property>
 
  <beans:property name="preparerFactoryClass" value="org.springframework.web.servlet.view.tiles2.SpringBeanPreparerFactory" />
</beans:bean>

<beans:bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
  <beans:property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView" />
</beans:bean>

* layouts.xml

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
       "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">

<tiles-definitions>
  
  <definition name="layouts-kr" template="/WEB-INF/views/kr/inc/layouts.jsp">
    <put-attribute name="header" value="/WEB-INF/views/kr/inc/header.jsp" />
    <put-attribute name="content" value="" />
    <put-attribute name="footer" value="/WEB-INF/views/kr/inc/footer.jsp" />
  </definition>

  <definition name="*.kr" extends="layouts-kr">
    <put-attribute name="content" value="/WEB-INF/views/kr/{1}.jsp" />
  </definition>

  <definition name="*/*.kr" extends="layouts-kr">
    <put-attribute name="content" value="/WEB-INF/views/kr/{1}/{2}.jsp" />
  </definition>

  <definition name="*/*/*.kr" extends="layouts-kr">
    <put-attribute name="content" value="/WEB-INF/views/kr/{1}/{2}/{3}.jsp" />
  </definition>

</tiles-definitions>

* layouts.jsp

<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="t"%> 

<t:insertAttribute name="header" />
<t:insertAttribute name="content" />
<t:insertAttribute name="footer" />
출처 : http://blog.naver.com/PostView.nhn?blogId=jazz1234k&logNo=40123376205
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
sql> create user scott(아이디) indentified by tiger(비밀번호);
sql> grant connect, resource to scott;
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,