[Ubuntu] Apache2.4.x 설치


Apache2.4.x 버전부터는 APR 과 APR-util을 별로도 설치하여야 한다. 하위버전에서는 설치파일에 포함되어 있었으나 버전 업이 되면서 삭제되어 configure를 실행하면 아래와 같은 에러메시지를 발생하면서 종료된다.

Configuring Apache Portable Runtime library ...

Checking for APR... no
Confgirue: error: APR not found. Please read the documentation

http://apr.apache.org/  에서 다운받아 설치함



*APR(Apache Portable Runtime) 설치

$ wget http://mirror.sdunix.com/apache//apr/apr-1.4.6.tar.gz
$ tar xvf apr-1.4.6.tar.gz
~/apr-1.4.6$ ./configure
~/apr-1.4.6$ ./make
~/apr-1.4.6$ ./sudo make install




*ARP-Util 설치

$ wget http://apache.tt.co.kr//apr/apr-util-1.4.1.tar.gz
$ tar xvf apr-util-1.4.1.tar.gz
~/apr-util-1.4.1$ ./configure --with-apr=/usr/local/apr
~/apr-util-1.4.1$ make
~/apr-util-1.4.1$ sudo make install


Apache 재설치시 Error 발생.
configure: error: pcre-config for libpcre not found.PCRE is required and available from http://pcre.org/




*PCRE(Perl Compatible Regular Expressions) 설치

$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xvf pcre-8.30.tar.gz
~/pcre-8.30$ ./configure
~/pcre-8.30$ make
~/pcre-8.30$ sudo make install

*Apache 2.4.x 설치
$ wget http://apache.cs.utah.edu//httpd/httpd-2.4.2.tar.gz
$ tar xvf httpd-2.4.2.tar.gz
~/httpd-2.4.2$ ./configure --prefix=/home/www/apache2 --enable-module=so --enable-mods-shared-all --enable-so --enable-rewrite --enable-sll

~/httpd-2.4.2$ make
~/httpd-2.4.2$ sudo make install



~/apache2/bin$ ldd httpd
linux-gate.so.1 => (0xb779b000)
libpcre.so.1 => not found   ------------------------------------> problem
libaprutil-1.so.0 => /usr/local/apr/lib/libaprutil-1.so.0 (0xb775a000)
libapr-1.so.0 => /usr/local/apr/lib/libapr-1.so.0 (0xb7728000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb76f8000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7553000)
libexpat.so.0 => /usr/local/apr/lib/libexpat.so.0 (0xb752a000)
libcrypt.so.1 => /lib/i386-linux-gnu/libcrypt.so.1 (0xb74f9000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb74f3000)
/lib/ld-linux.so.2 (0xb779c000)



~/.profile 에 export LD_LIBRARY_PATH=/usr/local/lib 를 추가

~/apache2/bin$ ldd httpd
linux-gate.so.1 => (0xb779b000)
libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0xb777c000) ---------- 라이브러리를 찾아옴
libaprutil-1.so.0 => /usr/local/apr/lib/libaprutil-1.so.0 (0xb775a000)
libapr-1.so.0 => /usr/local/apr/lib/libapr-1.so.0 (0xb7728000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb76f8000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7553000)
libexpat.so.0 => /usr/local/apr/lib/libexpat.so.0 (0xb752a000)
libcrypt.so.1 => /lib/i386-linux-gnu/libcrypt.so.1 (0xb74f9000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb74f3000)
/lib/ld-linux.so.2 (0xb779c000)



/etc/sudoers 파일을 수정하여 root 계정이 아닌 다른 계정으로 Apache 실행하기

# User privilege specification
root ALL=(ALL:ALL) ALL
www ALL=/home/www/apache2/httpd  ------ www 계정만이 httpd 를 sudo 를 통한 실행 권한을 가짐



*sudo 실행시에 LD_LIBRARY_PATH 를 적용시키기

/etc/ld.so.conf.d$ ls -alrt
합계 24
-rw-r--r-- 1 root root 44 9월 11 2010 libc.conf
-rw-r--r-- 1 root root 108 3월 7 06:50 i686-linux-gnu.conf
lrwxrwxrwx 1 root root 40 5월 29 01:10 i386-linux-gnu_GL.conf -> /etc/alternatives/i386-linux-gnu_gl_conf

/etc/ld.so.conf.d$ cat i386-linux-gnu_GL.conf
/usr/lib/i386-linux-gnu/mesa

i386-linux-gnu_GL.conf 파일에 라이브러리 패스를 추가

/etc/ld.so.conf.d$ cat i386-linux-gnu_GL.conf
/usr/lib/i386-linux-gnu/mesa
/usr/local/lib
 

댓글

이 블로그의 인기 게시물

Install and run an FTP server using Docker

Using the MinIO API via curl

PYTHONPATH, Python 모듈 환경설정

Elasticsearch Ingest API

오늘의 문장2

How to checkout branch of remote git, 깃 리모트 브랜치 체크아웃

Fundamentals of English Grammar #1

To switch to a specific tag in a Git repository

You can use Sublime Text from the command line by utilizing the subl command

티베트-버마어파 와 한어파(중국어파)의 어순 비교