linux中Apach服务器构建

linux中Apach服务器构建

  • 1.Apache的作用
  • 2.Apache的安装
  • 3.Apache的启用
  • 4.Apache的基本信息
  • 5.Apache的基本配置

1.Apache的作用

  • Apache是​​使用最广泛的Web服务器软件。Apache是​​由Apache Software Foundation开发和维护的,它是一个免费提供的开源软件,它占全球所有网络服务器的67%。
  1. web被访问时通常使用 http:// 的方式
  2. http:// 被称为超文本传输协议,是互联网上应用最为广泛的一种网络协议。
  3. http:// 超文本传输协议提供软件: Apache(百度)、 nginx(QQ)、 stgw(腾讯) 、jfe(京东)、 Tengine(淘宝)

2.Apache的安装

dnf install httpd.x86_64 -y
在这里插入图片描述

3.Apache的启用

systemctl enable --now httpd
开启服务并设定服务位开机启动

命令 功能
firewall-cmd --list-all 查看火墙信息
firewall-cmd --permanent --add-service=http 在火墙中永久开启http访问
firewall-cmd --permanent --add-service=https 在火墙中永久开启https访问
firewall-cmd --reload 刷新火墙使设定生效

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4.Apache的基本信息

  • 服务名称: httpd

  • 配置文件:
    /etc/httpd/conf/httpd.conf (主配置文件)
    /etc/httpd/conf.d/.conf* (子配置文件)

  • 默认发布目录: /var/www/html

  • 默认发布文件: index.html

  • 默认端口:
    80 (http)
    443 (https)

  • 用户: apache

  • 日志: /etc/httpd/logs

5.Apache的基本配置

1.Apache端口修改

vim /etc/httpd/conf/httpd.conf
在这里插入图片描述
在这里插入图片描述

2.默认发布文件

在这里插入图片描述
vim /etc/httpd/conf/httpd.conf
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

3.默认发布目录

vim /etc/httpd/conf/httpd.conf
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

发布了47 篇原创文章 · 获赞 3 · 访问量 1390

猜你喜欢

转载自blog.csdn.net/rrrr_ffff/article/details/104724909