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 ...
随机推荐
- 10-排序6 Sort with Swap(0, i) (25 分)
Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order ...
- vb.net 对字符串中的括号匹配进行判断,容许嵌套
' 括号检查 ' 括号共有四种: 1(英文圆括号),2(中文圆括号),3[方括号],4{花括号} ' 要左右匹配(可以嵌套) Private Shared Function i ...
- python 使用nmap 模块
官网 https://pypi.org/project/python-nmap/ >>> import nmap>>> nm = nmap.PortScannerS ...
- 配置tomcat服务器内存大小中的Xms、Xmx、PermSize、MaxPermSize 详解
1.参数的含义 -vmargs -Xms256m -Xmx512m -XX:PermSize=256M -XX:MaxPermSize=512M -vmargs 说明后面是VM的参数,所以后面的其实都 ...
- JavaScript 一些实用技巧
快速创建从0到n的数字 let arr1 = [...(new Array(n)).keys()]; let arr2 = Array.from({length:n},(v, k) => k); ...
- this指北 (一篇读懂)
this 关键字 涵义 this关键字是一个非常重要的语法点.毫不夸张地说,不理解它的含义,大部分开发任务都无法完成. 前一章已经提到,this可以用在构造函数之中,表示实例对象.除此之外,this还 ...
- POJ-最大连续子序列和
给定一个整数序列,找到一个具有最大和的连续子序列(子序列最少包含一个元素),返回其最大和. 实例输入: -2, 1, -3, 4, -1, 2, 1, -5, 4 实例输出: 6(连续子序列4, -1 ...
- SpringBoot系列教程web篇Listener四种注册姿势
java web三要素Filter, Servlet前面分别进行了介绍,接下来我们看一下Listener的相关知识点,本篇博文主要内容为SpringBoot环境下,如何自定义Listener并注册到s ...
- KAFKA 节点配置问题
-- ::, INFO o.a.j.e.StandardJMeterEngine: Running the test! -- ::, INFO o.a.j.s.SampleEvent: List of ...
- c++中如何判断sqlite表是否存在
在项目中遇到需要判断sqlite数据库中某个表是否存在,上网搜索一些资料后,解决了问题,如下: 首先,在每个sqlite数据库中,都有一个名为sqlite_master的表,它定义了数据库的模式,它的 ...