安装Apache

一、软件下载
1. Apache HTTP Server
地址:http://httpd.apache.org/download.cgi#apache24
2. APR 和 APR-Util
地址:http://apr.apache.org/download.cgi
3. PCRE
地址:https://sourceforge.net/projects/pcre/files/pcre/


二、安装gcc
yum install gcc-c++


三、新建目录
mkdir /home/admin/basics/http/httpd
mkdir /home/admin/basics/http/apr
mkdir /home/admin/basics/http/apr-util
mkdir /home/admin/basics/http/pcre


四、解压包
cd /home/admin/basics/http/
tar -zxf apr-1.5.2.tar.gz
tar -zxf apr-util-1.5.4.tar.gz
tar -zxf pcre-8.38.tar.gz
tar -zxf httpd-2.4.18.tar.gz


五、安装
cd /home/admin/basics/http/
cd apr-1.5.2
./configure --prefix=/home/admin/basics/http/apr
make
make install


cd /home/admin/basics/http/
cd apr-util-1.5.4
./configure --prefix=/home/admin/basics/http/apr-util --with-apr=/home/admin/basics/http/apr/bin/apr-1-config
make
make install


cd /home/admin/basics/http/
cd pcre-8.38
./configure --prefix=/home/admin/basics/http/pcre --with-apr=/home/admin/basics/http/apr/bin/apr-1-config
make
make install


cd /home/admin/basics/http/
cd httpd-2.4.18
./configure --prefix=/home/admin/basics/http/httpd --with-pcre=/home/admin/basics/http/pcre --with-apr=/home/admin/basics/http/apr --with-apr-util=/home/admin/basics/http/apr-util
make
make install


YUM安装
##先yum list看看有没有你可以的包
yum list httpd


##如果有的话,比如我用x86_64版,就可以安装
yum install httpd.x86_64


配置、启动Apache
httpd.conf是主配置文件,你可以按需更改,一般来说可能需要自定义端口,那么就vim修改httpd.conf文件的监听端口,改为你希望的 


启动、关闭、重启
./apachectl start
./apachectl stop
./apachectl restart
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值