linux web服务

实验步骤
1、安装httpd软件包
(1)解压缩文件
[root@centos01 ~]# tar zxvf /mnt/httpd-2.2.17.tar.gz -C /usr/src
(2)配置apache
进入目录
[root@centos01 ~]# cd /usr/src/httpd-2.2.17/
配置
[root@centos01 httpd-2.2.17]# ./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-line --enable-cgi
(3)编译apache
[root@centos01 httpd-2.2.17]# make
(4)安装
[root@centos01 httpd-2.2.17]# make install
(5)检查暗战是否安装完成
[root@centos01 httpd-2.2.17]# ls -ld /usr/local/httpd
drwxr-xr-x 15 root root 175 10月 27 22:52 /usr/local/httpd
2、配置并启动httpd服务
(1)优化程序执行目录
[root@centos01 ~]# ln -s /usr/local/httpd/bin/* /usr/local/bin
(2)生成aapache服务,服务名字httpd
[root@centos01 ~]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
(3)添加执行权限
[root@centos01 ~]# chmod +x /etc/init.d/httpd
(4)修改apache服务的控制文件
[root@centos01 ~]# vim /etc/init.d/httpd
#!/bin/sh
#chkonfig:35 80 21
#Description:Apache Server
(5)添加为系统服务
[root@centos01 ~]# chkconfig --add httpd
(6)设置httpd开机自启
[root@centos01 ~]# chkconfig --level 35 httpd on
(7)配置httpd服务
[root@centos01 ~]# vim /usr/local/httpd/conf/httpd.cof
创建httpd.conf.bak
cp /usr/local/httpd/conf/httpd.conf /usr/local/httpd/conf/httpd.conf.bak
修改为www.bdqn.com
#ServerName www.www.example.com:80
ServerName 192.168.100.10:80
客户端访问
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值