lighttpd - 윈디하나의 솔라나라

목차

개요

설치

  1. 윈디하나의 솔라나라: MySQL 5.6: MySQL과 lighttpd와의 연동을 위해 설치한다. 연동하지 않으려면 설치할 필요 없다. MySQL기반의 가상호스트 설정을 위해 필요하다.
  2. 윈디하나의 솔라나라: OpenSSL: https 지원을 위해 필요하다.
  3. 윈디하나의 솔라나라: Memcached: lighttpd에서 사용하는 각종 캐시 저장을 위해 사용한다.
  4. zlib

    # wget https://www.zlib.net/zlib-1.2.12.tar.xz
    # tar xvfJ zlib-1.2.12.tar.xz
    # cd zlib-1.2.12
    # ./configure --64
    # make
    # make test
    ...
                    *** zlib test OK ***
    ...
                    *** zlib shared test OK ***
    ...
                    *** zlib 64-bit test OK ***
    # sudo make install
    
  5. Perl Compatible Regular Expressions

    # wget https://ftp.pcre.org/pub/pcre/pcre-8.45.tar.bz2
    # tar xvfj pcre-8.45.tar.bz2
    # cd pcre-8.45
    # ./configure CFLAGS="-I/usr/local/include"\
      --enable-utf \
      --enable-unicode-properties \
      --enable-pcregrep-libz \
      --enable-pcregrep-libbz2 \
      --enable-newline-is-anycrlf \
      --enable-pcre16 \
      --enable-pcre32 \
      --enable-jit \
      --enable-pcretest-libedit \
      CFLAGS="-m64" LDFLAGS="-m64" CXXFLAGS="-m64" 1)
    # make
    # sudo make install
    
    1) pcretest에 라인 편집 기능이 필요하지 않다면 이 줄을 제외하고 빌드 해도 된다.
  6. libev 이벤트 라이브러리

    # wget http://dist.schmorp.de/libev/libev-4.33.tar.gz
    # tar xvfz libev-4.33.tar.gz
    # cd libev-4.33
    # ./configure CFLAGS="-m64"
    # make
    # make install 1)
    
    1) 만약 시스템에 libevent 가 설치되어있다면, libev 설치시 /usr/local/include/event.h를 덮어쓴다. 따라서 libevent 를 사용하는 프로그램을 빌드할때 심볼을 찾지 못한다는 링크 오류가 발생할 수 있다. 이런경우 libevent 를 다시 설치하면 된다. libev 에서 덮어쓴 event.h 에는 주석으로 파일 상단에 libevent compatibility header, only core events supported라고 써 있다.
  7. lighttpd

    소스파일을 받아 아래와 같이 빌드한다.
    windy@wl ~/src $ wget https://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.55.tar.xz
    windy@wl ~/src $ tar xvfJ lighttpd-1.4.55.tar.xz
    windy@wl ~/src $ cd lighttpd-1.4.55
    windy@wl ~/src/lighttpd-1.4.55 $ ./configure \
    	--prefix=/usr/local/lighttpd \
    	--with-libev \
    	--with-mysql=/usr/local/mysql/bin/mysql_config \
    	--with-openssl=/usr/local/ssl \
    	--with-pcre \
    	--with-zlib \
    	--with-bzip2 \
    	--with-geoip \
    	--with-sqlite \
    	--with-libxml \
    	--with-webdav-props \
    	--with-webdav-locks \
    	CFLAGS="-m64 -I/usr/local/include" LDFLAGS="-m64"
    windy@wl ~/src/lighttpd-1.4.55 $ make
    windy@wl ~/src/lighttpd-1.4.55 $ sudo make install
    
    기본 설정 파일들을 복사해놓는다.
    windy@wl ~/src/lighttpd-1.4.55 $ sudo mkdir /etc/lighttpd
    windy@wl ~/src/lighttpd-1.4.55 $ sudo mkdir /etc/lighttpd/conf.d
    windy@wl ~/src/lighttpd-1.4.55 $ sudo mkdir /etc/lighttpd/vhosts.d
    windy@wl ~/src/lighttpd-1.4.55 $ sudo cp doc/config/lighttpd.conf doc/config/modules.conf /etc/lighttpd/
    windy@wl ~/src/lighttpd-1.4.55 $ sudo cp doc/config/conf.d/*.conf /etc/lighttpd/conf.d/
    windy@wl ~/src/lighttpd-1.4.55 $ sudo cp doc/config/vhosts.d/vhosts.template /etc/lighttpd/vhosts.d/
    

설정

실행

RSS ATOM XHTML 5 CSS3