Create Security Credentials(Access Key,Secret Key 생성)


AWS를 사용하려면 콘솔에 접속하는 계정과는 별도로 인증을 위한 Key가 존재한다.


이 Key는 S3, RDS, EC2등을 이용할때 아이디와 패스워드 처럼 사용된다. 이 키를 생성하는 법을 알아보도록 하겠다.



1. Manager Console에 접속한다.  접속후 우측상단에 보면 본인 계정 명이 써있는 곳에 클릭을하면 아래와 같은 레이어가 열리는걸 확인 할 수 있다. 예상한대로 빨간색 표시된 부분 클릭




2. 다음의 그림과 같은 팝업창이 당신을 반길것이다. 역시나 빨간색 부분 클릭




3. 그림대로 한다



4. Access Keys를 펼치면  아래 그림과 같이 나온다 키를 생성한 적이 없다면 아무것도 없을 것이다. 

    아래의 Create New Access Key를 눌러서 키를 생성한다. 

    키를 잘못 만들었다면 Actions 항목에서 Delete를 하면 아래의 그림처럼 삭제됨이라고 표시가되고 이력이 남는다.


※주의 아래의 Create New Access Key 버튼을 누르는 순간 키가 생성된다. 



5. Show Access Key를 눌러서 본인이 생성한 키를 볼수 있다. 

    Download Key File을 눌러서 다운로드해서 보관하는게 좋다. 

    이유는 Secret Key는 한번밖에 볼수가 없다. 

     즉 생성할떄 한번 보고나면 저장을 하지 않을경우 따로 다시 확인할 수 없는것이다.




6. 보안에 주의하여 잘 사용하도록 한다. 저장시 CSV 파일로 저장해 준다. 






AWS CLI(Amazon Command-Line) 환경설정


이 메뉴얼은 Windows를 기준으로 작성되었음을 알립니다.


그지같은 AWS를 사용하다보면 Management Console로만으로는 부족한 기능이 많다.

그래서 AWS를 보다 세밀하게 사용하기 위해 CLI를 통해서 작업해야하는 상황이 발생하게 되어있다.


1.준비물 : JAVA, AWS CLI(AWSCLI32.msi)

- java는 오라클 사이트 가서 알아서 받는다.

http://aws.amazon.com/ko/cli/에 가면 아래의 붉은색 표시된곳에서 각자의 환경에 맞게 설치한다.




2. 해당 파일을 다 설치한 후 Cmd 명령창에서 AWS를 입력할 경우 

    『응용프로그램의 Side by Side 구성이 잘못되어 응용프로그램을 시작하지 못했습니다.』 를 만날경우가 있다. 

    이 경우 다음의 링크를 따라가서 해결하고 다시 여기로 온다. (http://cheezred.tistory.com/24)



3. 자 2번의 상태가 아니라면 또는 2번을 해결하고 난 뒤라면  Cmd 명령창에서 AWS를 입력할 경우 다음과 같은 메세지를 볼수 있다면 설치는 성공한 것이다.



4. 이제 본격적인(본격적이랄것도 없다) 환경설정을 한다.

- 아래 그림과 같이 aws configure 라고 입력할 경우  아래와 같은 메세지를 만날 수 있는데 빨간색 줄에 각 항목의 값을 입력해준다.

- Access Key, Secret Key, region, output format을 본인의 환경에 맞게 설정해준다.

Access Key, Secret Key는 Manager Console에서 생성 할 수 있다.




5. 기본적인 사용을 윙한 설정이 끝났다.



프로그램을 실행하려고 할때 아래와 같은 메세지가 나오는 경우가 있다..

(난 AWS CLI를 실행하려니까 나왔다..)



위의 내용은 개발자들이 작업할때 "아 이게 또 뭐여?" 할수도 있는데..


설명에 잘 나와 있다.. 이벤트로그를 보라고 써있는것이다. 보통은 프로그램을 실행할때 필요한 패키지가 없어서 위의 메세지를 만나게된다.


위와 같은 오류가 발생하게 되면 

제어판 > 이벤트 뷰어


를 확인하도록 한다.


그러면 로그에 아래와 같은 유사한 내용을 볼 수 있다.


"????!@#!#!#!"에 대한 활성화 컨텍스트를 생성하지 못했습니다. 종속 어셈블리 Microsoft.VC80.DebugCRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50608.0"을(를) 찾을 수 없습니다. 자세한 진단을 위해서는 sxstrace.exe를 사용하십시오.


빨간색 부분을 구글링 하면 해당 현상에 대한 오류에 대한 리포팅을 찾을 수 있다.



대게 Microsoft.VC80.CRT나 Microsoft.VC90.CRT와 같은 경우는 Visual C++ Redist 패키지를 설치하면 해결이 가능하다.


추가 : 관련 AWS URL : https://forums.aws.amazon.com/thread.jspa?threadID=142537&tstart=0


http://www.youtube.com/watch?v=yP4EHnKcOrc




'Development > Java' 카테고리의 다른 글

CustomTypeHandler를 이용한 Mybatis ResultType 설정  (0) 2014.06.16
JSP의 내장객체  (0) 2014.06.04
SuppressWarnings  (0) 2014.06.02
spring-framework Download  (0) 2014.05.22
Java Mail 구현  (0) 2014.05.21

https://github.com/spring-projects/spring-framework/releases




공홈갔더니 Maven으로만 다운 받으라고 하길래.. 

'Development > Java' 카테고리의 다른 글

CustomTypeHandler를 이용한 Mybatis ResultType 설정  (0) 2014.06.16
JSP의 내장객체  (0) 2014.06.04
SuppressWarnings  (0) 2014.06.02
[펌] jenkins로 서버에 자동 배포하기  (0) 2014.05.22
Java Mail 구현  (0) 2014.05.21
activation.jar mail.jar 파일 들이 필요한데,
http://java.sun.com/products/javamail/downloads/index.html 에서 받을 수 있다.
JavaBeans Activation Framework와 JavaMail 에 포함되어 있다.

이 두 파일은 톰캣의 common/lib나 JRE 등의 경로 내에 있어야 한다.

<%@page contentType = "text/html; charset=euc-kr" %>
<%@ page import="java.util.*,java.io.*,javax.mail.*,javax.mail.internet.*,javax.activation.*" %>
<%
// javamail lib 이 필요합니다.
class MyAuthentication extends Authenticator {
PasswordAuthentication pa;
public MyAuthentication(){
pa = new PasswordAuthentication("아이디", "비밀번호");
}

public PasswordAuthentication getPasswordAuthentication() {
return pa;
}
}

String subject = "Test"; //subject
String msgText = "메일 가니? \n안가니?\n"; //message
String host = "kornet.net"; //smtp mail server
String from = "zxcasd@zxcasd.pe.kr"; //sender email address
String to = "zxcasd12@gmail.com"; //receiver email address

Properties props = new Properties();
props.put("mail.smtp.host", host);
props.put("mail.smtp.auth","true");

Authenticator auth = new MyAuthentication();
Session sess = Session.getInstance(props, auth);

try {
Message msg = new MimeMessage(sess);
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject(subject);
msg.setSentDate(new Date());
msg.setContent(msgText,"text/html; charset=euc-kr"); // HTML 형식
// msg.setText(msgText); // TEXT 형식

Transport.send(msg);
out.println("^_^");
} catch (MessagingException mex) {
out.println(mex.getMessage()+"<br>");
out.println("-_-;;.");
}

%>


서버에 따라 빨간 부분 바꿔주고, 전송할 내용 바꿔주면 된다.
(어떤 서버는 smtp 로긴 아이디를 이메일 통째로 입력해야 하는 경우도 있다.)

'Development > Java' 카테고리의 다른 글

CustomTypeHandler를 이용한 Mybatis ResultType 설정  (0) 2014.06.16
JSP의 내장객체  (0) 2014.06.04
SuppressWarnings  (0) 2014.06.02
[펌] jenkins로 서버에 자동 배포하기  (0) 2014.05.22
spring-framework Download  (0) 2014.05.22

상속 방법.

function MyParent(){ }

function MyClassA(){}

MyClassA.prototype = new MyParent ()

constructor를 설정하는 이유는?

MyClassA.prototype = new MyParent();

/* 아래 구문이 실행되기 전까지의 MyClassA.prototype.constructor = MyParent임.

constructor용도는 객체의 타입을 구분하기 위해서 사용됨.

*/
MyClassA.prototype.constructor = MyClassA;

 

'Web > JQuery' 카테고리의 다른 글

checkbox checked 설정  (0) 2014.10.17
Datepicker 대만 번체 zh-TW 번역자료  (0) 2014.07.28
Javascript override 방법  (0) 2014.05.21
jQuery.ajax() 사용시 중복호출 방지하는 방법  (0) 2014.05.21
[IE9 짜증남] IE 버전 체크  (0) 2014.05.21

override 방법

반드시 call(this)를 처럼 해야 됨.

그렇지 않은 경우, Parent의 private메소드를 호출하지 못하게 됨.

MyClassA.prototype.test4 = function() {
alert("MyClassA.prototype.test4" );
MyParent.prototype.test4.call(this);
}

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

예제)

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>무제 문서</title>
<script language="javascript">
function MyParent(nWidth, nHeight)
{
// private 변수 생성.
var width = nWidth;
var height =nHeight;

// 읽기전용 메소드 생성.
this.getWidth = function() {return this.width;}
this.getHeight = function() {return this.height;}
}

// 인스턴스 메소드.
MyParent.prototype.test1 = function()
{
alert("MyParent.prototype.test1 ");
}
// 인스턴스 메소드에서 읽기전용 호출 테스트.
MyParent.prototype.test2 =function ()
{
alert("MyParent.prototype.test2() getWidth = "+this.getWidth());
}

// 인스턴스 메소드에서 읽기전용 호출 테스트.
MyParent.prototype.test3 =function ()
{
alert("MyParent.prototype.test3() getHeight = "+this.getHeight());
}

MyParent.prototype.test4=function()
{
alert("MyParent.prototype.test4");
}

MyParent.prototype.name ="ddan";






function MyClassA(nValue)
{
this.superClass(10,10);
// private 프로퍼티 생성.
this.value = nValue;
}
MyClassA.prototype = new MyParent();
MyClassA.prototype.constructor = MyClassA;
MyClassA.prototype.superClass = MyParent;

// override
MyClassA.prototype.test2 =function()
{
alert("MyClassA.prototype.test2 " );
MyParent.prototype.test2.call(this);
}

// override
MyClassA.prototype.test4 =function()
{
alert("MyClassA.prototype.test4" );
MyParent.prototype.test4.call(this);
}


function on_Load()
{

var objClassA1 = new MyClassA(40);

objClassA1.test1();
// override 한 메소드 호출.
objClassA1.test2();
objClassA1.test3();
// override 한 메소드 호출.
objClassA1.test4();
}


</script>
</head>
<body onLoad="on_Load()">
</body>
</html>

 

'Web > JQuery' 카테고리의 다른 글

checkbox checked 설정  (0) 2014.10.17
Datepicker 대만 번체 zh-TW 번역자료  (0) 2014.07.28
JavaScript Class 상속  (0) 2014.05.21
jQuery.ajax() 사용시 중복호출 방지하는 방법  (0) 2014.05.21
[IE9 짜증남] IE 버전 체크  (0) 2014.05.21

jQuery.ajax() 사용시 중복호출 방지하는 방법

jQuery.ajax() 함수를 버튼 이벤트 같은 곳에 걸어두었을 경우 버튼을 여러번 클릭시 request 요청이 여러번 날아가서 오동작을 일으키는 경우가 있다.

이 때 아래와 같은 방법들로 해결할 수 있다.

1. jQuery.ajax() 세팅 옵션에 async: false 추가하는 방법

jQuery.ajax() 는 default 세팅 값이 true 로 되어 있어 요청을 비동기로 처리하게 되는데 async: false 옵션을 추가하면 동기로 처리하게 된다.

동기로 처리하게되면 아까 위와 같은 상황에서 버튼을 눌러 request 요청을 날렸을 때 response 요청이 올 때까지 다른 request 요청은 받지 않게 되어 중복호출을 방지한다.

 

 

 

2. 버튼에 클릭 이벤트를 jQuery.bind(), jQuery.unbind() 로 처리하는 방법

아래와 같이 jQuery.ready() 에 클릭 이벤트를 bind 시켜놓고, 한 번 클릭시 클릭 이벤트를 unbind 시켜 ajax 요청이 끝나면 다시 bind 시키는 방법이다.

 
     $(document).ready(function() {
           $('#foo').bind('click', function() {
                 doSomething();  
           });
           var doSomething = function(){
           $('#foo').unbind('click');
           $.ajax({ 
                         type: "POST",
                         url: "some.do"
            }).done(function() {
                         $('#foo').bind('click', function() {
                                 doSomething();
                     });  
             });
}
 
 
3. jQuery Block UI Plugin을 사용하는 방법

플러그인을 사용하는 방법으로 위 플러그인을 사용하게 되면 요청이 들어왔을 때 Please wait… 와 같은 Progress 메세지를 띄우면서 페이지에서 다른 이벤트를 막아버린다.

띄울 메세지를 css를 사용하여 커스텀으로 작성할 수도 있다.

 

 

 

'Web > JQuery' 카테고리의 다른 글

checkbox checked 설정  (0) 2014.10.17
Datepicker 대만 번체 zh-TW 번역자료  (0) 2014.07.28
JavaScript Class 상속  (0) 2014.05.21
Javascript override 방법  (0) 2014.05.21
[IE9 짜증남] IE 버전 체크  (0) 2014.05.21

웹 서버나 웹 페이지는 인터넷 브라우저로부터 종류와 버전 등의 정보를 받아서 각 브라우저와 버전에 맞는 페이지를 보여주게 합니다. 이 때 브라우저에서 제공하는 정보를 UA(User Agent) string이라고 합니다.
예를 들어 IE8까지는 “Mozilla/4”였던 UA String 값이 IE9에서는 “Mozilla/5”로 변경되었으므로
단순히 UA String 값이 ‘Mozilla/5’ 인지를 비교하여 Internet Explorer와 타 브라우저를 판단하여서는 안됩니다.
또한 “MSIE 9.0” 값을 얻어서 IE의 버전이 “9”임을 인식할 수 있습니다.


function getInternetExplorerVersion() {
var rv = -1;
if (navigator.appName == 'Microsoft Internet Explorer') {
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat(RegExp.$1);
}
return rv;
}


function checkVersion() {
var ver = getInternetExplorerVersion();
if (ver > -1)
msg = "You are using Internet Explorer " + ver;
else
msg = "You are not using Internet Explorer";
alert(msg);
}

 

'Web > JQuery' 카테고리의 다른 글

checkbox checked 설정  (0) 2014.10.17
Datepicker 대만 번체 zh-TW 번역자료  (0) 2014.07.28
JavaScript Class 상속  (0) 2014.05.21
Javascript override 방법  (0) 2014.05.21
jQuery.ajax() 사용시 중복호출 방지하는 방법  (0) 2014.05.21

+ Recent posts