Nice programing

Apache httpd 설정 및 설치

nicepro 2020. 10. 6. 19:07
반응형

Apache httpd 설정 및 설치


일반 사용자 (루트가 아님)로 내 상자에 Apache HTTP 서버를 로컬로 설치하는 것은 이번이 처음입니다.

Apache 2.4.1 버전의 Apache HTTP 서버 [http://httpd.apache.org/download.cgi]를 다운로드했습니다. 그러나 내 상자에서 로컬로 빌드하고 설치하려고 할 때 아래 오류가 발생합니다.

httpd/httpd-2.4.1 1059> ./configure
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu

Configuring Apache Portable Runtime library ...

checking for APR... no
configure: error: APR not found.  Please read the documentation.

어떤 종속성을 찾고 있는지 잘 모르겠습니다. 다운로드 패키지에 포함되어 있지 않다는 의미입니까? Apache HTTP 서버를 구축 / 배포하려면 어떻게해야합니까?

미리 감사드립니다.


그것이 당신에게 말할 때 그것은 당신에게 지시하는 Please read documentationApache 문서 ( http://httpd.apache.org/docs/2.4/install.html )를 읽어야 함을 의미합니다.

Apache APR 에서 APR 및 APR-Util의 최신 버전을 다운로드하고 ./srclib/apr 및 ./srclib/apr-util에 압축을 풉니 다 (도메인 이름에 버전 번호가 없는지 확인하십시오. 예를 들어 APR 배포는 ./srclib/apr/ 아래에 있음)

그런 다음

./configure --with-included-apr

Ubuntu 11.10의 경우이 옵션이 잘 작동하는 것 같습니다.

 # APR

wget http://mirrors.axint.net/apache//apr/apr-1.4.6.tar.gz

tar -xvzf apr-1.4.6.tar.gz

cd apr-1.4.6/

./configure

make

make install

cd ..

# APR Utils

wget http://mirrors.axint.net/apache//apr/apr-util-1.4.1.tar.gz

tar -xvzf apr-util-1.4.1.tar.gz

cd apr-util-1.4.1

./configure --with-apr=/usr/local/apr

make

make install

cd ..

# Apache

wget http://apache.petsads.us//httpd/httpd-2.4.1.tar.gz

tar -xvzf httpd-2.4.1.tar.gz

cd httpd-2.4.1

./configure --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-deflate --enable-expires --enable-headers --enable-usertrack --enable-ssl --enable-cgi --enable-vhost-alias --enable-rewrite --enable-so --with-apr=/usr/local/apr/

make

make install

cd ..

아래에서 자세한 내용을 확인할 수 있습니다.

출처 : VaporCreations.com


Debian / Ubuntu를 사용하는 경우 다음을 수행 할 수 있습니다.

apt-get install libapr1-dev libaprutil1-dev

그때 ./configure

끝난


루트가 아닌 사용자에게 apache-httpd를 설치하는 방법은 다음과 같습니다.

  1. apache-httpd-2.4.2를 다운로드하고 압축을 풉니 다 (하지만 ./configuring, 만들기 및 설치 전에 아래 단계를 따르십시오.)
  2. Download and extract APR & APR-UTIL into "./srclib/apr" & "./srclib/apr-util" folders. This requires ./configure --with-apr=./apache/httpd-2.4.2/srclib/apr (and) --with-included-apr (options).
  3. Download, extract, ./configure (with) --prefix=localURL, make and make install PCRE into "./pcre" folder. This requires ./configure --with-pcre=/home/username/apache/pcre (option).
  4. Configure apache-httpd by entring following command (I like to enable certain options as written in the command below): ./configure --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-deflate --enable-expires --enable-headers --enable-usertrack --enable-cgi --enable-vhost-alias --enable-rewrite --enable-so --with-apr=/home/username/apache/httpd-2.4.2/srclib/apr --prefix=/home/username/apache/httpd-2.4.2/ --with-included-apr --with-pcre=/home/username/apache/pcre Note: When configuring apache-httpd, use option "--enable-ssl" ONLY if OpenSSL is installed otherwise DON'T enable it.
  5. Now on the command-line, enter 'make' and 'make install' command.
  6. Open and configure the 'httpd.conf' file e.g.: "vi /home/eddie_kumar/apache/httpd-2.4.2/conf/httpd.conf"

IMPORTANT: don't forget to change the default port from 80 to something else e.g. 8080, this is especially important for non-root user. (How to? open httpd.conf -> search "Listen 80" -> change it to "Listen 8080".

And that's it, now open your browser enter "localhost:8080", it should display "It works!".


If you are using fedora, you can use yum to install APR, APR-Util and PCRE. You'll also need to download apr-devel, apr-util-devel and pcre-devel.

That being said, you can just run the following command on your terminal and no more "configure: error: APR not found.. ..APR-Util and PCRE" errors.

yum -y install arp apr-devel apr-util apr-util-devel pcre pcre-devel 

I'm using fedora 17 and planning on using a shell script to setup apache 2.4.3. So yum works pretty slick instead of manually downloading apr, apr-util, and pcre.


1, You need APR (apache portable runtime), which is core component of apache web server

2, If you wnat to do make install, you may need root account

3, Even if not, apache can not start to listen on unprivileged port (lower then 1024) without root account

4, gain root or ask someone with root to install apache from official repo(I don;t know which distro you run) like using yum, apt-get, etc...


Apr or pcre related errors require the source to be downloaded and Apache HTTPD "configure" process needs to be made aware of these source locations on your file system. For instance: if you downloaded the source for APR at ./srclib (relative to apache httpd) then you would use
--with-included-apr
as the configure option.

On the other hand if you want to not build but install APR / APR-UTIL, then you need the following on CentOS / RedHat:
yum install apr-util-devel apr-devel
However it might so happen that the APR version provided by yum does not match what is expected by this version of Apache httpd. In that case you could download APR and APR-UTIL and use the --with-included-apr option.

You could also build PCRE utilizing the same "configure, make, make install" process and then continue where you left off building Apache httpd.
Or you could install pcre: yum install pcre-devel

If while building PCRE: you see "compile: unrecognized option" then perhaps you would need other dependencies as well: Please see the details at:
http://khanna111.com/wordPressBlog/2012/09/11/94087-2/
It also covers "mod_deflate" and "zlib" as well.


Basic steps

tar -xvf httpd-2.4.1-customized.tar -C ../
#Balancer folder will be created
tar -xvzf openssl-1.0.1.tar.gz  -C /balancer/
cd ->/balancer/openssl-1.0.1
./config --prefix=/usr/local/ssl/ shared zlib-dynamic enable-camellia
make depend
make
make install
tar -xvzf pcre-8.30.tar.gz -C ../balancer/

/balancer/pcre-8.30
./configure  --prefix=/usr/local/pcre/
make
make install

remove pcre and openssl

참고URL : https://stackoverflow.com/questions/9436860/apache-httpd-setup-and-installation

반응형