ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Linux基础命令---httpd守护进程

Linux基础命令---httpd守护进程

原创 Linux操作系统 作者:一生有你llx 时间:2019-06-11 07:45:46 0 删除 编辑

httpd

httpd 是apache超文本传输协议的主程序,它被设计成一个独立运行的守护进程。httpd会建立一个线程池来处理http请求。

此命令的适用范围:RedHat、RHEL、Ubuntu、CentOS、SUSE、openSUSE、Fedora。

 

1 、语法

httpd  [ 选项]

 

2 、参数列表

选项

说明

-d   serverroot

设置服务器根目录。对应配置文件中的ServerRoot指令

-f   config

指定apache服务器的配置文件。如果配置文件不使用绝对路径,那么就是相对于ServerRoot的路径

-k

start|restart|graceful|stop|graceful-stop

向httpd进程发送信息,可以控制httpd

-C

在读取配置文件之前,先处理指定的指令

-c

在读取配置文件之后,处理指定的指令

-D   param

设置参数,它可以配合apache的配置文件中<IfDefine>一起使用

-e   level

设置日志等级

-E   file

设置错误信息文件

-h

显示简短的说明选项

-l

显示静态编译的httpd模块列表

-L

显示apache服务配置文件中的指令列表

-M

显示httpd模块列表

-S

显示虚拟主机配置

-t

检查配置文件语法

-v

显示httpd版本

-V

显示编译时的配置参数和版本信息

-X

运行调试模式

 

3 、实例

1 )重启httpd服务 

[root@localhost ~]# httpd -k restart             // 重启服务

You have new mail in /var/spool/mail/root

[root@localhost ~]#  

2 )检测配置文件

[root@localhost ~]# httpd –t                     // 检测配置文件,没有错误

httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

Syntax OK

[root@localhost ~]# 

3 )显示apache中的模块

[root@localhost ~]#  httpd -M

httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

Loaded Modules:

 core_module (static)

 mpm_prefork_module (static)

 http_module (static)

 so_module (static)

 auth_basic_module (shared)

 auth_digest_module (shared)

 authn_file_module (shared)

 authn_alias_module (shared)

 authn_anon_module (shared)

 authn_dbm_module (shared)

 

      做了一个Linux学习的平台,目前出来一个雏形,各位可以参考使用

      链接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ  密码:n7bk 


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29270124/viewspace-2643990/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
多年物联网讲师经验,曾任职于达内、华清等公司。擅长Linux、c、java、Android、单片机、ZigBee、BLE等领域

注册时间:2018-10-21

  • 博文量
    266
  • 访问量
    383783