Httpd服务入门知识-Httpd服务常见配置案例之显示服务器版本信息
Httpd服务入门知识-Httpd服务常见配置案例之显示服务器版本信息
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一.httpd配置文件的组成
1>.主要组成
Global Environment
Main server configuration virtual host
2>.配置格式:directive value(指令 属性值)
directive 不区分字符大小写
value 为路径时,是否区分大小写,取决于文件系统
3>.官方帮助
博主推荐阅读:
http://httpd.apache.org/docs/2.4/
二.显示服务器版本信息
1>.如下图所示,默认情况下服务器版本是显示的

2>.点击指令快速参考(如下图所示,点击"Run-time Configuration Directives")

3>.快速过滤我们要查找的指令(如下图所示,咱们要设置的是显示服务器版本信息,该指令是以"S"开头的)

4>.如下图所示,点击"ServerTokens"指令

5>.查看显示服务器版本信息案例

6>.自定义httpd的配置文件,设置参数"ServerTokens Prod"
[root@node101.yinzhengjie.org.cn ~]# egrep -v "^ *#|^$" /etc/httpd/conf/httpd.conf
ServerRoot "/etc/httpd"
Listen
Include conf.modules.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride None
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
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
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule mime_module>
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
IncludeOptional conf.d/*.conf
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# egrep -v "^ *#|^$" /etc/httpd/conf/httpd.conf #默认配置
[root@node101.yinzhengjie.org.cn ~]# curl -I http://node101.yinzhengjie.org.cn/
HTTP/1.1 OK
Date: Sat, Dec :: GMT
Server: Apache/2.4. (CentOS)
Last-Modified: Sat, Dec :: GMT
ETag: "25-599131e54e9d8"
Accept-Ranges: bytes
Content-Length:
Content-Type: text/html; charset=UTF- [root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# echo "ServerTokens Prod" > /etc/httpd/conf.d/server_tokens.conf
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# cat /etc/httpd/conf.d/server_tokens.conf
ServerTokens Prod
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# httpd -t
Syntax OK
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# systemctl reload httpd
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# curl -I http://node101.yinzhengjie.org.cn/
HTTP/1.1 OK
Date: Sat, Dec :: GMT
Server: Apache
Last-Modified: Sat, Dec :: GMT
ETag: "25-599131e54e9d8"
Accept-Ranges: bytes
Content-Length:
Content-Type: text/html; charset=UTF- [root@node101.yinzhengjie.org.cn ~]#

7>.查看httpd进程
[root@node101.yinzhengjie.org.cn ~]# ps auxf | grep apache
root 0.0 0.0 pts/ S+ : : | \_ grep --color=auto apache
apache 0.0 0.0 ? S : : \_ /usr/sbin/httpd -DFOREGROUND
apache 0.0 0.0 ? S : : \_ /usr/sbin/httpd -DFOREGROUND
apache 0.0 0.0 ? S : : \_ /usr/sbin/httpd -DFOREGROUND
apache 0.0 0.0 ? S : : \_ /usr/sbin/httpd -DFOREGROUND
apache 0.0 0.0 ? S : : \_ /usr/sbin/httpd -DFOREGROUND
apache 0.0 0.0 ? S : : \_ /usr/sbin/httpd -DFOREGROUND
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# pstree | grep httpd
|-httpd---*[httpd]
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# pstree -p | grep httpd
|-httpd()-+-httpd()
| |-httpd()
| |-httpd()
| |-httpd()
| |-httpd()
| `-httpd()
[root@node101.yinzhengjie.org.cn ~]#
[root@node101.yinzhengjie.org.cn ~]# pstree -p
systemd()─┬─NetworkManager()─┬─dhclient()
│ ├─{NetworkManager}()
│ └─{NetworkManager}()
├─agetty()
├─atd()
├─auditd()───{auditd}()
├─crond()
├─dbus-daemon()
├─httpd()─┬─httpd()
│ ├─httpd()
│ ├─httpd()
│ ├─httpd()
│ ├─httpd()
│ └─httpd()
├─irqbalance()
├─lvmetad()
├─polkitd()─┬─{polkitd}()
│ ├─{polkitd}()
│ ├─{polkitd}()
│ ├─{polkitd}()
│ ├─{polkitd}()
│ └─{polkitd}()
├─rsyslogd()─┬─{rsyslogd}()
│ └─{rsyslogd}()
├─sshd()─┬─sshd()───bash()───pstree()
│ └─sshd()───bash()
├─systemd-journal()
├─systemd-logind()
├─systemd-udevd()
└─tuned()─┬─{tuned}()
├─{tuned}()
├─{tuned}()
└─{tuned}()
[root@node101.yinzhengjie.org.cn ~]#
Httpd服务入门知识-Httpd服务常见配置案例之显示服务器版本信息的更多相关文章
- Httpd服务入门知识-Httpd服务常见配置案例之虚拟主机
Httpd服务入门知识-Httpd服务常见配置案例之虚拟主机 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.虚拟主机实现方案 1>.Apache httpd 有三种实现虚 ...
- Httpd服务入门知识-Httpd服务常见配置案例之Apache的工作做状态status页面
Httpd服务入门知识-Httpd服务常见配置案例之Apache的工作做状态status页面 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.status功能概述 status页 ...
- Httpd服务入门知识-Httpd服务常见配置案例之ServerSignature指令选项
Httpd服务入门知识-Httpd服务常见配置案例之ServerSignature指令选项 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.ServerSignature指令概述 ...
- Httpd服务入门知识-Httpd服务常见配置案例之实现用户家目录的http共享
Httpd服务入门知识-Httpd服务常见配置案例之实现用户家目录的http共享 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.实现用户家目录的http共享前提 在配置家目录共 ...
- Httpd服务入门知识-Httpd服务常见配置案例之定义路径别名
Httpd服务入门知识-Httpd服务常见配置案例之定义路径别名 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.创建测试数据 [root@node101.yinzhengj ...
- Httpd服务入门知识-Httpd服务常见配置案例之设定默认字符集
Httpd服务入门知识-Httpd服务常见配置案例之设定默认字符集 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.查看生产环境中使用的字符集案例 1>.查看腾讯设置的默认 ...
- Httpd服务入门知识-Httpd服务常见配置案例之日志设定
Httpd服务入门知识-Httpd服务常见配置案例之日志设定 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.日志类型 [root@node101.yinzhengjie.org ...
- Httpd服务入门知识-Httpd服务常见配置案例之基于客户端来源地址实现访问控制
Httpd服务入门知识-Httpd服务常见配置案例之基于客户端来源地址实现访问控制 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Options 1>.OPTIONS指 ...
- Httpd服务入门知识-Httpd服务常见配置案例之基于用户账号实现访问控制
Httpd服务入门知识-Httpd服务常见配置案例之基于用户账号实现访问控制 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.基于用户的访问控制概述 认证质询: WWW-Auth ...
随机推荐
- 【CF848B】 Rooter's Song
题目链接 \(solution\) 类似于蚂蚁那道题的做法 弹性碰撞相当于交换位置并继续前进,考虑一个起点\((x,0)\),时间为\(t\)出发的\(dancer\),相当于从\((x,-t)\)的 ...
- SpringBoot简介以及案例
1什么是SpringBoot Spring Boot 是所有基于 Spring 开发的项目的起点.Spring Boot 的设计是为了让你尽可能快的跑起来 Spring 应用程序并且尽可能减少你的配置 ...
- c++开发遇到的错误和引用配置
1. libcurl引入的时候必须要加载下面三个库 #pragma comment(lib, "ws2_32.lib") #pragma comment(lib, "wl ...
- k8s安装dashboard
1.Kubernetes Dashboard 是 k8s集群的⼀个 WEB UI管理⼯具,代码托管在 github 上,地址: https://github.com/kubernetes/das ...
- Apache Beam实战指南 | 大数据管道(pipeline)设计及实践
Apache Beam实战指南 | 大数据管道(pipeline)设计及实践 mp.weixin.qq.com 策划 & 审校 | Natalie作者 | 张海涛编辑 | LindaAI 前 ...
- [转帖]springboot2.0配置连接池(hikari、druid)
springboot2.0配置连接池(hikari.druid) 原文链接:https://www.cnblogs.com/blog5277/p/10660689.html 原文作者:博客园--曲高终 ...
- VisualSVN 新版本终于支持一个解决方案下多workcopy了,并解决了上个版本一个重要BUG
Multiple working copies within a single solution VisualSVN 7.0 and older require the solution file a ...
- ftp搭建后外网无法连接和访问阿里云服务器(非软件)
阿里云服务器由于性价比高,是不少企业建站朋友们的首选.而在购买阿里云服务器后,不少客户反映其在搭建FTP后出现外网无法访问的问题,这里特意搜集整理了关于ftp搭建后外网无法连接和访问的问题,提供以下解 ...
- python3 marshmallow学习
python3 marshmallow学习 官方文档:https://marshmallow.readthedocs.io/en/stable/ 安装: pip install -U marshmal ...
- 使用 HttpWebRequest 类做 POST 请求没有应反
这几天给系统做第三方集成, 需要调用另一个软件的一个接口, 通过 HTTP 的方式调用,调用代码也挺简单的: string serviceUrl = string.Format("{0}/{ ...