仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1309|回复: 9
打印 上一主题 下一主题

[CentOS(社区)] 带来一篇CentOS6.5下装置apache2.2

[复制链接]
精灵巫婆 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-14 20:30:52 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!
1.筹办步伐:

httpd-2.2.27.tar.gz下载地点:http://httpd.apache.org/download.cgi#apache22

apr-1.5.1.tar.gz下载地点:http://apache.spd.co.il/apr/
  1. apr-util-1.5.3.tar.gz下载地点:http://apache.spd.co.il/apr/
复制代码

装置apr-1.5.1.tar.gz


1、Copyroot文件夹

2、Cd/root

3、Tar–zxvfapr-1.5.1.tar.gz

4、Cdapr-1.5.1

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


提醒:configure:error:noacceptableCcompilerfoundin$PATH

办理:yum-yinstallgcc


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

7.make

Makeinstall



装置apr-util-1.5.3.tar.gz

1.copy上传apr-util-1.5.3.tar.gz文件

2.cd/root

3.cdapr-util-1.5.3

4.#./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr

5.Make

6.Makeinstall


装置httpd-2.2.27.tar.gz

1.copyapache

2.tar-zxvfhttpd-2.2.27.tar.gz

3.cdhttpd-2.2.27

4.#./configure--prefix=/usr/local/apache2--enable-module=so--enable-ssl=sharedSSL--enable-rewrite=shared--enable-proxy=shared--enable-deflate=shared--with-mpm=worker--enable-expires=shared--enable-speling=shared--enable-mods-shared=all--enable-module=most--enable-mods-shared=all--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util

5.提醒毛病:

6.checkingwhethertoenablemod_deflate...configure:error:mod_deflatehasbeenrequestedbutcannotbebuiltduetoprerequisitefailures

7.缘故原由:没装zlib-devel
装置***:yuminstallgcczlib-developenssl-devel

8.Make

9.Makeinstall


本例中apache装置在/usr/local/apache2,办事把持剧本为:

/usr/local/apache2/bin/apachectl

实行上面的下令启动Apache办事:

/usr/local/apache2/bin/apachectlstart

实行上面的下令中断Apache办事:

/usr/local/apache2/bin/apachectlstop

能够复杂地把Apache启动下令加到/etc/rc.local文件,让Apache随体系启动而主动启动:

echo"/usr/local/apache2/bin/apachectlstart">>/etc/rc.local

上面先容怎样把Apache到场到体系办事,用service下令来把持Apache的启动和中断。

起首以apachectl剧本为模板天生Apache办事把持剧本:

grep-v"#"/usr/local/apache2/bin/apachectl>/etc/init.d/apache

vi编纂Apache办事把持剧本/etc/init.d/apache

vi/etc/init.d/apache

在文件最后面拔出上面的行,使其撑持chkconfig下令:

#!/bin/sh

#chkconfig:23458515

#description:ApacheisaWorldWideWebserver.

保留前进出vi编纂器,实行上面的下令增添Apache办事把持剧本实行权限:

chmod+x/etc/init.d/apache

实行上面的下令将Apache办事到场到体系办事:

chkconfig--addapache

实行上面的下令反省Apache办事是不是已失效:

chkconfig--listapache

下令输入相似上面的了局:

apache0:off1:off2:on3:on4:on5:on6:off

标明apache办事已失效,在2345运转级别随体系启动而主动启动,今后可使用service下令把持Apache的启动和中断。

启动Apache办事:

serviceapachestart

  中断Apache办事:

serviceapachestop

  实行上面的下令封闭开机自启动:

chkconfigapacheoff

  实行上面的下令改动开机自启动的运转级别为35

chkconfig--level35apacheon



翻开防火墙

vim/etc/sysconfig/iptables

增加端口

-ARH-Firewall-1-INPUT-mstate--stateNEW-mtcp-ptcp--dport80-jACCEPT

重启失效

serviceiptablesrestart重启


启动apache

./apachectlstart

此时用户为daemon


若启动apachectlstart

此时用户为apache

则修正监听端口有效

如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-12 03:15

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表