2016年12月28日 星期三

[研究] Apache Web Server (httpd-2.4.25.tar.gz) + APR 安裝 (CentOS 7.3)

[研究] Apache Web Server  (httpd-2.4.25.tar.gz) + APR 安裝 (CentOS 7.3)

2016-12-28

安裝參考
http://httpd.apache.org/docs/2.4/en/install.html

yum  -y  install  apr  apr-util  pcre  apr-devel  apr-util-devel  pcre-devel  gcc
cd  /usr/local/src
wget  http://apache.stu.edu.tw//httpd/httpd-2.4.25.tar.gz
tar  xvfz httpd-2.4.25.tar.gz
cd  httpd-2.4.25

rpm -qa apr*
cd  /usr/local/src
wget  http://apache.stu.edu.tw//apr/apr-1.5.2.tar.gz
wget  http://apache.stu.edu.tw//apr/apr-util-1.5.4.tar.gz
tar  xvfz apr-1.5.2.tar.gz
tar  xvfz apr-util-1.5.4.tar.gz
mv  apr-1.5.2  /usr/local/src/httpd-2.4.25/srclib/apr
mv  apr-util-1.5.4  /usr/local/src/httpd-2.4.25/srclib/apr-util

cd  httpd-2.4.25
./configure  --with-included-apr
make
make  install

其中 apr 如果不另外安裝,用 yum 的版本,在 ./configure 時候會出錯

[root@localhost httpd-2.4.25]# ./configure  --with-included-apr
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/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
configure:
configure: Configuring Apache Portable Runtime library...
configure:

configure: error: Bundled APR requested but not found at ./srclib/. Download and unpack the corresponding apr and apr-util packages to ./srclib/.


啟動
/usr/local/apache2/bin/apachectl -k start

啟動時候會出現下面警告,可不理會,或去設定檔案 httpd.conf 定 ServerName 主機名稱

[root@localhost httpd-2.4.25]# /usr/local/apache2/bin/apachectl -k start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
[root@localhost httpd-2.4.25]#


測試

停止
/usr/local/apache2/bin/apachectl -k stop

設定檔案在
/usr/local/apache2/conf/httpd.conf

(完)

沒有留言:

張貼留言