分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

Linux Apache httpd服务常用命令

发布时间:2023-09-06 02:24责任编辑:蔡小小关键词:httpLinux

Linux系统Apache httpd常用命令

1.查看Apache版本:

# httpd -v
[root@xxxx ~]# httpd -vServer 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, skippingAH00558: 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 messageVirtualHost configuration:ServerRoot: "/etc/httpd"Main DocumentRoot: "/var/www/html"Main ErrorLog: "/etc/httpd/logs/error_log"Mutex proxy: using_defaultsMutex authn-socache: using_defaultsMutex default: dir="/run/httpd/" mechanism=default Mutex mpm-accept: using_defaultsMutex authdigest-opaque: using_defaultsMutex proxy-balancer-shm: using_defaultsMutex rewrite-map: using_defaultsMutex authdigest-client: using_defaultsPidFile: "/run/httpd/httpd.pid"Define: _RH_HAS_HTTPPROTOCOLOPTIONSDefine: DUMP_VHOSTSDefine: DUMP_RUN_CFGUser: name="apache" id=48Group: 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 

Linux Apache httpd服务常用命令

原文地址:https://www.cnblogs.com/oablog/p/Apache.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved