centos 安装 apache

[b]步骤[/b]

shell> cp httpd-2.2.17.tar.bz2 /usr/local

shell> cd /usr/local

shell> tar -jxvf httpd-2.2.17.tar.bz2

shell> cd httpd-2.2.17

shell> ./configure --prefix=/usr/local/apache --enable-so
# --enable-rewrite --enable-mods-shared=most
说明:
--enable-so选项:让Apache可以支持DSO模式,注意,这里采纳使用地是Apache2.0地 语法。如果你地Apache是1.3版本,应改为--enable-module=so。
--enable-mods-shared=most选项:告诉编译器将所有标准模块都编译为DSO模块。你要是用地是Apache1.3,改为--enable-shared=max就可以。
--enable-rewrite选项:支持地址重写功能,运用1.3版本地朋友请将它改为--enable-module=rewrite。

shell> make

shell> make install

shell> apachectl start
启动apache 完整地命令为:/usr/local/apache/bin/apachectl start
现在测试一下,http://IP ,你会看到apache地默认界面

shell>htmlview 127.0.0.1


[b]修改apache的端口[/b]

shell>cd /etc/httpd/conf

shell>vi httpd.conf

修改listen 80 为 listen 8080
修改servername localhost:8080


[b]apache开机启动[/b]

shell>cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd

shell>vi /etc/init.d/httpd

在在#!/bin/sh后面加入下面两行
#chkconfig:345 85 15
#description: Start and stops the Apache HTTP Server.

shell>chmod +x /etc/rc.d/init.d/httpd

shell>chkconfig --add httpd

然后可以用setup命令进入服务设置,设置为开机启动
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值