zoukankan      html  css  js  c++  java
  • Linux Apache httpd服务常用命令

    Linux系统Apache httpd常用命令

    1.查看Apache版本:

    # httpd -v
    [root@xxxx ~]# httpd -v
    Server version: Apache/2.4.6 (CentOS)
    Server built:   Jun 27 2018 13:48:59

    2.查看Apache服务运行状态:

    # service httpd status

    3.查看Apache httpd进程:

    # ps -ef | grep httpd

    4.查看Apache服务信息:

    # httpd -s
    [root@xxxx httpd]#  httpd -S
    [Thu Nov 29 10:24:42.110575 2018] [so:warn] [pid 4918] AH01574: module dav_svn_module is already loaded, skipping
    [Thu Nov 29 10:24:42.110667 2018] [so:warn] [pid 4918] AH01574: module authz_svn_module is already loaded, skipping
    AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.1.56.5. Set the 'ServerName' directive globally to suppress this message
    VirtualHost configuration:
    ServerRoot: "/etc/httpd"
    Main DocumentRoot: "/var/www/html"
    Main ErrorLog: "/etc/httpd/logs/error_log"
    Mutex proxy: using_defaults
    Mutex authn-socache: using_defaults
    Mutex default: dir="/run/httpd/" mechanism=default 
    Mutex mpm-accept: using_defaults
    Mutex authdigest-opaque: using_defaults
    Mutex proxy-balancer-shm: using_defaults
    Mutex rewrite-map: using_defaults
    Mutex authdigest-client: using_defaults
    PidFile: "/run/httpd/httpd.pid"
    Define: _RH_HAS_HTTPPROTOCOLOPTIONS
    Define: DUMP_VHOSTS
    Define: DUMP_RUN_CFG
    User: name="apache" id=48
    Group: name="apache" id=48

    5.启动Apache服务:

    一般apache服务启动的命令:

    # service httpd start

    如果你的Apache服务是独立安装的,或者安装在其他地方的,这里假设安装目录:“/usr/local/apache-httpd/”,可以去到安装目录启动,命令:

    # /usr/local/apache-httpd/bin/apachectl start

    还有一种,启动服务时指定使用某个配置文件,命令如下:

    # apachectl -f /etc/httpd/httpd.conf 

    6.停止Apache服务:

    # service httpd stop

    去到指定安装目录停止命令:

    # /usr/local/apache-httpd/bin/apachectl stop

    7.重启Apache服务:

    # service httpd restart

    同上,去到指定安装目录重启命令:

    # /usr/local/apache-httpd/bin/apachectl restart 
  • 相关阅读:
    通过欧拉计划学Rust编程(第500题)
    通过欧拉计划学Rust编程(第54题)
    刷完欧拉计划中难度系数为5%的所有63道题,我学会了Rust中的哪些知识点?
    用欧拉计划学Rust编程(第26题)
    通过欧拉计划学习Rust编程(第22~25题)
    用欧拉计划学Rust语言(第17~21题)
    用欧拉计划学习Rust编程(第13~16题)
    用欧拉计划学Rust语言(第7~12题)
    通过欧拉计划学Rust(第1~6题)
    《区块链生存训练2.0》PDF
  • 原文地址:https://www.cnblogs.com/oablog/p/Apache.html
Copyright © 2011-2022 走看看