一、安装apr apr-util
apr apr-util :httpd的运行环境
1、安装apr
[root@vm01 ~]# tar xf apr-1.5.2.tar.gz #解压
[root@vm01 ~]#
[root@vm01 ~]# ls
anaconda-ks.cfg apr-1.5.2 apr-1.5.2.tar.gz apr-util-1.5.4.tar.gz httpd-2.4.12.tar.gz rec.sh
[root@vm01 ~]# cd apr-1.5.2/
[root@vm01 apr-1.5.2]# ls
apr-config.in apr.pc.in build.conf configure encoding libapr.dsp Makefile.in network_io random support tools
apr.dep apr.spec build-outputs.mk configure.in file_io libapr.mak Makefile.win NOTICE README tables user
apr.dsp atomic CHANGES docs helpers libapr.rc memory NWGNUmakefile README.cmake test
apr.dsw build CMakeLists.txt dso include LICENSE misc passwd shmem threadproc
apr.mak buildconf config.layout emacs-mode libapr.dep locks mmap poll strings time
[root@vm01 apr-1.5.2]# ./configure --prefix=/usr/local/apr #指定安装路径
报错:缺少gcc编译器
解决:
[root@vm01 apr-1.5.2]# yum -y install gcc #安装gcc [root@vm01 apr-1.5.2]# ./configure --prefix=/usr/local/apr #再次安装
[root@vm01 apr-1.5.2]# make #编译
[root@vm01 apr-1.5.2]# make install #编译安装
[root@vm01 apr-1.5.2]# ls /usr/local/apr/
bin build-1 include lib
2、安装apr-util
1)解压
2)安装
[root@vm01 apr-util-1.5.4]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# --prefix:指定安装位置
# --with:指定apr安装位置
[root@vm01 apr-util-1.5.4]# make
[root@vm01 apr-util-1.5.4]# make install
[root@vm01 apr-util-1.5.4]# ls /usr/local/apr-util/
bin include lib
二、安装httpd
1、解压
2、安装
[root@vm01 httpd-2.4.12]# ./configure --prefix=/usr/local/httpd24 --enable-so --enable-rewrite --enable-ssl --enable-cgi --enable-cgid --enable-modules=most --enable-mods-shared-most --enable-mpm-shared=all --with-mpm=event --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
#--prefix:指定httpd安装位置
#--enabled-xxx :指定httpd功能
#--with-xxx:指定依赖文件位置
3、报错
解决
[root@vm01 httpd-2.4.12]# yum install pcre-devel.x86_64
解决
[root@vm01 httpd-2.4.12]# yum install openssl-devel
4、编译安装
[root@vm01 httpd-2.4.12]# make
[root@vm01 httpd-2.4.12]# make install
[root@vm01 httpd-2.4.12]# ls /usr/local/httpd24/
bin build cgi-bin conf error htdocs icons include logs man manual modules
三、启动httpd
[root@vm01 ~]# /usr/local/httpd24/bin/httpd -k start
[root@vm01 ~]# netstat -antp | grep httpd
tcp6 0 0 :::80 :::* LISTEN 81238/httpd