Linux配置文档WWW

  • 配置基础知识

先现切换至超级用户

[root@localhost ~]# ping www.baidu.com      //先测试网络是否通畅

PING www.a.shifen.com (14.215.177.38) 56(84) bytes of data.

64 bytes from 14.215.177.38: icmp_seq=1 ttl=128 time=41.1 ms

64 bytes from 14.215.177.38: icmp_seq=2 ttl=128 time=39.0 ms

[root@localhost ~]# yum -y install httpd

已加载插件:fastestmirror, refresh-packagekit, security

......

更新完毕:

  httpd.i686 0:2.2.15-69.el6.centos

完毕!

[root@localhost ~]# service httpd start           //开启服务

正在启动 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

                                                           [确定]

[root@localhost ~]# chkconfig httpd on                      //设置开机自启服务

[root@localhost ~]# cd /etc/httpd/conf/

[root@localhost conf]# ls

httpd.conf  magic

[root@localhost conf]# vi httpd.conf

  1. ServiceRoot/etc/httpd 工作目录不需要更改
  2. ServiceAdmin root@localhost 管理员的邮箱,可以不修改
  3. #ServiceName www.example.com:80    修改为:192.168.77.130
  4. DocumentRoot/var/www/html 文档的主目录 不用修改
  5. AddDefaultCharset UTF-8(默认字符集)  不用修改

[root@localhost conf]# vi httpd.conf          //检查修改成功没

[root@localhost conf]# service httpd restart

停止 httpd:                                               [确定]

正在启动 httpd:                                           [确定]

[root@localhost conf]# cd /var/www/html

[root@localhost html]# vi index.html

[root@localhost html]# service httpd restart

停止 httpd:                                               [确定]

正在启动 httpd:                                           [确定]

测试:

创建html文件并编辑添加:

然后在点击文件

基本完成!!!!

  • 配置关键技术
  1. 首先需要连通网络
  2. 关闭防火墙
  3. 注意自己虚拟ip不能写错

  • 配置问题详解

基本没有问题 比较简单

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值