天天看點

Linux CentOS7 httpd 服務配置注釋sendfile功能必須在Linux kernel 2.1版本以後核心中才能開啟sendfile功能直接跳過了将内容複制到使用者緩沖區的過程,直接将檔案内容複制到了socket緩沖區加快了檔案的發送速度。SSLCryptoDevice rdrand # 這個是intel的硬體加密引擎

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

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

# 僅将該規則用于規則比對的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

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的硬體加密引擎

<""><><""><>""""""           
https://www.cnblogs.com/somata/p/LinuxCentOShttpdConfigComment.html