2014년 10월 28일 화요일

IIS 외부 링크 방지하는 법

IIS 외부 링크 방지하는방법
※IIS 7.0 이상

웹사이트선택후 URL 재작성 선택. URL 재작성이 없다면 "웹 플랫폼관리자" 를 통해 
IIS 에 추가설치 합니다.












인바운드 규칙 편집의 패턴에  입력한 정규식으로 URL 을 필터링할 수 있습니다. 예제로 들어있는 내용은 특정 이미지확장자들을 외부에서 바로 들어올 경우를 필터링합니다.

마지막으로 URL 재작성란에 넣는 주소는, 필터링된 주소일 경우 이동시킬 경로를 적어주시면 됩니다. 

2014년 10월 6일 월요일

phaser.js 테스트코딩




phaser 튜토리얼을 찾다보니 node.js 를 이용한 소스가있어서 따라해보았습니다.
예제에선 requirejs 의 모듈화기능으로 sprite 들을 다 모듈화해서 코딩하는데, node.js 없이 하려니 새로코딩한게 되버렸네요.
어찌어찌 되긴하는데, 이게 제대로코딩된건지도 모르겠네요^^;;

2014년 8월 31일 일요일

Sublime Text 자동정렬 단축키 설정




{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } }

단축키는 원하는대로 바꾸면 된다 .



2014년 8월 14일 목요일

Set upload file size for PHP on WebMatrix 3

사용자가 설치한 PHP 폴더경로와 webmatrix 에 설치된 PHP 의 경로가 다르다.


webmatrix 의 설치 경로는

C:\Program Files (x86)\PHP\v5.3\php.ini

win7 64bit 기준
C:\Program Files (x86)\IIS Express\PHP\v5.3\php.ini

PHP 버전은 달라질 수 있다.

// 4GB
post_max_size = 4096M 
upload_max_filesize = 4096M


이것만으로 안된다면

web.config

<system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="4294967295"/>
      </requestFiltering>
    </security>
</system.webServer>



추가해주면된다.


ps. iis 에 호스팅된 php 사이트를 webmatrix 로 열때도 iis 의 설정과는 별개로 위처럼 설정해 주어야 한다.


2014년 5월 14일 수요일

Error: Request Entity Too Large

connect module 을 사용중이라면 이렇게 간단하게 용량 제한을 설정 가능하다.

2014년 3월 10일 월요일

Sublime Text 2, 3 한글 깨짐 문제








파일의 인코딩을 UTF-8, euc-kr 로 바꿨는데도
한글 입력시 ? 물음표로 나오면서 깨질 경우가 있는데, 
폰트를 바꿔주면 된다.



Preferences - Settings-User 에서 
"Font_face":"Gulim"
을 추가해주면 되고, 다른 한글 폰트를 선택해줘도 상관없다.




2014년 2월 4일 화요일

node.js mongodb ObjectId 사용법

mongodb-native 모듈을 사용할 때, 아래와 같이 하면 된다.

2014년 1월 25일 토요일

iis ftp 데이터 채널 포트 범위 회색 / 비활성





위 처럼 일반 사이트를 선택하시면 안되고,





트리 노드중 가장위의 localhost 를 선택후, FTP 방화벽 지원을 선택 하시면
수정가능 합니다.

SOLVED: iis ftp data channel port range greyed out / disable





don't select site






select local node(http://localhost/) in left tree.



2014년 1월 20일 월요일

asp.net (C#) WebMethod return string

index.cs index.aspx index.cs 에서 return 은 data.d 로 넘겨준다.

2014년 1월 19일 일요일

MongoDB path in spacebar (windows)


If your path includes spaces, enclose the entire path in double quotations, for example: 

C:\mongodb\bin\mongod.exe --dbpath "d:\test\mongo db data"

2014년 1월 10일 금요일

node.js + express + swig + socket.io

express + swig + socket.io 입니다.
var port=3000;

var swig  = require('swig'),
    express = require('express'),
    app = express(),
    io = require('socket.io').listen(app.listen(port));

    app.engine('html', swig.renderFile);
    app.set('view engine', 'html');
    app.set('views', public_dir);

    // Swig will cache templates for you, but you can disable
    // that and use Express's caching instead, if you like:
    app.set('view cache', false);
    // To disable Swig's cache, do the following:
    swig.setDefaults({ cache: false });
    // NOTE: You should always cache templates in a production environment.
    // Don't leave both of these to `false` in production!
    app.get('/', function (req, res) {
      res.render('index', {  
        pagename: 'awesome people',
        authors: ['Paul', 'Jim', 'Jane']
      });
      
    });

io.sockets.on('connection', function (socket) {
  // socket code
});
이렇게 작성하면 app.get 부분에서 index 에 pagename: 'awesome people', authors: ['Paul', 'Jim', 'Jane'] 이 값을 넘겨줍니다. 그럼 index.html 에선

{{ pagename|title }}

    {% for author in authors %}
  • {{ author }}
  • {% endfor %}
이런 식으로 쓰겠죠..

 참고자료
 swig 예제 : http://paularmstrong.github.io/swig/
 swig + express : http://paularmstrong.github.io/swig/docs/#express
 express + socket.io : http://socket.io/#how-to-use (Using with the Express web framework)