阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

CentOS 6.5下Apache 安装

129次阅读
没有评论

共计 2263 个字符,预计需要花费 6 分钟才能阅读完成。

CentOS 6.5 下 Apache 安装过程。

1. 下载 apache  www.apache.org 找到相应的地址复制后 weget 即可,也可以用下面这个

wget http://mirrors.cnnic.cn/apache/httpd/httpd-2.4.23.tar.gz

tar -xf httpd-2.4.23.tar.gz

./configure

–prefix=/application/apache2.4.23

–enable-deflate

–enable-expires

–enable-header

–enable-modules=most

–enable-rewrite

–enable-so

–with-mpm=worker

解释一下上面的参数:

–prefix 安装路径

–enable-modules=most 使用大部分常用模块

–enable-rewrite 重写模块

–with-mpm=work 运行方式为一个主进程若干个子线程,还可以配置为进程,配置为进程的优点是更稳定,但是同时也更慢,更耗费 cpu 资源,当前主流都是把 apache 作为静态服务器使用所以使用 work 就可以了。如果你要和 php 等程序做配合可以设置为进程方式工作。

2. 进行到这一步的时候出现了错误提示找不到 apr,逐回到 apache.org 下载 apr 和 apr-util

wget http://mirrors.cnnic.cn/apache/apr/apr-1.5.2.tar.gz

./configure –prefix=/application/apr

make

make install

wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.5.4.tar.gz

./configure –prefix=/application/apr-util –with-apr=/application/apr

make

make install

3. 重新安装 apache,进入 apache 解压缩目录

./configure

–prefix=/application/apache2.4.23

–enable-deflate

–enable-expires

–enable-header

–enable-modules=most

–enable-rewrite

–enable-so

–with-mpm=worker

–with-apr=/application/apr –with-apr-util=/application/apr-util

4. 继续报错

checking whether to enable mod_deflate… configure: error: mod_deflate has been requested but can not be built due to prerequisite failures

这是因为没有安装 zlib 包,逐 yum 安装之

yum install zlib-devel

5.ok 装好后继续 make apache 这次没有问题了 继续 make install 至此安装完毕

6. 修改 /application/apache2.4.23/conf/httpd.conf

找到 #ServerName

去掉# 更改为:

ServerName localhost:80

7. 启动 apache

/application/apache2.4.23/bin/httpd -k start

8. 测试一下

curl 本机 ip 如果 返回 it works 证明 apache 已经可以正常运行了

Ubuntu Server 14.04 安装 Web 服务器 (Linux+Apache+MySQL+PHP)  http://www.linuxidc.com/Linux/2015-06/119061.htm

Linux 下安装配置 PHP 环境 (Apache2)  http://www.linuxidc.com/Linux/2015-05/118062.htm

Linux 下 Apache 服务器配置  http://www.linuxidc.com/Linux/2016-06/132025.htm

Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm

CentOS 5.9 下编译安装 LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm

Linux 下 Apache 服务器配置 http://www.linuxidc.com/Linux/2016-10/136517.htm

Linux 下 Apache 虚拟主机的配置  http://www.linuxidc.com/Linux/2016-04/130381.htm

Ubuntu 下 Apache 的安装与配置 http://www.linuxidc.com/Linux/2016-11/136841.htm

CentOS 6.5 安装 Apache-2.4.10 及安全配置  http://www.linuxidc.com/Linux/2016-12/137985.htm

Apache 的详细介绍 :请点这里
Apache 的下载地址 :请点这里

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-12/138252.htm

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-21发表,共计2263字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中