eclispe 오류


error: org.codehaus.plexus.archiver.jar.Manifest.write(java.io.PrintWriter)



Please try the CI build from 


https://otto.takari.io/content/sites/m2e.extras/m2eclipse-mavenarchiver/0.17.2/N/LATEST/




go to "Help/Install new software/Add repository"




m2e extensions 업데이트

Posted by [czar]
,

./configure \

--prefix=/usr/local/nginx-1.11.10 \

--with-http_ssl_module \

--with-http_realip_module \

--with-http_addition_module \

--with-http_image_filter_module \

--with-http_sub_module \

--with-http_dav_module \

--with-http_flv_module \

--with-http_gzip_static_module \

--with-http_stub_status_module \

--with-http_v2_module \

--with-http_secure_link_module






심볼릭 링크 변경

ln -Tfs nginx-1.11.10/ nginx



Posted by [czar]
,

[sendmail] Relaying denied. IP name lookup failed


오류


step 1.


vi  /etc/mail/access



Connect:192.168.0.1                      RELAY

#접속할 IP 추가




메일 서버에 접속할  ip 추가 후 저장



step 2


/usr/sbin/makemap hash /etc/mail/access < /etc/mail/access


바로 적용 됨.



Posted by [czar]
,


java 에서 사용할 네트웍 관련 메서드들...


공인IP가져오기, 

IP 검증 등


package common.util;


import java.io.IOException;

import java.io.InputStream;

import java.net.URL;

import java.net.URLConnection;

import java.util.regex.Matcher;

import java.util.regex.Pattern;

import java.util.regex.PatternSyntaxException;


import javax.net.ssl.HostnameVerifier;

import javax.net.ssl.HttpsURLConnection;

import javax.net.ssl.SSLContext;

import javax.net.ssl.SSLSession;

import javax.net.ssl.TrustManager;

import javax.net.ssl.X509TrustManager;


public class NewtorkUtil {


public static void main(String[] args) {

System.out.println(ipToLong("192.168.0"));

}


private static Pattern VALID_IPV4_PATTERN = null;

private static Pattern VALID_IPV6_PATTERN = null;

private static final String ipv4Pattern = "(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])";

private static final String ipv6Pattern = "([0-9a-f]{1,4}:){7}([0-9a-f]){1,4}";


static {

try {

VALID_IPV4_PATTERN = Pattern.compile(ipv4Pattern, Pattern.CASE_INSENSITIVE);

VALID_IPV6_PATTERN = Pattern.compile(ipv6Pattern, Pattern.CASE_INSENSITIVE);

} catch (PatternSyntaxException e) {

// logger.severe("Unable to compile pattern", e);

}

}


/**

* IP Address 검증

* @param ipAddress

* @return

*/

public static boolean isIpAddress(String ipAddress) {


Matcher m1 = VALID_IPV4_PATTERN.matcher(ipAddress);

if (m1.matches()) {

return true;

}

Matcher m2 = VALID_IPV6_PATTERN.matcher(ipAddress);

return m2.matches();

}


/**

* IP 값 롱타입으로 변환

* @param ipAddress

* @return

*/

public static long ipToLong(String ipAddress) {

long result = 0;

if (isIpAddress(ipAddress)) {

String[] ipAddressInArray = ipAddress.split("\\.");


for (int i = 0; i < ipAddressInArray.length; i++) {

int power = 3 - i;

int ip = Integer.parseInt(ipAddressInArray[i]);

result += ip * Math.pow(256, power);

}

}


return result;

}


/**

* 공인 IP 가져오기 AWS API 사용해서 가져오기

* @return

*/

public static String getPublicIP() {

String result = null;


try {

String sUrl = "http://checkip.amazonaws.com/";

URL url = new URL(sUrl);

URLConnection clsConn = getConnection(url);

InputStream is = clsConn.getInputStream();

java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.InputStreamReader(is));

result = reader.readLine();

} catch (Exception ex) {

ex.printStackTrace();

}


return result;

}


public static URLConnection getConnection(URL url) {

URLConnection conn = null;

HttpsURLConnection https = null;


try {

if (url.getProtocol().toLowerCase().equals("https")) {

trustAllHosts();

https = (HttpsURLConnection) url.openConnection();

https.setHostnameVerifier(DO_NOT_VERIFY);

conn = https;

} else {

conn = url.openConnection();

}

} catch (IOException e) {

e.printStackTrace();

}

return conn;

}


final static HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() {

@Override

public boolean verify(String hostname, SSLSession session) {

return true;

}

};


private static void trustAllHosts() {

// Create a trust manager that does not validate certificate chains

TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {

@Override

public java.security.cert.X509Certificate[] getAcceptedIssuers() {

return new java.security.cert.X509Certificate[] {};

}


@Override

public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {

}


@Override

public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {

}

} };


// Install the all-trusting trust manager

try {

SSLContext sc = SSLContext.getInstance("TLS");

sc.init(null, trustAllCerts, new java.security.SecureRandom());

HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());

} catch (Exception e) {

e.printStackTrace();

}

}


}



Posted by [czar]
,


nginx letsencrypt 설치

Let's Encrypt 인증서 발급



/home/data/letsencrypt 폴더 미리 생성해두기 - 임의의 경로로 변경 가능


vi well-known.conf 


location ~ /.well-known/acme-challenge {

        root /home/data/letsencrypt;                    // 임의의 경로로 설정

        allow all;

}



vi nginx.conf


server {

include well-known.conf;    // 위에서 생성한 well-known.conf 파일

}






./letsencrypt-auto certonly



이메일 입력


도메인입력

a.domain.com, b.domain.com, c.domain.com


IP being logged? 동의



인증관련 폴더 선택하는 부분이 나오는데 아래쪽에 설정한

/home/data/letsencrypt 폴더 선택 하면 알아서 인증해줌.



vi ssl_domain.conf


listen          443 ssl;


ssl on;

ssl_certificate         /etc/letsencrypt/live/a.domain.com/fullchain.pem;

ssl_certificate_key     /etc/letsencrypt/live/a.domain.com/privkey.pem;

ssl_trusted_certificate /etc/letsencrypt/live/a.domain.com/chain.pem;


ssl_prefer_server_ciphers   on;

ssl_protocols               TLSv1 TLSv1.1 TLSv1.2 SSLv2 SSLv3;

#ssl_ciphers                 EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;


ssl_ciphers  'ECDH !aNULL !eNULL !SSLv2 !SSLv3';        # A+


add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";


ssl_stapling on;

ssl_stapling_verify on;


resolver 8.8.8.8;




위와 비슷하게 설정하면 됨.


nginx 에서 ssl 적용할 도메인 설정된 부분


vi nginx.conf

server {

include well-known.conf;        // 위에서 생성한 well-known.conf 파일

include ssl_domain.conf;        // ssl 설정  

}




letsencrypt 는 3개월에 한번씩 갱신해줘야함.


vi lets-renew.sh


/root/letsencrypt/letsencrypt-auto certonly -a webroot --agree-tos --renew-by-default --webroot-path=/home/data/letsencrypt/ -d a.domain.com -d b.domain.com -d c.domain.com

service nginx reload



crontab 에 등록

#mm hh day month week cmd


0 1 1 */2 * /root/lets-renew.sh #> dev/null 2>&1


// 2달에 한번씩~~



Posted by [czar]
,
https://www.twitch.tv/settings/connections
OAuth 연동
개발자 커스텀 애플리케이션 - 

애플리케이션 등록
jQuery
$.ajax({
type: 'GET',
url: 'https://api.twitch.tv/kraken/channels/twitch',
headers: {
'Client-ID': 'axjhfp777tflhy0yjb5sftsil'
},
success: function(data) {
console.log(data);
}
});
cURL
curl -i -H 'Accept: application/vnd.twitchtv.v3+json'\
-H 'Client-ID: axjhfp777tflhy0yjb5sftsil'\
'https://api.twitch.tv/kraken/channels/twitch'
PHP
<?php
$channelsApi = 'https://api.twitch.tv/kraken/channels/';
$channelName = 'twitch';
$clientId = 'axjhfp777tflhy0yjb5sftsil';
$ch = curl_init();

curl_setopt_array($ch, array(
CURLOPT_HTTPHEADER => array(
'Client-ID: ' . $clientId
),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $channelsApi . $channelName
));

$response = curl_exec($ch);
curl_close($ch);
?>






Posted by [czar]
,
<style type="text/css">
<!--
body {
background:url(http://www.prowebdesign.ro/screen-ruler/screeen-ruler.png) top left no-repeat;}
-->
</style>

홈페이지 화면에 룰러 자 표시해서 사이즈 확인용

Posted by [czar]
,

JSON 으로 호출하는데  415 Unsupported Media Type 오류가 발생한다.



@Path("/login")

@POST

@Consumes({ MediaType.APPLICATION_JSON }) // 수신

@Produces({ MediaType.APPLICATION_JSON }) // 응답

@Transactional

public Response login(@Context HttpServletRequest httpServletRequest, JSONObject jsonObject) {

System.out.println("jsonObject= = " + jsonObject);

int status = HttpServletResponse.SC_OK;

String authCredentials = httpServletRequest.getHeader(AUTHENTICATION_HEADER);


AuthenticationService authenticationService = new AuthenticationService();

boolean authenticationStatus = authenticationService.authenticate(authCredentials);

if (authenticationStatus) {

} else {

status = HttpServletResponse.SC_UNAUTHORIZED;

}

return Response.status(status).entity(jsonObject).build();

}



확인해야할 사항은


Content-Type: application/json to the "Headers":


headers 에 Content-Type이 application/json 으로 설정되어 있는지 확인한다.



 


Posted by [czar]
,

tomcat jdbc jar

카테고리 없음 2016. 10. 13. 11:27

tomcat

sqljdbc41.jar

mysql-connector-java-5.1.38-bin.jar


Posted by [czar]
,

잘 되던 프로젝트가 계속 오류를 발생시킨다...... 


Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean)


Goals 는 clean install 만 있었으나




http://stackoverflow.com/questions/19489720/maven-failed-to-clean-project-failed-to-delete-org-ow2-util-asm-asm-tree



-Dmaven.clean.failOnError=false


항목을 추가해보라는 말에.


clean install -Dmaven.clean.failOnError=false



오..... 잘된다...

Posted by [czar]
,