2018年7月27日 星期五

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

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

2018-07-27

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

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

yum  -y  install   apr*
執行 ./configure  --with-included-apr 都會出錯


[root@localhost httpd-2.4.34]# ./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-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-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/.
[root@localhost httpd-2.4.34]#

所以 apr 必須下載 tar.gz 安裝

********************************************************************************
開始安裝

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.34.tar.gz
tar  xvfz httpd-2.4.34.tar.gz
cd  httpd-2.4.34

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

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

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

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

[root@localhost httpd-2.4.34]# /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.34]#

測試



檢查狀態

[root@localhost httpd-2.4.34]# /usr/local/apache2/bin/apachectl
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
httpd (pid 37236) already running
[root@localhost httpd-2.4.34]#

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

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

[root@localhost conf]# pwd
/usr/local/apache2/conf
[root@localhost conf]# ls -al
total 100
drwxr-xr-x.  4 root root    84 Jul 27 03:31 .
drwxr-xr-x. 15 root root   175 Jul 27 03:31 ..
drwxr-xr-x.  2 root root  4096 Jul 27 03:31 extra
-rw-r--r--.  1 root root 18282 Jul 27 03:31 httpd.conf
-rw-r--r--.  1 root root 13077 Jul 27 03:31 magic
-rw-r--r--.  1 root root 60847 Jul 27 03:31 mime.types
drwxr-xr-x.  3 root root    37 Jul 27 03:31 original
[root@localhost conf]#



(完)

沒有留言:

張貼留言