LinkLint 사용기

  • Post author:
  • Post category:
  • Post comments:0 Comments
  • Post last modified:May 26, 2008

웹 사이트의 깨진 링크, 이미지 등을 없애자란 글을 읽고 나도 해봤다. 실은 ExpressionEngine에 비슷한 기능을 제공하는 플러그인이 있었던 걸로 기억하지만, LinkLint는 블로그 엔진이 다르더라도 쓸 수 있을테니 더 좋아보였다.

나는 아무래도 윈도우 환경이 편해서 조금 걱정했는데, LinkLint는 Perl만 설치되어 있다면 윈도우에서도 작동했다.

  1. ActiveState Visual Perl를 설치한다. 설치 화면에서 클릭만 해주면 된다.

  2. LinkLint를 다운로드 받아 압축을 푼다. 여기선 D:\linklint-2.3.5에 파일을 놓았다.

  3. D:\linklint-2.3.5 폴더를 보면 다음과 같은 파일이 있다.

    • linklint-2.3.5: 실제 기능을 수행하는 Perl 스크립트.

    • INSTALL.windows: 설치 문서.

    • linklint.bat

      : Perl 스크립트를 실행하는 배치파일.

  4. 배치 파일에 Perl 바이너리 경로와 LinkLint 스크립트 경로가 하드코딩되어 있으므로 손을 봐야 한다.

    // 고치기 전
    perl bin\linklint %1 %2 %3 %4 %5 %6 %7 %8 %9
    
    // 고친 후
    perl "D:\linklint-2.3.5\linklint-2.3.5" %1 %2 %3 %4 %5 %6 %7 %8 %9
  5. 웹 사이트의 깨진 링크, 이미지 등을 없애자에서 언급한대로 명령어를 쳐본다.

    linklint -http -host <a href="http://www.mydomain.com">http://www.mydomain.com</a> -doc results /@

실행이 끝날 무렵이 되면 콘솔에 다음과 같은 메시지가 출력된다.


Processing ...

writing files to results
wrote 23 txt files
wrote 21 html files
wrote index file index.htm

found 1232 default indexes
found   2 cgi files
found  26 html files
found 424 image files
found 171 other files
found 1289 http links
found   1 javascript link
found   2 mailto links
found 411 named anchors
----- 367 actions skipped
----- 846 files skipped
warn   25 warnings
ERROR   2 missing html files
ERROR  22 missing image files
ERROR   4 missing other files
ERROR 1374 missing named anchors

Linklint found 1855 files and checked 500 html files.
There were 28 missing files. 483 files had broken links.
1402 errors, 25 warnings.

이제 출력 폴더(여기선 D:\LinkLint-2.3.5\results\)로 가서 index.htm 파일을 열어본다. 결과를 읽다보면 한글 URI가 깨져보일 때가 있는데, 웹 브라우저에서 인코딩을 적절히 바꿔주면 된다(예, UTF-8).

Author Details
Kubernetes, DevSecOps, AWS, 클라우드 보안, 클라우드 비용관리, SaaS 의 활용과 내재화 등 소프트웨어 개발 전반에 도움이 필요하다면 도움을 요청하세요. 지인이라면 가볍게 도와드리겠습니다. 전문적인 도움이 필요하다면 저의 현업에 방해가 되지 않는 선에서 협의가능합니다.
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments