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服务常见配置案例之显示服务器版本信息的更多相关文章

  1. Httpd服务入门知识-Httpd服务常见配置案例之虚拟主机

    Httpd服务入门知识-Httpd服务常见配置案例之虚拟主机 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.虚拟主机实现方案 1>.Apache httpd 有三种实现虚 ...

  2. Httpd服务入门知识-Httpd服务常见配置案例之Apache的工作做状态status页面

    Httpd服务入门知识-Httpd服务常见配置案例之Apache的工作做状态status页面 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.status功能概述 status页 ...

  3. Httpd服务入门知识-Httpd服务常见配置案例之ServerSignature指令选项

    Httpd服务入门知识-Httpd服务常见配置案例之ServerSignature指令选项 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.ServerSignature指令概述 ...

  4. Httpd服务入门知识-Httpd服务常见配置案例之实现用户家目录的http共享

    Httpd服务入门知识-Httpd服务常见配置案例之实现用户家目录的http共享 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.实现用户家目录的http共享前提 在配置家目录共 ...

  5. Httpd服务入门知识-Httpd服务常见配置案例之定义路径别名

    Httpd服务入门知识-Httpd服务常见配置案例之定义路径别名 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任.   一.创建测试数据 [root@node101.yinzhengj ...

  6. Httpd服务入门知识-Httpd服务常见配置案例之设定默认字符集

    Httpd服务入门知识-Httpd服务常见配置案例之设定默认字符集 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.查看生产环境中使用的字符集案例 1>.查看腾讯设置的默认 ...

  7. Httpd服务入门知识-Httpd服务常见配置案例之日志设定

    Httpd服务入门知识-Httpd服务常见配置案例之日志设定 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.日志类型 [root@node101.yinzhengjie.org ...

  8. Httpd服务入门知识-Httpd服务常见配置案例之基于客户端来源地址实现访问控制

    Httpd服务入门知识-Httpd服务常见配置案例之基于客户端来源地址实现访问控制 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Options  1>.OPTIONS指 ...

  9. Httpd服务入门知识-Httpd服务常见配置案例之基于用户账号实现访问控制

    Httpd服务入门知识-Httpd服务常见配置案例之基于用户账号实现访问控制 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.基于用户的访问控制概述 认证质询: WWW-Auth ...

随机推荐

  1. ZROI 暑期高端峰会 A班 Day2 线性代数

    高斯消元 很普及组,不讲了 当主元没有逆的时候可以辗转相除. 如果也没有带余数除法--没救了 逆矩阵 我们定义矩阵 \(A\) 的逆矩阵为 \(A^{-1}\),满足 \(AA^{-1}=A^{-1} ...

  2. C语言-memset()

    1. memset()函数原型是extern void *memset(void *buffer, int c, int count)        buffer:为指针或是数组, c:是赋给buff ...

  3. github打开慢,甚至打不开,怎么办,解决方案方法

    有人使用github后,在某些网络下发现打开慢,甚至打不开,这都是因为他是国外站:目前互联网的连接机制导致超过一定的路由节点的连接就会出现这个问题,解决办法就是直接告诉本机ip.不要先层层询问域名转i ...

  4. ASP.NET Core使用Docker-Swarm集群部署实现负载均衡实战演练

    一.需求背景 人生苦短,我用.NET Core!阿笨对Docker是这样评价的:Docker在手,环境我有!Docker出手,集群我有!前面的Doc基础课程我们学习了如何使用Docker来部署搭建单机 ...

  5. Maven 教程(6)— Maven之pom.xml文件简单说明

    原文地址:https://blog.csdn.net/liupeifeng3514/article/details/79543963 通过前面几部分知识,我们对maven已经有了初步的印象,就像Mak ...

  6. osx或windows系统下,用ftp上传文件到阿里云虚拟主机脚本

    某天突然发现,一直在用的ftp工具并不好用,操作界面太过繁琐,而且不太稳定.于是自己找资料,整合了几句虽然简单,但是方便的代码. mac脚本 #从本地向FTP批量上传文档 需要赋予该.shell文件权 ...

  7. StringToKenizer和Scanner的区别

    相同点: StringToKenizer类和Scanner类都可用于分解字符序列中的单词! 不同点: StringToKenizer类把分解出的全部字符串都存放到StringToKenizer对象的实 ...

  8. Ansible13:Playbook循环语句

    目录 循环语句 简介 loop关键字说明 在循环语句中注册变量 旧循环语句 1. with_items 2. with_nested 3. with_dict 4. with_fileglob 5. ...

  9. Spring Cloud config之三:config-server因为server端和client端的健康检查导致服务超时阻塞问题

    springcloud线上一个问题,当config-server连不上git时,微服务集群慢慢的都挂掉. 在入口层增加了日志跟踪问题: org.springframework.cloud.config ...

  10. mybatis-plus-generator 模板生成代码

    maven: <dependencies> <dependency> <groupId>com.baomidou</groupId> <artif ...