添加压缩包
拆解压缩包
[root@localhost ~]# tar -jxvf httpd-2.4.4.tar.bz2 -C /usr/local/src/
步骤
一、 ./configure --prefix=/usr/local/src/
[root@localhost httpd-2.4.4]# rpm -qa |grep -i apr
[root@localhost httpd-2.4.4]# mkdir /mnt/cdrom
[root@localhost httpd-2.4.4]# mount /dev/cdrom /mnt/cdrom/
[root@localhost httpd-2.4.4]# cd /mnt/cdrom/Server/
[root@localhost Server]# ll apr*
-r--r--r-- 47 root root 125992 2009-08-07 apr-1.2.7-11.el5_3.1.i386.rpm
-r--r--r-- 47 root root 237184 2009-08-07 apr-devel-1.2.7-11.el5_3.1.i386.rpm
-r--r--r-- 42 root root 543487 2009-08-07 apr-docs-1.2.7-11.el5_3.1.i386.rpm
-r--r--r-- 47 root root 77919 2009-08-07 apr-util-1.2.7-7.el5_3.2.i386.rpm
-r--r--r-- 47 root root 54252 2009-08-07 apr-util-devel-1.2.7-7.el5_3.2.i386.rpm
-r--r--r-- 42 root root 232961 2009-08-07 apr-util-docs-1.2.7-7.el5_3.2.i386.rpm
[root@localhost Server]# rpm -ivh apr-devel-1.2.7-11.el5_3.1.i386.rpm
[root@localhost Server]# cd /usr/local/src/httpd-2.4.4/
[root@localhost httpd-2.4.4]# ./configure --prefix=/usr/local/src/
[root@localhost ~]# tar -zxvf apr-1.4.6.tar.gz -C /usr/local/src/
[root@localhost ~]# cd /usr/local/src/apr-1.4.6/
二、 make
三、 make install
[root@localhost ~]# ll
-rw-r--r-- 1 root root 982243 03-22 23:20 apr-1.4.6.tar.gz
-rw-r--r-- 1 root root 774770 03-22 23:20 apr-util-1.4.1.tar.gz
[root@localhost ~]# tar -zxvf apr-util-1.4.1.tar.gz -C /usr/local/src/
[root@localhost apr-util-1.4.1]# ./configure --with-apr=
/usr/local/apr/bin/apr-1-config
[root@localhost apr-util-1.4.1]# make
[root@localhost apr-util-1.4.1]# make install
[root@localhost httpd-2.4.4]# ./configure --prefix=/usr/local/apache/ -sysconfdir=/etc/httpd/
[root@localhost apr]# vim /etc/ld.so.conf.d/apr.conf
/usr/local/apr/lib
~
[root@localhost apr]# ldconfig
[root@localhost apr]# ldconfig -pv |grep apr
[root@localhost httpd-2.4.4]# ./configure --prefix=/usr/local/apache -sysconfdir=/etc/httpd --with-apr=/usr/local/apr/bin/apr-1-config
[root@localhost httpd-2.4.4]# ll /mnt/cdrom/Server/pcre*
-r--r--r-- 327 root root 114862 2007-11-27 /mnt/cdrom/Server/pcre-6.6-2.el5_1.7.i386.rpm
-r--r--r-- 327 root root 180185 2007-11-27 /mnt/cdrom/Server/pcre-devel-6.6-2.el5_1.7.i386.rpm
[root@localhost httpd-2.4.4]# rpm -ivh /mnt/cdrom/Server/pcre-devel-6.6-2.el5_1.7.i386.rpm
[root@localhost httpd-2.4.4]# make
[root@localhost httpd-2.4.4]# make install
[root@localhost apache]# cd bin
[root@localhost bin]# ./apachectl start
[root@localhost bin]# ./httpd -f /etc/httpd/httpd.conf
[root@localhost bin]# netstat -tupln |grep 80
[root@localhost bin]# pkill httpd
[root@localhost bin]# netstat -tupln |grep 80
[root@localhost init.d]# vim httpd
[root@localhost init.d]# chmod a+x httpd
[root@localhost init.d]# vim httpd
脚本
[root@localhost init.d]# bash httpd start
[root@localhost init.d]# vim httpd
脚本
{{{{{{{#!/bin/bash
HTTPD='/usr/local/apache/bin/httpd'
CONFFILE='/etc/httpd(httpd.conf)'
start(){
[-f /var/lock/subsys/http ] && "httpd is started ...."exit
echo -n" httpd is starting......"
sleep 2
$HTTPD -f $CONGFFILE && RETVAL=0||RETVAL=1
[ $RETVAL -eq 0 ] &&touch /var/lock/subsys/http && echo -e "\033[31m [ok] \033[0m"|| echo -e "\033[31m [fail] \033[0m"
}
case $1 in
start)
Start}}}}}
[root@localhost init.d]# pkill httpd
[root@localhost init.d]# bash httpd start
脚本
{{{{{{{{{{{{{{{HTTPD='/usr/local/apache/bin/httpd'
CONFFILE='/etc/httpd(httpd.conf)'
start(){
[-f /var/lock/subsys/http ] && "httpd is started ...."exit
echo -n" httpd is starting......"
sleep 1
$HTTPD -f $CONGFFILE && RETVAL=0||RETVAL=1
[ $RETVAL -eq 0 ] &&touch /var/lock/subsys/http && echo -e "\033[31m [ok] \033[0m"|| echo -e "\033[31m [fail] \033[0m"
}
stop () {
echo -n "httpd is stoping...."
sleep 1
pkill httpd && RETVA=0||RETVA=1
[ $RETVAL -eq 0 ] && echo -e "\033[31m [ok] \033[0m"|| echo -e "\033[31m [fail] \033[0m"
}
case $1 in
start)
start
;;
stop)
stop
;;
Esac}}}}}}}}}}
把httpd-2.2.3-31.el5.i386.rpm 转换成(rpm2) cpio 对cpio解压缩 目录id
[root@localhost abc]# rpm2cpio httpd-2.2.3-31.el5.i386.rpm |cpio -id