본문 바로가기

Development/Web & Server

Spring MimeMessageHelper attachment filename encoding System.setProperty("mail.mime.splitlongparameters", "false"); MimeMessage message = sender.createMimeMessage(); MimeMessageHelper helper = new MimeMessageHelper(message, true, "UTF-8"); // Your email content helper.setFrom("..."); helper.setTo("..."); helper.setSubject("..."); helper.setText("..."); helper.addAttachment( MimeUtility.encodeWord(attachmentFilename), attachmentConten 더보기
How do I redirect HTTP traffic on my server to HTTPS on my load balancer? AWS 에서 Load Balancer를 이용할 때 내부에서는 80포트 이지만 Load Balancer로 433포트로만 받고 싶을 경우에사용하는 방법이다. ==IssueI am using both HTTP and HTTPS listeners on my Elastic Load Balancing (ELB) load balancer. The ELB is offloading SSL, and the backend is listening only on a single HTTP port (HTTPS to HTTP). I want all traffic coming to my web server on port 80 to be redirected to HTTPS port 443, but I don’t want to chan.. 더보기
Redirect from HTTP to HTTPS and viceversa with Apache ProxyPass AWS의 무료 SSL 인증서를 사용하다보니 아래와 비슷한 상황이 발생하였다. AWS 의 무료 SSL은 Load Balancer 와 Cloud Front으로만 제공해주기 때문이다. (본인의 경우 Client Https Request => Load Balancer(Http) => API(Https)) 해결방법 1. EC2 에서 sudo yum install -y mod24_ssl 명령으로 설치2. 아래의 예시 참고 3456789101112 NameVirtualHost *:80 ServerName mysite.com SSLProxyEngine On RequestHeader set Front-End-Https "On" CacheDisable * ProxyPass /myapp https://tomcat-host:.. 더보기
React에 XLSX & Webpack 설정 참고 : https://github.com/SheetJS/js-xlsx/issues/285 module.exports = { // (...) plugins: [ // (...) new webpack.IgnorePlugin(/cptable/) ], node: { fs: "empty" }, externals: [ { "./cptable": "var cptable", "./jszip": "jszip" } ] }; 더보기
SPRING BOOT COMMUNICATIONS LINK FAILURE WITH MYSQL AND HIBERNATE http://blog.netgloo.com/2015/07/09/spring-boot-communications-link-failure-with-mysql-and-hibernate/ 더보기
[MongoDB] EC2 설치 후 연결이 안될때 ec2의 포트 설정이나 모든 것이 다 되어있고 로컬 테스트에서도 성공을 한 경우에 ec2 서버에 직접 동작을 하지 않는다면 /etc/mongod.conf 설정에서 bind ip라는 항목을 0.0.0.0 으로 변경해보자! 더보기
로그아웃 하여도 실행중인 프로그램이 중지 되지 않는 명령어 nohup 명령어 이며nohup.out 에 표준출력이 기록된다. 더보기
[Play Framework] Scala Test 1. Test 폴더에 Scala 테스트 클래스를 작성한다. 2. 관련 라이브러리 importimport play.api.test._ import play.api.test.Helpers._ 3. Application 상황에서 테스트를 하고 싶다면val fakeApplicationWithGlobal = FakeApplication(withGlobal = Some(new GlobalSettings() { override def onStart(app: Application) { println("Hello world!") } })) 4. 테스트 Object 작성object ExamplePlaySpecificationSpec extends PlaySpecification { "The specification" sh.. 더보기
[Play Framework] Scala에 Hibernate + Jasypt 적용하기 1. 라이브러리 추가(http://www.jasypt.org/hibernate.html)"org.jasypt" % "jasypt-hibernate4" % "1.9.2"2. 초기값 설정class ApplicationLoader extends GuiceApplicationLoader { override def builder (context: ApplicationLoader.Context) : GuiceApplicationBuilder = { val stringEncryptor = new StandardPBEStringEncryptor() stringEncryptor.setPassword("asdfweqfqwef")//아무거나.. HibernatePBEEncryptorRegistry .getInstance().. 더보기
[Play Framework] Request Handler 처리 방법 Play Framework 2.4버전 처리 방법이다 (https://www.playframework.com/documentation/2.4.x/ScalaHttpRequestHandlers) import javax.inject.Inject import play.api.http._ import play.api.mvc._ import play.api.routing.Router class SimpleHttpRequestHandler @Inject() (router: Router) extends HttpRequestHandler { def handlerForRequest(request: RequestHeader) = { router.routes.lift(request) match { case Some(handle.. 더보기