安装配置Apache

安装包的获取:http://www.apache.org
1.1.安装Apache(tar包)
tar –zxvf http-2.2.11.tar.gz
cd http-2.2.11
./configure --prefix=/usr/local/apache --enable-modules=so --enable-rewrite
make && make install
1.2.配置Apache
vi /usr/local/apache/conf/httpd.conf
找到下面这行
#ServerName www.example.com:80
修改为:
ServerName www.dong.com:80
保存退出。
1.3.拷贝文件
cp –a /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
cp –a /usr/local/apache/bin/apachectl /etc/httpd/conf/httpd
将httpd加到系统服务中
cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
vi httpd //在/etc/rc.d/int.d/目录下编辑复制过去的httpd程序
找到:#!/bin/sh //一般在第一行
另起一行,增加:
# chkconfig: 2345 70 30
# description: Apache
然后注册服务:chkconfig --add httpd
启动:service httpd start
停止:service httpd stop
重新启动:service httpd restart
重启apache
如果失败,把占用80的程序灭了
netstat -lnp|grep 80

1.4运行service命令
Service httpd restart
1.5检验配置是否成功
IE地址栏输入:http://www.dong.com
看到It’s Work证明配置成功。
或者使用 ps –aux|grep httpd
如果看到多行数据,也证明配置成功
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值