0%

apache-2.4.x编译安装方法

apache-2.4.x编译安装方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
apache-2.2与新出的apache-2.4安装不同的地方在于,2.4版的已经不自带apr库,所以在安装apache-2.4之前,需要先安装好apr。
1、下载软件

cd /tmp
wget http://mirrors.axint.net/apache//httpd/httpd-2.4.2.tar.gz
wget http://mirrors.axint.net/apache//apr/apr-1.4.6.tar.gz
wget http://mirrors.axint.net/apache//apr/apr-util-1.4.1.tar.gz
tar xzf httpd-2.4.2.tar.gz
tar xzf apr-1.4.6.tar.gz
tar xzf apr-util-1.4.1.tar.gz

2、安装apr

cd /tmp/apr-1.4.6
./configure --prefix=/usr/local/apache/apr
make && make install
cd /tmp/apr-util-1.4.1
./configure --prefix=/usr/local/apache/apr-util --with-apr=/usr/local/apache/apr
make && make install

3、安装apache-2.4

cd /tmp/httpd-2.4.2
./configure --prefix=/usr/local/apache --enable-so --enable-deflate=shared --enable-ssl=shared --enable-expires=shared --enable-headers=shared --enable-rewrite=shared --enable-static-support --with-apr=/usr/local/apache/apr --with-apr-util=/usr/local/apache/apr-util --with-mpm=prefork
make && make install
cp -f build/rpm/httpd.init /etc/init.d/httpd
chmod +x /etc/init.d/httpd
chkconfig --add httpd
chkconfig httpd on
cd /etc
mv httpd httpd_old
ln -s /usr/local/apache/ httpd
cd /usr/sbin/
ln -fs /usr/local/apache/bin/httpd
ln -fs /usr/local/apache/bin/apachectl
cd /var/log
rm -rf httpd/
ln -s /usr/local/apache/logs httpd
到这里基本哦了

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!