Linux下Apache服务器的搭建

来源:互联网 发布:取消激活windows 编辑:程序博客网 时间:2024/05/15 12:33

Apache HTTP Server是一个跨平台运行的开源服务器软件,是当今世界排名第一的WEB服务器软件。

安装Apache httpd有源码包和二进制包两种安装方式,二进制包安装简单方便,但源码包安装方式具有高度自由性。本文采用源码包的安装方式


1.下载软件包

wget http://apache.fayea.com//httpd/httpd-2.4.23.tar.gz

wget http://mirror.bit.edu.cn/apache//apr/apr-1.5.2.tar.gz

wget http://mirrors.tuna.tsinghua.edu.cn/apache//apr/apr-util-1.5.4.tar.gz

2.安装

首先安装源码包需要一些工具

yum -y install gcc autoconf automake make pcre pcre-devel openssl openssl-devel


将三个包解压并放入/usr/src后;

cd /usr/src/apr-1.5.2/

./configure 

make&&make install 


cd /usr/src/apr-util-1.5.4/

./configure --with-apr=/usr/local/apr

make&&makeinstall


cd /usr/src/httpd-2.4.23/

./configure --prefix=/usr/local/apache2 --enable-so --enable-ssl --enable-rewrite --with-mpm=worker --with-suexec-bin --with-apr=/usr/local/apr/

make&&make install


--prefix#指定安装路径

--enable-so#开启模块化功能

--enable-ssl#SSL加密

--enable-rewrite #支持地址重写

--with-mpm #设置工作模式

--with-suexec#支持SUID,SGID

--with-apr#指定APR的绝对路径


3.启动

/usr/local/apache2/bin/apachectl start

4.访问

浏览器输入IP,显示IT WORKS!

即配置成功。

 



0 0