centos6.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已经可以正常运行了
时间: 2024-07-28 21:05:40

centos6.5下Apache 安装的相关文章

CentOS6.5下Apache安装

安装之前确保 Development Libraries与Development tools安装上.安装方法参考:http://www.linuxidc.com/Linux/2016-04/130080.htm 与 http://www.linuxidc.com/Linux/2016-04/130081.htm 一.编译安装1.解决依赖关系 安装httpd 2.4.4时首先需要解决依赖关系,httpd 2.4.4需要较新版本的apr和apr-util.升级方式有两种,一种是通过源代码编译安装,一

Centos6.4下Nginx安装

Nginx ("engine x") 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器. Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过三年了.Igor 将源代码以类BSD许可证的形式发布. Nginx和Apache区别 Nginx 超越 Apache 的高性能和稳定性,使得国内使用 Nginx 作为 Web 服务器的网站也越来越多,其中包括新浪博客.新浪播客.网易新

CentOS6.3下DNS安装与配置

1.下载并安装最新的bind包 yum install –y bind bind-chroot bind-utis 2.配置named.conf acl internals{ 127.0.0.0/8; 192.168.0.0/24; }; view "internal" { match-clients {internals; }; zone "youdomian.com" { type master; file "/etc/named/internals/

CentOS下Apache安装SSL

CentOS下Apache安装SSL https是一个安全的访问方式,数据在传输过程中是加密的.https基于ssl. 一.安装apache和ssl模块1.安装apacheyum install httpd2.安装ssl模块yum install mod_ssl重启apache:service httpd restart安装完mod_ssl会创建一个默认的SSL证书,路径位于/etc/pki/tls ,此时可以立即通过https访问服务器了:https://IP/如果不使用默认的证书,也可以使用

CentOS6.5_64bit下编译安装MySQL-5.6.23

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/44785511 ************************************************************         CentOS6.5_64bit下编译安装MySQL-5.6.23 **************************************************************一.关闭防火墙chkconfig iptable

Linux(CentOS6.5)下编译安装PHP5.6.22时报错”configure: error: ZLIB extension requires gzgets in zlib”的解决方式(确定已经编译安装Zlib,并已经指定Zlib路径)

本文地址http://comexchan.cnblogs.com/,作者Comex Chan,尊重知识产权,转载请注明出处,谢谢!   今天在CentOS6.5下编译安装PHP时,一直报错 configure: error: ZLIB extension requires gzgets in zlib 而Zlib确定已经安装了. 使用Google根本搜索不到有关的错误. 尝试重新编译了Zlib,还是不行. 后面发现我的PHP编译选项里面有个 --with-libdir=lib64 \ 删除之,再

centos6.7下编译安装lnmp

很多步骤不说明了,请参照本人的centos6.7下编译安装lamp,这次的架构是nginx+php-fpm一台服务器,mysql一台服务器 (1)首先编译安装nginx: 操作命令: yum -y groupinstall "Development Tools" "Server Platform Development" yum -y install pcre-devel  useradd -r nginx  mkdir /var/tmp/nginx   事先得创建

centos6.7下 编译安装MySQL5.7

centos6.7下编译安装MySQL5.7 准备工作 #-----依赖包及MySQL和boost安装包----- #yum包安装: shell> yum -y install gcc-c++ ncurses-devel cmake make perl gcc autoconf automake zlib libxml libgcrypt libtool bison #获取boost类库(5.7编译需要boost类库,编译时指定boost路径): shell> wget http://down

Linux下apache安装

之前我介绍过apache abtest来做压力测试(http://www.cnblogs.com/super-d2/p/3831155.html) 但是怎么在linux下安装apache,一般而言Linux下安装apache需要源码安装: 首先,到apache的官网下载 apache源码包: http://httpd.apache.org/download.cgi#apache22 #chmod 755 httpd-2.0.54.tar.gz   (说明:给予更多的权限) #./configur