lighttpd 를 컴파일하여 설치하면 다음과 같은 디렉토리 구조를 가지고 있다.

# ls -ltr
합계 12 drwxr-xr-x 2 root root 4096 2014-08-26 09:42 lib drwxr-xr-x 2 root root 4096 2014-08-26 09:42 sbin drwxr-xr-x 3 root root 4096 2014-08-26 09:42 share

 

느낌대로 sbin 에 들어간다. 

# ls -tlr
합계 752
-rwxr-xr-x 1 root root 747127 2014-08-26 09:42 lighttpd
-rwxr-xr-x 1 root root  15211 2014-08-26 09:42 lighttpd-angel

 

바로 실행해 볼까 한다.

# ./lighttpd
2014-09-05 08:02:31: (server.c.617) No configuration available. Try using -f option.

 

-f 옵션으로 특정 설정 파일을 지정해야 한다.

그런데 설정 파일이 sample 도 포함이 안되어 있는 것 같아서, lighttpd wiki 사이트던가, 에서 간단한 설정 파일을 구했다. 

server.document-root = "/home/htdocs"

server.port = 9000

mimetype.assign = (
  ".html" => "text/html",
  ".txt" => "text/plain",
  ".jpg" => "image/jpeg",
  ".png" => "image/png"
)

 

9000 포트로, /home/htdocs 를 Document Root 로 지정하여 lighttpd 를 띄우는 설정이다. 이 파일을 lighttpd.conf 라고 이름 지은 후 sbin 디렉토리에 같이 넣고

# ./lighttpd -f lighttpd.conf
# 2014-09-05 17:34:50: (log.c.164) server started

#

 

기동이 잘 된 듯 하다. 게다가 background 로 알아서.

# netstat -an | grep 9000
tcp        0      0 0.0.0.0:9000                0.0.0.0:*                   LISTEN

9000번 listen 도 잘 하고 있다.

 

브라우저에서 http://xxx.xxx.xxx.xxx:9000 을 해 보니 404 - Not Found.

http://xxx.xxx.xxx.xxx:9000/index.html 처럼 파일명까지 지정하면 잘 응답함.

이제는 기본 index 파일 설정에 대한 것을 알아보려고 합니다. 또 다음에..