Apache编译安装

同样apache也需要到官网下载合适的版本,目前使用较多的版本为2.0或者2.2阿铭建议下载2.2版本。apache官网下载地址: http://www.apache.org/dyn/closer.cgi 


[root@localhost mysql]# cd /usr/local/src/

[root@localhost src]# wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.2.31.tar.gz

解压:

[root@localhost src]# tar zxvf httpd-2.2.16.tar.gz

配置编译参数:

[root@localhost src]# cd httpd-2.2.16

[root@localhost httpd-2.2.16]# ./configure \

--prefix=/usr/local/apache2 \

--with-included-apr \

--enable-so \

--enable-deflate=shared \

--enable-expires=shared \

--enable-rewrite=shared \

--with-pcre

--prefix 指定安装到哪里, --enable-so 表示启用DSO [1] --enable-deflate=shared 表示共享的方式编译deflate,后面的参数同理。如果这一步你出现了这样的错误:

error: mod_deflate has been requested but can not be built due to prerequisite failures

解决办法是:

yum install -y zlib-devel

为了避免在make的时候出现错误,所以最好是提前先安装好一些库文件:

yum install -y pcre pcre-devel apr apr-devel


编译:

[root@localhost httpd-2.2.16]# make

安装:

[root@localhost httpd-2.2.16]# make install

启动:

/usr/local/apache2/bin/apachectl start


你可能感兴趣的:(local,下载地址,shared)