1. [root@limt modules]# /usr/sbin/apachectl -h
  2. Usage: /usr/sbin/httpd [-D name] [-d directory] [-f file]
  3. [-C "directive"] [-c "directive"]
  4. [-k start|restart|graceful|graceful-stop|stop]
  5. [-v] [-V] [-h] [-l] [-L] [-t] [-S]
  6. Options:
  7. -D name : define a name for use in <IfDefine name> directives
  8. -d directory : specify an alternate initial ServerRoot
  9. -f file : specify an alternate ServerConfigFile
  10. -C "directive" : process directive before reading config files
  11. -c "directive" : process directive after reading config files
  12. -e level : show startup errors of level (see LogLevel)
  13. -E file : log startup errors to file
  14. -v : show version number
  15. -V : show compile settings
  16. -h : list available command line options (this page)
  17. -l : list compiled in modules
  18. -L : list available configuration directives
  19. -t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
  20. -S : a synonym for -t -D DUMP_VHOSTS
  21. -t -D DUMP_MODULES : show all loaded modules
  22. -M : a synonym for -t -D DUMP_MODULES
  23. -t : run syntax check for config files

1 查看apache编译时加载的模块

  1. [root@limt modules]# /usr/sbin/apachectl -l
  2. Compiled in modules:
  3. core.c
  4. prefork.c #采用的多进程模式
  5. http_core.c
  6. mod_so.c

2 看所有可Load的模块

  1. /usr/sbin/apachectl -t -D DUMP_MODULES

3 检查配置文件语法

  1. [root@limt modules]# /usr/sbin/apachectl -t -f /etc/httpd/conf/httpd.conf
  2. httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.104 for ServerName
  3. Syntax OK

4 启动apache

  1. [root@limt modules]# /usr/sbin/apachectl -k start -f /etc/httpd/conf/httpd.conf
  2. httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.104 for ServerName
  3. [root@limt modules]# ps -ef|grep http
  4. root 6011 1 0 04:26 pts/0 00:00:00 /usr/sbin/nss_pcache 294914 off /etc/httpd/alias
  5. root 6013 1 4 04:26 ? 00:00:00 /usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
  6. root 6015 6013 0 04:26 ? 00:00:00 /usr/bin/crlhelper 327684 6013 /etc/httpd/alias
  7. apache 6016 6013 0 04:26 ? 00:00:00 /usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
  8. apache 6017 6013 3 04:26 ? 00:00:00 /usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
  9. apache 6018 6013 2 04:26 ? 00:00:00 /usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
  10. apache 6019 6013 2 04:26 ? 00:00:00 /usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
  11. apache 6020 6013 2 04:26 ? 00:00:00 /usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
  12. apache 6021 6013 3 04:26 ? 00:00:00 /usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
  13. apache 6022 6013 3 04:26 ? 00:00:00 /usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
  14. apache 6023 6013 3 04:26 ? 00:00:00 /usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
  15. apache 6024 6013 4 04:26 ? 00:00:00 /usr/sbin/httpd -k start -f /etc/httpd/conf/httpd.conf
  16. root 6026 4496 0 04:27 pts/0 00:00:00 grep http

5 停止apache

  1. [root@limt modules]# /usr/sbin/apachectl -k stop
  2. httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.1.104 for ServerName
  3. [root@limt modules]#
  4. [root@limt modules]# ps -ef|grep http
  5. root 6039 4496 0 04:28 pts/0 00:00:00 grep http

6 配置文件:/etc/httpd/conf/httpd.conf

  1. Section 1: Global Environment
  2.  
  3. ServerTokens OS
  4. #语法:ServerTokens Major | Minor | Min[imal] | Prod[uctOnly] | OS | Full
  5. #默认:ServerTokens Full
  6. #这个指令用来控制服务器回应给客户端的“Server:”应答头是否包含关于服务器操作系统类型和编译进的模块描述信息。
  7. #注意:在使用ServerTokens指令时要先启用ServerSignature指令。
  8.  
  9. #apache软件安装的位置
  10. ServerRoot "/etc/httpd"
  11.  
  12. #主httpd进程(所有其他进程的父进程)的进程号文件位置
  13. PidFile run/httpd.pid
  14.  
  15. Timeout 60
  16. #开启持久性连接功能。即当客户端连接到服务器,下载完数据后仍然保持连接状态
  17. KeepAlive Off
  18. #一个连接服务的最多请求次数
  19. MaxKeepAliveRequests 100
  20. #持续连接多长时间,该连接没有再请求数据,则断开该连接。缺省为15秒
  21. KeepAliveTimeout 15
  22.  
  23. #多进程模式
  24. # prefork MPM
  25. <IfModule prefork.c>
  26. StartServers 8
  27. MinSpareServers 5
  28. MaxSpareServers 20
  29. ServerLimit 256
  30. MaxClients 256
  31. MaxRequestsPerChild 4000
  32. </IfModule>
  33. #多进程多线程模式
  34. # worker MPM
  35. <IfModule worker.c>
  36. StartServers 4
  37. MaxClients 300
  38. MinSpareThreads 25
  39. MaxSpareThreads 75
  40. ThreadsPerChild 25
  41. MaxRequestsPerChild 0
  42. </IfModule>
  43.  
  44. #监听端口
  45. Listen 8080
  46.  
  47. #加载模块
  48. LoadModule auth_basic_module modules/mod_auth_basic.so
  49. LoadModule auth_digest_module modules/mod_auth_digest.so
  50. LoadModule authn_file_module modules/mod_authn_file.so
  51. LoadModule authn_alias_module modules/mod_authn_alias.so
  52.  
  53. #加载conf.d目录的配置模块
  54. Include conf.d/*.conf
  55.  
  56. # Section 2: 'Main' server configuration
  57.  
  58. #apache运行的用户
  59. User apache
  60. Group apache
  61.  
  62. #管理员的邮件地址
  63. ServerAdmin root@localhost
  64.  
  65. ServerName指定Apache用于识别自身的名字和端口号。
  66. # 通常这个值是自动指定的,但是我们推荐你显式的指定它以防止启动时出错
  67. #
  68. # 如果你为你的主机指定了一个无效的DNS名,server-generated重定向将不能工作。
  69. # 参见UseCanonicalName指令
  70. #
  71. # 如果你的主机没有注册DNS名,在这里键入它的IP地址
  72. # 无论如何,你必须使用它的IP地址来提供服务,
  73. # 这里使用一种容易理解的方式重定向服务
  74. ServerName localhost:80
  75.  
  76. #
  77. # UseCanonicalName:决定Apache如何构造URLS和 SERVER_NAME 和 SERVER_PORT 的指令。
  78. # 当设置为 “Off”时,Apache会使用用户端提供的主机名和端口号。
  79. # 当设置为“On”,Apache会使用ServerName指令的值。
  80. #
  81. UseCanonicalName Off
  82.  
  83. #主站点的网页存储位置
  84. DocumentRoot "/var/www/html"
  85.  
  86. #错误日志文件
  87. ErrorLog logs/error_log
  88.  
  89. ServerSignature On
  90.  
  91. #Section 3: Virtual Hosts
  92. #<VirtualHost *:80>
  93. # ServerAdmin webmaster@dummy-host.example.com
  94. # DocumentRoot /www/docs/dummy-host.example.com
  95. # ServerName dummy-host.example.com
  96. # ErrorLog logs/dummy-host.example.com-error_log
  97. # CustomLog logs/dummy-host.example.com-access_log common
  98. #</VirtualHost>

apace日常操作和配置的更多相关文章

  1. Nginx日常操作和配置

    安装位置:/usr/local/nginx配置目录:/usr/local/nginx/conf配置文件:/usr/local/nginx/conf/nginx.conf启动命令:/usr/local/ ...

  2. ORACLE日常操作手册

    转发自:http://blog.csdn.net/lichangzai/article/details/7955766 以前为开发人员编写的oracle基础操作手册,都基本的oracle操作和SQL语 ...

  3. Oracle 11g 物理Dataguard日常操作维护(二)

    Oracle 11g 物理Dataguard日常操作维护(二) 2017年8月25日 14:34 3.3 3.3.1 查看备库进程状态 SYS(125_7)@fpyj123> select pr ...

  4. redis日常操作

    redis针对所有类型的日常操作: keys * ## 取出所有key keys my* ## 模糊匹配 exists name ## 存在name键返回1,否则返回0 del key1 ## 删除一 ...

  5. kvm虚拟化学习笔记(四)之kvm虚拟机日常管理与配置

    KVM虚拟化学习笔记系列文章列表----------------------------------------kvm虚拟化学习笔记(一)之kvm虚拟化环境安装http://koumm.blog.51 ...

  6. 从零开始使用git第二篇:git的日常操作

    从零开始使用git 第二篇:git的日常操作 第一篇:从零开始使用git第一篇:下载安装配置 第二篇:从零开始使用git第二篇:git实践操作 第三篇:从零开始使用git第三篇:git撤销操作.分支操 ...

  7. LINUX日常操作二

    参见:Linux日常操作一  selinux 开启和关闭 一.查看SELinux状态:1./usr/sbin/sestatus -v      ##如果SELinux status参数为enabled ...

  8. OpenStack-Ocata版+CentOS7.6 云平台环境搭建 — 1.操作系统环境配置

    1.OpenStack示例的架构介绍 1.1 各节点介绍 (1)控制节点(controller)控制节点(controller)上运行身份服务,镜像服务,计算节点管理,网络管理,各种网络代理和仪表板. ...

  9. 【RAC】 RAC For W2K8R2 安装--操作系统环境配置 (二)

    [RAC] RAC For W2K8R2 安装--操作系统环境配置 (二) 一.1  BLOG文档结构图 一.2  前言部分 一.2.1  导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可 ...

随机推荐

  1. Description Resource Path Location Type Java compiler level does not match the version of the instal

    解决办法 在项目上右键Properties->Project Facets,在打开的Project Facets页面中的Java下拉列表中,选择相应版本. 有可能是java1.6 改成java6 ...

  2. C语言基础(7)-float,double,long double类型

    1.定义方式 3.14这个就是一个浮点常量,3f是一个浮点类型的常量 float a;//定义了一个浮点类型的小数变量,名字叫a double b;//定义了一个double类型的变量,名字叫b lo ...

  3. 【09-14】eclipse学习笔记

    eclipse安装class文件反编译插件jadClipse /** 1. 下载JadClipse的jar包 2. 下载Jad反编译器 3. 将JarClipse jar包放到eclipse plug ...

  4. 基于MATLAB求解矩阵的正交补矩阵

    1.背景知识:LCMV波束形成器的维纳滤波器结构 2.MATLAB code: [m,n]=size(C); [Q,R]=qr(C); Ca=Q(:,n+1:m);

  5. Python 爬虫2

    import urllib.request import os import re import time 设置头文件 head={} head['User-Agent'] ='Mozilla/5.0 ...

  6. JSP动作元素之useBean、setProperty、getProperty指令

    简介 这三个指令都是与JavaBean相关的指令,其中useBean指令用于在JSP页面中初始化一个Java实例:setProperty指令用于为JavaBean实例的属性设置值:getPropert ...

  7. C语言运算符优先级 详细列表

    首先还是插入原博客的地址http://blog.csdn.net/huangblog/article/details/8271791 另外还有一个参考博客http://www.slyar.com/bl ...

  8. C和指针 第三章 习题

    在一个源文件中,有两个函数x和y,定义一个链接属性external储存类型static的变量a,且y可以访问,x不可以访问,该如何定义呢? #include <stdio.h> void ...

  9. word20161213

    journal queue / 日志队列 journal quota / 日志配额 junction point / 交叉点 KDC, Key Distribution Center / 密钥分发中心 ...

  10. Java连接mysql数据库并插入中文数据显示乱码

    连接数据库设置编码 jdbc:mysql://地址:3306/数据库名?characterEncoding=utf8