湖濱散記部落格的樹心幽徑[login][主頁]
341:20160920httpd2.4.23-setup OK

(1)
[root@ann ~]# pwd
/root
[root@ann ~]# df
檔案系統                  1K-區段    已用      可用 已用% 掛載點
devtmpfs                  1947736       0   1947736    0% /dev
tmpfs                     1958752      80   1958672    1% /dev/shm
tmpfs                     1958752    1348   1957404    1% /run
tmpfs                     1958752       0   1958752    0% /sys/fs/cgroup
/dev/mapper/fedora-root  51475068 5488240  43349004   12% /
tmpfs                     1958752       0   1958752    0% /tmp
/dev/sda2                  487652  119815    338141   27% /boot
/dev/sda1                  204580    9612    194968    5% /boot/efi
/dev/mapper/fedora-home 905112600  101196 859011276    1% /home
tmpfs                      391752      12    391740    1% /run/user/42
tmpfs                      391752       0    391752    0% /run/user/0
[root@ann ~]# date
二  9月 20 12:46:45 CST 2016
[root@ann ~]# uname -a
Linux ann 4.4.14-200.fc22.x86_64 #1 SMP Fri Jun 24 21:19:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@ann ~]#


(2)

[root@ann ~]# yum install gcc
:

Installed:
  binutils.x86_64 2.25-9.fc22               cpp.x86_64 5.3.1-6.fc22
  gcc.x86_64 5.3.1-6.fc22                   glibc-devel.x86_64 2.21-13.fc22
  glibc-headers.x86_64 2.21-13.fc22         isl.x86_64 0.14-3.fc22
  kernel-headers.x86_64 4.4.14-200.fc22     libmpc.x86_64 1.0.2-3.fc22

Complete!
[root@ann ~]#

(3)
[root@ann ~]# wget http://ftp.mirror.tw/pub/apache//httpd/httpd-2.4.23.tar.gz
:
2016-09-20 12:50:26 (126 KB/s) - ‘httpd-2.4.23.tar.gz’ saved [8406575/8406575]

[root@localhost apr-1.5.1]# gcc -v
使用內建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.8.3/lto-wrapper
目的:i686-redhat-linux
:
gcc version 4.8.3 20140624 (Red Hat 4.8.3-1) (GCC)
[root@localhost apr-1.5.1]#

(4)
[root@ann ~]# tar xvzf httpd-2.4.23.tar.gz

[root@ann ~]# cd httpd-2.4.23/
[root@ann httpd-2.4.23]# ./configure --enable-so --enable-unique-id --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
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:
checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.
[root@ann httpd-2.4.23]#


(5)

[root@ann ~]# wget http://ftp.twaren.net/Unix/Web/apache//apr/apr-1.5.2.tar.gz
:
2016-09-20 12:58:44 (1.15 MB/s) - ‘apr-1.5.2.tar.gz’ saved [1031613/1031613]
[root@ann ~]# tar xvzf apr-1.5.2.tar.gz
[root@ann ~]# cd apr-1.5.2/
[root@ann apr-1.5.2]# ./configure --prefix=/usr/local/apr
:
config.status: executing libtool commands
rm: cannot remove 'libtoolT': No such file or directory
config.status: executing default commands
[root@ann apr-1.5.2]#


[root@ann apr-1.5.2]# vi configure
# $RM "$cfgfile"
[root@ann apr-1.5.2]# ./configure --prefix=/usr/local/apr
:
config.status: include/apr.h is unchanged
config.status: include/arch/unix/apr_private.h is unchanged

[root@ann apr-1.5.2]# make
[root@ann apr-1.5.2]# make install
:
/usr/bin/install -c -m 644 build/apr_rules.out /usr/local/apr/build-1/apr_rules.mk
/usr/bin/install -c -m 755 apr-config.out /usr/local/apr/bin/apr-1-config
[root@ann apr-1.5.2]#


(6)
[root@ann apr-1.5.2]# cd ../httpd-2.4.23/
[root@ann httpd-2.4.23]#  ./configure --enable-so --enable-unique-id --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
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:
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to " -g -O2 -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure:
configure: Configuring Apache Portable Runtime Utility library...
configure:
checking for APR-util... configure: error: the --with-apr-util parameter is incorrect. It must specify an install prefix, a build directory, or an apu-config file.
[root@ann httpd-2.4.23]#

(7)
[root@ann httpd-2.4.23]# cd ..
[root@ann ~]# wget http://ftp.twaren.net/Unix/Web/apache//apr/apr-util-1.5.4.tar.gz
:
2016-09-20 13:15:46 (1.19 MB/s) - ‘apr-util-1.5.4.tar.gz’ saved [874044/874044]

[root@ann ~]#

(8)
[root@ann ~]# tar xvzf apr-util-1.5.4.tar.gz
[root@ann ~]# cd apr-util-1.5.4
[root@ann apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr   --with-gdbm=/usr   --with-openssl=/usr
:
config.status: executing default commands
[root@ann apr-util-1.5.4]# make
:
make[1]: Leaving directory '/root/apr-util-1.5.4'
[root@ann apr-util-1.5.4]#

[root@ann apr-util-1.5.4]# make test
:

testrmm             : SUCCESS
testdbm             : SUCCESS
testqueue           : SUCCESS
testreslist         : SUCCESS
All tests passed.
make[1]: Leaving directory '/root/apr-util-1.5.4/test'
[root@ann apr-util-1.5.4]#
[root@ann apr-util-1.5.4]# make install
:
/usr/bin/install -c -m 644 aprutil.exp /usr/local/apr-util/lib
/usr/bin/install -c -m 755 apu-config.out /usr/local/apr-util/bin/apu-1-config
[root@ann apr-util-1.5.4]#


(9)

[root@ann apr-util-1.5.4]# cd ../httpd-2.4.23/
[root@ann httpd-2.4.23]#  ./configure --enable-so --enable-unique-id --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
:
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
[root@ann httpd-2.4.23]#

(10)

[root@ann httpd-2.4.23]# yum install gcc-c++
:
Installed:
  gcc-c++.x86_64 5.3.1-6.fc22        libstdc++-devel.x86_64 5.3.1-6.fc22

Complete!
[root@ann httpd-2.4.23]#

(11)
[root@ann ~]# wget https://sourceforge.net/projects/pcre/files/pcre/8.39/pcre-8.39.tar.bz2/download
:
2016-09-20 13:28:34 (1.67 MB/s) - ‘download’ saved [1560758/1560758]

[root@ann ~]# mv download pcre-8.39.tar.bz2
[root@ann ~]# tar jxvf pcre-8.39.tar.bz2


[root@ann pcre-8.39]#  ./configure --prefix=/usr --docdir=/usr/share/doc/pcre-8.39  --enable-unicode-properties --enable-pcre16 --enable-pcre32 --disable-static

:
pcre-8.39 configuration summary:

    Install prefix .................. : /usr
    C preprocessor .................. : gcc -E
    C compiler ...................... : gcc
    C++ preprocessor ................ : g++ -E
    C++ compiler .................... : g++
    Linker .......................... : /usr/bin/ld -m elf_x86_64
    C preprocessor flags ............ :
    C compiler flags ................ : -g -O2 -fvisibility=hidden
    C++ compiler flags .............. : -O2 -fvisibility=hidden -fvisibility-inlines-hidden
    Linker flags .................... :
    Extra libraries ................. :

    Build 8 bit pcre library ........ : yes
    Build 16 bit pcre library ....... : yes
    Build 32 bit pcre library ....... : yes
    Build C++ library ............... : yes
    Enable JIT compiling support .... : no
    Enable UTF-8/16/32 support ...... : yes
    Unicode properties .............. : yes
    Newline char/sequence ........... : lf
    \R matches only ANYCRLF ......... : no
    EBCDIC coding ................... : no
    EBCDIC code for NL .............. : n/a
    Rebuild char tables ............. : no
    Use stack recursion ............. : yes
    POSIX mem threshold ............. : 10
    Internal link size .............. : 2
    Nested parentheses limit ........ : 250
    Match limit ..................... : 10000000
    Match limit recursion ........... : MATCH_LIMIT
    Build shared libs ............... : yes
    Build static libs ............... : no
    Use JIT in pcregrep ............. : no
    Buffer size for pcregrep ........ : 20480
    Link pcregrep with libz ......... : no
    Link pcregrep with libbz2 ....... : no
    Link pcretest with libedit ...... : no
    Link pcretest with libreadline .. : no
    Valgrind support ................ : no
    Code coverage ................... : no

[root@ann pcre-8.39]#
[root@ann pcre-8.39]# make

make[1]: Leaving directory '/root/pcre-8.39'
[root@ann pcre-8.39]# make install
:
make[3]: Leaving directory '/root/pcre-8.39'
make[2]: Leaving directory '/root/pcre-8.39'
make[1]: Leaving directory '/root/pcre-8.39'

(12)
[root@ann pcre-8.39]#  cd ../httpd-2.4.23/
[root@ann httpd-2.4.23]# ./configure --enable-so --enable-unique-id --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
:
config.status: executing default commands
[root@ann httpd-2.4.23]# make
[root@ann httpd-2.4.23]# make install
:
make[1]: Leaving directory '/root/httpd-2.4.23'
[root@ann httpd-2.4.23]#

(13)
[root@ann httpd-2.4.23]# vi /etc/selinux/config
[root@ann httpd-2.4.23]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
# SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted


(14)暫時關閉SELinux而不用重開機
[root@ann httpd-2.4.23]# setenforce 0
setenforce: SELinux is disabled
[root@ann httpd-2.4.23]#

(15)
[root@ann httpd-2.4.23]# /usr/local/apache2/bin/apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::e23f:49ff:fee7:1a4. Set the 'ServerName' directive globally to suppress this

message
[root@ann httpd-2.4.23]#


[root@ann httpd-2.4.23]# ps ax|grep httpd
13910 ?        Ss     0:00 /usr/local/apache2/bin/httpd -k start
13911 ?        Sl     0:00 /usr/local/apache2/bin/httpd -k start
13912 ?        Sl     0:00 /usr/local/apache2/bin/httpd -k start
13913 ?        Sl     0:00 /usr/local/apache2/bin/httpd -k start
13996 pts/0    S+     0:00 grep --color=auto httpd
[root@ann httpd-2.4.23]#

[root@ann httpd-2.4.23]# ps ax|grep httpd
13910 ?        Ss     0:00 /usr/local/apache2/bin/httpd -k start
13911 ?        Sl     0:00 /usr/local/apache2/bin/httpd -k start
13912 ?        Sl     0:00 /usr/local/apache2/bin/httpd -k start
13913 ?        Sl     0:00 /usr/local/apache2/bin/httpd -k start
13996 pts/0    S+     0:00 grep --color=auto httpd
[root@ann httpd-2.4.23]# /usr/local/apache2/bin/apachectl stop
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::e23f:49ff:fee7:1a4. Set the 'ServerName' directive globally to suppress this

message
[root@ann httpd-2.4.23]# ps ax|grep httpd
14002 pts/0    S+     0:00 grep --color=auto httpd


[root@ann httpd-2.4.23]# /usr/local/apache2/bin/apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::e23f:49ff:fee7:1a4. Set the 'ServerName' directive globally to suppress this

message
[root@ann httpd-2.4.23]# ps ax|grep httpd
14006 ?        Ss     0:00 /usr/local/apache2/bin/httpd -k start
14008 pts/0    S+     0:00 grep --color=auto httpd
[root@ann httpd-2.4.23]#


[root@ann httpd-2.4.23]# vi /usr/local/apache2/conf/httpd.conf
[root@ann httpd-2.4.23]# cat /usr/local/apache2/conf/httpd.conf |grep ServerN
# ServerName gives the name and port that the server uses to identify itself.
ServerName 163.25.20.74:80
[root@ann httpd-2.4.23]#


[root@ann httpd-2.4.23]# /usr/local/apache2/bin/apachectl stop
[root@ann httpd-2.4.23]# /usr/local/apache2/bin/apachectl start
[root@ann httpd-2.4.23]# ps ax|grep httpd
14149 ?        Ss     0:00 /usr/local/apache2/bin/httpd -k start
14150 ?        Sl     0:00 /usr/local/apache2/bin/httpd -k start
14151 ?        Sl     0:00 /usr/local/apache2/bin/httpd -k start
14152 ?        Sl     0:00 /usr/local/apache2/bin/httpd -k start
14235 pts/0    S+     0:00 grep --color=auto httpd
[root@ann httpd-2.4.23]#

(16)
http://163.25.20.74/
It works!

[root@ann httpd-2.4.23]# date
二  9月 20 13:50:00 CST 2016
[root@ann httpd-2.4.23]#


select id,article_id,topic,text from lt_articles_text where article_id =341; ok. update lt_articles set num_reads=num_reads +1 where id=341; ok.