傻瓜式教程

  1. # 切换至超管
  2. su root
  3. # 查看是否安装有httpd
  4. rpm -qa httpd
  5. # 安装httpd
  6. yum install httpd* -y
  7. # 关闭防火墙
  8. system stop firewalld
  9. # 关闭selinux
  10. setenforce 0
  11. # 启动服务器
  12. systemctl start httpd
  13. # 查看服务器运行状态
  14. systemctl status httpd
  15. # 进入/etc/httpd/conf 目录下 配置端口号8099 和 网页主页html1
  16. cd /etc/httpd/conf
  17. ls
  18. vim httpd.conf
  19. # 按i插入数据
  20. # 提示:将最后一行includeOptional #注释掉 将documentroot 目录html改为html1
  21. # 将listen端口号改为8099
  22. # esc 返回只读状态
  23. # 修改后:wq保存,重启服务器
  24. systemctl restart httpd
  25. # 查看本机ip
  26. ifconfig
  27. # 打开浏览器输入本机ip + 端口号:8099
  28. 网址格式:ip:8099
  29. # 进入到/var/www/html1 先新建html1
  30. cd /var/www/
  31. mkdir html1
  32. cd html1
  33. # 新建.html后缀 index文件
  34. touch index.html
  35. vim index.html
  36. # 在里面输入自己的学号和班级
  37. # 按i 插入数据
  38. # 按esc 返回
  39. # 在此状态按:wq 保存退出
  40. # 会到浏览器刷新就可以看到你的信息啦

图例

image.png
image.png
image.png

image.pngimage.pngimage.pngimage.pngimage.pngimage.png