linux应用程序解压安装httpd,linux下httpd软件的编译安装

第一次写博客,就拿今天刚刚学习的编译安装热热身。

首先先了解一下编译安装的进本步骤     注意:可以仔细阅读README和 INSTALL文件的信息,了解有关副

INSTALL文件里说明的步骤

$ ./configure --prefix=PREFIX

$ make

$ make install

$ PREFIX/bin/apachectl start

以httpd软件为例。

1.首先获得

httpd-2.4.4.tar.gz

apr-1.5.0.tar.gz

pcre-8.21.tar.bz2

apr-util-1.5.3.tar.gz

可以从www.apache.org 下载得到

2.解压

[root@localhost http]# tar xf httpd-2.4.9.tar.bz2

3.安装

[root@localhost httpd-2.4.4]# ./configure --help 可以查看你需要那些功能,以更好的满足你的需求

[root@localhost httpd-2.4.9]# ./configure --prefix=/usr/local/ --enable-so --enable-cache

checking for chosen layout... Apache

checking for working mkdir -p... yes

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /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... no

configure: error: APR not found.  Please read the documentation.

此时缺少APR包,缺什么就装什么

[root@localhost http]# tar xf apr-1.5.0.tar.gz

[root@localhost apr-1.5.0]# ./configure --prefix=/usr/local/apr

[root@localhost apr-1.5.0]# make

[root@localhost apr-1.5.0]# make install

再次进入http-2.4.9的文件夹进行编译

[root@localhost httpd-2.4.9]# ./configure --prefix=/usr/local/ --enable-so --enable-cache

checking for chosen layout... Apache

checking for working mkdir -p... yes

checking for grep that handles long lines and -e... /bin/grep

checking for egrep... /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... no

configure: error: APR-util not found.  Please read the documentation.

此时缺少APR-util包,缺什么装什么

[root@localhost http]# tar  xfapr-util-1.5.3.tar.gz

[root@localhost apr-util-1.5.3]# ./configure --with-apr=/usr/local/apr/ 此处需要注意选项

[root@localhost apr-util-1.5.3]# make

[root@localhost apr-util-1.5.3]# make install

再次进入http-2.4.9安装

[root@localhost httpd-2.4.9]# ./configure --prefix=/usr/local/ --enable-so --enable-cache

出现了这种错误

/apache --enable-cache --enable-so

......

configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

此时需要安装pcre-8.21.tar.bz2

[root@localhost httpd]# tar xf pcre-8.21.tar.bz2

[root@localhost pcre-8.21]# ./configure

[root@localhost pcre-8.21]# make ;make install

libtool: compile: unrecognized option `-DHAVE_CONFIG_H'

libtool: compile: Try `libtool --help' for more information.

make[1]: *** [pcrecpp.lo] 错误 1

make[1]: Leaving directory `/meng/httpd/pcre-8.21'

make: *** [all] 错误 2

source='pcrecpp.cc' object='pcrecpp.lo' libtool=yes \

DEPDIR=.deps depmode=none /bin/sh ./depcomp \

/bin/sh ./libtool --tag=CXX   --mode=compile  -DHAVE_CONFIG_H -I.      -c -o pcrecpp.lo pcrecpp.cc

libtool: compile: unrecognized option `-DHAVE_CONFIG_H'

libtool: compile: Try `libtool --help' for more information.

make: *** [pcrecpp.lo] 错误 1

[root@localhost pcre-8.21]# yum install gcc-c++

再来一次

[root@localhost httpd]# rm -rf pcre-8.21

[root@localhost httpd]# tar xf pcre-8.21.tar.bz2

[[root@localhost pcre-8.21]# ./configure [root@localhost pcre-8.21]# make ;make install

[root@localhost httpd-2.4.9]# ./configure --prefix=/usr/local/apache --enable-so         --enable-cache

总算成功了

[root@localhost httpd-2.4.9]# make;make install  安装成功

[root@localhost httpd-2.4.9]# vim /usr/local/apache/conf/httpd.conf

189G

ServerName www.feng.com:80 去掉#,增加域名

[root@localhost httpd-2.4.9]# /usr/local/bin/apachectl start   启动httpd服务

体验

用elinks 或者firefox输入自己的IP地址 登入自己的服务器。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值