Linux CentOS7 httpd 服务配置注释

简介: Linux CentOS7 httpd 服务配置注释apache 配置注释如果没看懂可以去看看官方发布的文档 apache官方文档conf/httpd.confCopyServerRoot "/etc/httpd" # 指定服务配置根目录Listen 80 # 监听端口Include conf.

Linux CentOS7 httpd 服务配置注释

apache 配置注释
如果没看懂可以去看看官方发布的文档 apache官方文档

conf/httpd.conf

Copy
ServerRoot "/etc/httpd" # 指定服务配置根目录
Listen 80 # 监听端口
Include conf.modules.d/*.conf # 包含模块配置文件
User apache # 使用的用户进程和组
Group apache
ServerAdmin root@localhost # 服务器管理员邮箱,用于错误提示。
DocumentRoot "/var/www/html" # 指定服务网页根目录
# 为指定目录设置不同权限

AllowOverride none                  # 禁止使用.htaccess 中的指令
Require all denied                  # 禁止所有访问


AllowOverride None
Require all granted                 # 允许访问


Options Indexes FollowSymLinks      # 允许的参数(索引(建议禁用),跟随软连接)
AllowOverride None
Require all granted


DirectoryIndex index.html           # 指定默认首页


Require all denied                  # 禁止访问该文件


ErrorLog "logs/error_log" # 日志记录
LogLevel warn
# 日志配置

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" combined    # 指定日志文件名和格式(结合)


ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"   # 路径别名


AllowOverride None
Options None
Require all granted


# 指定文件格式和mime对应

TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml


AddDefaultCharset UTF-8 # 指定默认编码

MIMEMagicFile conf/magic                # 指定mime


EnableSendfile on # 开启sendfile功能

sendfile功能必须在Linux kernel 2.1版本以后内核中才能开启

sendfile功能直接跳过了将内容复制到用户缓冲区的过程,直接将文件内容复制到了socket缓冲区

加快了文件的发送速度。

IncludeOptional conf.d/*.conf
conf.d/autoindex.conf

Copy
IndexOptions FancyIndexing HTMLTable VersionSort # 索引选项
Alias /icons/ "/usr/share/httpd/icons/"

Options Indexes MultiViews FollowSymlinks
AllowOverride None
Require all granted


AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip # 根据文件编码来分配图标
AddIconByType (TXT,/icons/text.gif) text/* # 根据文件类型来分配图标
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe # 根据文件后缀来分配图标
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif /core
AddIcon /icons/bomb.gif /core.
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif # 默认的未知文件
ReadmeName README.html # 和下面一个共同用于添加索引的上下文件内容
HeaderName HEADER.html
IndexIgnore .?? ~ # HEADER README RCS CVS ,v *,t # 指定要隐藏的文件。
conf.d/welcome.conf

Copy
# 仅将该规则用于规则匹配的URL

Options -Indexes                                            # 去除所有参数
ErrorDocument 403 /.noindex.html            # 错误返回代码和网页


AllowOverride None
Require all granted


Alias /.noindex.html /usr/share/httpd/noindex/index.html
Alias /noindex/css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
Alias /noindex/css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png
conf.d/ssl.conf

Copy
Listen 443 https
SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog # 加密私钥的对话类型
SSLSessionCache shmcb:/run/httpd/sslcache(512000) # SSL对话密钥的存储位置
SSLSessionCacheTimeout 300 # SSL对话密钥的超时时间
SSLRandomSeed startup file:/dev/urandom 256 # 随机种子的获取地址
SSLRandomSeed connect builtin # 如果无法使用urandom则使用内置随机数生成器
SSLCryptoDevice builtin # 硬件加密策略,默认使用内置,可是使用openssl engine 插叙是否可是使用其他硬件加密策略

SSLCryptoDevice rdrand # 这个是intel的硬件加密引擎

<""><><""><>""""""


相关文章
|
2月前
|
Java Linux Shell
linux自动部署jar包,注册系统服务(基于Centos7)
linux自动部署jar包,注册系统服务(基于Centos7)
81 0
|
3月前
|
应用服务中间件 Linux 网络安全
centos7 下离线安装gcc g++ nginx,并配置nginx进行网络流转发
centos7 下离线安装gcc g++ nginx,并配置nginx进行网络流转发
104 0
|
2月前
|
Linux 应用服务中间件 网络安全
CentOS7搭建本地离线局域网yum源(Httpd/Nginx+yum)
CentOS7搭建本地离线局域网yum源(Httpd/Nginx+yum)
284 0
|
8天前
|
网络协议
centos8 网卡 Nmcli(是network的简写 Nmcli)配置网络
centos8 网卡 Nmcli(是network的简写 Nmcli)配置网络
11 0
|
26天前
|
Shell Linux 网络安全
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
【Shell 命令集合 网络通讯 】Linux 管理Apache HTTP服务器 httpd命令 使用指南
28 0
|
1月前
|
存储 监控 Linux
Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
【2月更文挑战第17天】Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
27 1
Flume【部署 02】Flume监控工具Ganglia的安装与配置(CentOS 7.5 在线安装系统监控工具Ganglia + 权限问题处理 + Flume接入监控配置 + 图例说明)
|
2月前
|
数据可视化 数据挖掘 Linux
如何在CentOS安装DataEase数据分析服务并实现远程访问管理界面
如何在CentOS安装DataEase数据分析服务并实现远程访问管理界面
212 1
|
2月前
|
Linux 开发工具
【Linux】vim中批量化注释
【Linux】vim中批量化注释
【Linux】vim中批量化注释
|
2月前
|
Ubuntu Linux 网络安全
|
3月前
|
负载均衡 算法 Linux
百度搜索:蓝易云【Centos7系统Haproxy安装配置教程】
现在,HAProxy已经成功安装和配置在您的CentOS 7系统上。它将监听您配置的端口,并根据负载均衡策略将请求转发到后端服务器。您可以根据需要自定义更多的配置,如SSL终止、ACL和更复杂的负载均衡算法。请确保HAProxy的配置符合您的需求,并在进行更改之前备份配置文件,以防止意外的错误。
41 2