'리눅스 초급/WEB'에 해당되는 글 2건

  1. 2016.05.08 [lighttpd] (2)lighttpd의 설치
  2. 2016.05.08 [lighttpd] (1)lighttpd란?

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"

 

-- 미완성 --



 

















 


'리눅스 초급 > WEB' 카테고리의 다른 글

[lighttpd] (1)lighttpd란?  (0) 2016.05.08
Posted by 알 수 없는 사용자
,

1. '라이트피디'라고 읽고 짧게는 '라이티(lighty)' 라고도 읽는다. 

 - lighttpd는 적은 자원을 사용하여 높은 성능을 내는 오픈 소스 웹 서버 어플리케이션이다. 아파치보다 적은 메모리를 사용하면서도 일반적으로 아파치보다 속도가 빠르다. ( 아파치에서 자주 사용하지 않는 기능들은 빠져있다고 합니다. )

 - lighttpd는 non-blocking I/O 로 단일 프로세스에서 실행되어 가볍고 빠르다.

 - YouTube, Wikipedia, Sourceforge, Meebo 등 많은 사이트에서 사용하고 있다. 

2. lighttpd와 Apache 성능 차이
 사건은 최근 Ruby on Rails를 전폭 지원하는 웹호스팅으로 인기를 끌고 있는 호스팅 업체인 TextDrive에 입주해 있는 한 블로그의 글이 Slashdot에 올라가면서 터졌습니다.
Apache를 쓰고 있는 해당 서버의 로드가 400이 넘도록 치솟고 메모리를 2GB이상 먹어버리는 사태가 발생한 것입니다. 사태가 벌어지자마자 TextDrive의 관리자들(이 사람들은 잠도 안자고 서버 관리 및 고객 응대에만 전념하는 걸로 유명합니다.  이 웹서버를 Apache에서 lighttpd로 교체해버렸습니다. 

1.png 

그 결과 그래프에 나온 것처럼 로드는 4로, 메모리 사용량은 0.5GB로 떨어졌습니다. 웹서버로 들어오는 접속 숫자는 비슷했는데도 말이죠. TextDrive는 이제 Apache proxy와 lighttpd의 조합으로 설정을 완전히 변경하는 모양입니다. 부하가 많이 걸리는 웹서버를 관리하고 계시다면 lighttpd에 관심을 가져 보는 것도 좋을 듯 합니다. 


'리눅스 초급 > WEB' 카테고리의 다른 글

[lighttpd] (2)lighttpd의 설치  (0) 2016.05.08
Posted by 알 수 없는 사용자
,