리눅스 초급/WEB
[lighttpd] (2)lighttpd의 설치
알 수 없는 사용자
2016. 5. 8. 20:24
1. lighttpd를 설치하기 전에 pcre, zlib 라는 개발 패키지를 먼저 설치해야 한다.
[root@localhost ~]# rpm -qa | grep pcre
pcre-7.8-7.el6.x86_64
pcre-devel-7.8-7.el6.x86_64
[root@localhost ~]# rpm -qa | grep zlib
zlib-1.2.3-29.el6.x86_64
zlib-devel-1.2.3-29.el6.x86_64
* pcre(Perl Compatible Regular Expressions)
Perl 호환 정규 표현식들 이라고 해석된다. Perl 5의 사용법과 유사하게 만들어 졌고, 자체 API도 있으며 POSIX과의 호환성도 좋고 소유권을 주장할 수 있는 SW 개발에도 무료로 사용이 가능하다. 원래는 메일 전송에이전트 용으로 만들었는데 오픈 소스 프로젝트에서 두루두루 활용되고 있다.
* zlib
zlib는 C로 작성된 데이터 압축 라이브러리의 일종이다.
2. lighttpd 설치
[root@localhost ~]# wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.39.tar.gz
--2016-05-08 16:57:38-- http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.39.tar.gz
Resolving download.lighttpd.net... 188.40.103.19, 2a01:4f8:100:8082::2
Connecting to download.lighttpd.net|188.40.103.19|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 874931 (854K) [application/x-gtar-compressed]
Saving to: `lighttpd-1.4.39.tar.gz'
100%[======================================>] 874,931 290K/s in 3.0s
2016-05-08 16:57:42 (290 KB/s) - `lighttpd-1.4.39.tar.gz' saved [874931/874931]
[root@localhost local]# tar xvzf lighttpd-1.4.39.tar.gz
[root@localhost local]# cd lighttpd-1.4.39
[root@localhost lighttpd-1.4.39]# ./configure
2. ./configure 오류
[root@localhost lighttpd-1.4.39]# ./configure
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '0' is supported by ustar format... yes
checking whether GID '0' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/lighttpd-1.4.39':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
C compiler가 없단다 설치해주자
[root@localhost lighttpd-1.4.39]# rpm -qa | grep gcc
libgcc-4.4.7-4.el6.x86_64
[root@localhost lighttpd-1.4.39]# yum -y install gcc
[root@localhost lighttpd-1.4.39]# rpm -qa | grep gcc
libgcc-4.4.7-16.el6.x86_64
gcc-4.4.7-16.el6.x86_64
gcc 까지 설치가 완료되었다. 다시 ./configure을 실행한다.
3. 에러의 연속~~
configure: error: bzip2-headers and/or libs where not found, install them or build with --without-bzip2
bzip2-header 가 없다고하니 bzip 뒤에 *을 때려박아서 관련 패키지를 몽땅 설치하기로 했다.
[root@localhost lighttpd-1.4.39]# yum -y install bzip*
[root@localhost lighttpd-1.4.39]# yum -y install gamin*
* gamin 이란?
Gamin is a file and directory monitoring system defined to be a subset of the FAM (File Alteration Monitor) system. It is a service provided by a library which allows for the detection of modification to a file or directory. - 출처 archlinux -
FAM 시스템으로 정의되어 있는 파일과 디렉토리 모니터링 시스템이다. 파일과 디렉토리의 정확성을 탐지하기 위하여 library에 의해 제공되는 서비스이다. 대략 이런 뜻같다.
4. make, make install 을 진행하여 설치해준다. 과정은 너무 길어서 패스
5. 설치 후 세팅
make install 실행한 위치에서 init script를 생성.
1. sed -e 's/FOO/lighttpd/g' /usr/local/lighttpd-1.4.39/doc/initscripts/rc.lighttpd.redhat > /etc/init.d/lighttpd
필요한 환경설정을 한다
1. mkdir /etc/lighttpd
2. cp ./lighttpd.conf /etc/lighttpd/
6. /etc/lighttpd/lighttpd.conf 설정
var.log_root = "/var/log/lighttpd" var로 시작하는 5가지 항목은 변수로 저장이 되서 아래에 활용된다.
var.server_root = "/srv/www"
var.state_dir = "/var/run"
var.home_dir = "/var/lib/lighttpd"
var.conf_dir = "/etc/lighttpd"
server.port = 80
-lighttpd 포트번호
server.document-root = server_root + "/htdocs"
-document 저장 위치
server.errorlog = log_root + "/error.log"
-errorlog의 위치
server.username = "lighttpd"
server.groupname = "lighttpd"
server.event-handler = "linux-sysepoll"
-- 미완성 --