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

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

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

2 看所有可Load的模块

/usr/sbin/apachectl -t -D DUMP_MODULES

3 检查配置文件语法

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

4 启动apache

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

5 停止apache

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

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

Section 1: Global Environment

ServerTokens OS
#语法:ServerTokens Major | Minor | Min[imal] | Prod[uctOnly] | OS | Full
#默认:ServerTokens Full
#这个指令用来控制服务器回应给客户端的“Server:”应答头是否包含关于服务器操作系统类型和编译进的模块描述信息。
#注意:在使用ServerTokens指令时要先启用ServerSignature指令。 #apache软件安装的位置
ServerRoot "/etc/httpd" #主httpd进程(所有其他进程的父进程)的进程号文件位置
PidFile run/httpd.pid Timeout 60
#开启持久性连接功能。即当客户端连接到服务器,下载完数据后仍然保持连接状态
KeepAlive Off
#一个连接服务的最多请求次数
MaxKeepAliveRequests 100
#持续连接多长时间,该连接没有再请求数据,则断开该连接。缺省为15秒
KeepAliveTimeout 15 #多进程模式
# prefork MPM
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 4000
</IfModule>
#多进程多线程模式
# worker MPM
<IfModule worker.c>
StartServers 4
MaxClients 300
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule> #监听端口
Listen 8080 #加载模块
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_alias_module modules/mod_authn_alias.so #加载conf.d目录的配置模块
Include conf.d/*.conf # Section 2: 'Main' server configuration #apache运行的用户
User apache
Group apache #管理员的邮件地址
ServerAdmin root@localhost ServerName指定Apache用于识别自身的名字和端口号。
# 通常这个值是自动指定的,但是我们推荐你显式的指定它以防止启动时出错
#
# 如果你为你的主机指定了一个无效的DNS名,server-generated重定向将不能工作。
# 参见UseCanonicalName指令
#
# 如果你的主机没有注册DNS名,在这里键入它的IP地址
# 无论如何,你必须使用它的IP地址来提供服务,
# 这里使用一种容易理解的方式重定向服务
ServerName localhost:80 #
# UseCanonicalName:决定Apache如何构造URLS和 SERVER_NAME 和 SERVER_PORT 的指令。
# 当设置为 “Off”时,Apache会使用用户端提供的主机名和端口号。
# 当设置为“On”,Apache会使用ServerName指令的值。
#
UseCanonicalName Off #主站点的网页存储位置
DocumentRoot "/var/www/html" #错误日志文件
ErrorLog logs/error_log ServerSignature On #Section 3: Virtual Hosts
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</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. Microsoft SQL Server 2008 R2官方中文版(SQL2008下载).rar

    Microsoft SQL Server 2008 R2官方中文版(SQL2008下载).rar

  2. javascript数据结构与算法-- 二叉树

    javascript数据结构与算法-- 二叉树 树是计算机科学中经常用到的一种数据结构.树是一种非线性的数据结构,以分成的方式存储数据,树被用来存储具有层级关系的数据,比如文件系统的文件,树还被用来存 ...

  3. 大熊君JavaScript插件化开发------(实战篇之DXJ UI ------ Tab)

    一,开篇分析 Hi,大家好!大熊君又和大家见面了,还记得前两篇文章吗.主要讲述了以“jQuery的方式如何开发插件”,以及过程化设计与面向对象思想设计相结合的方式是 如何设计一个插件的,两种方式各有利 ...

  4. R语言:用简单的文本处理方法优化我们的读书体验

    博客总目录:http://www.cnblogs.com/weibaar/p/4507801.html 前言 延续之前的用R语言读琅琊榜小说,继续讲一下利用R语言做一些简单的文本处理.分词的事情.其实 ...

  5. Linux常用系统管理命令(top、free、kill、df)

    top   -c    #任务管理器 free  -m    #查看内存使用情况 kill  -9   2312 (说明:强制杀死进程 kill  -9  pid ) df   -h    #查看磁盘 ...

  6. maven项目打包成可执行的jar

    编写功能类: package com.hpay.FileToZkUtil; import java.io.File; import java.io.FileInputStream; import ja ...

  7. access日期与sql server日期区别

    如选取一段时间内的数据,time1和time2是时间起始字符串,则 sql server命令: string strSQL=" 日期 >='"+time1+"' A ...

  8. 家庭路由器设置以及win10链接无线不显示登录密码 直接提示链接出错问题解决

    家庭路由器设置 网线插入WAN口,用网客户端接在LAN口,就是路由器模式 LAN→WAN设置:电脑→第二个路由器LAN→进入设置界面: 网络参数→WAN口设置→WAN口连接类型→动态IP→保存. 网络 ...

  9. vim编辑技巧

    算上大学上课linux接触四年了,可惜除了工作接触的那些,其他地方还是很水的,都不精通,今日翻来看了看以前过目即忘的vim技巧,发现,如无几年操作经验,这些技巧很难领悟的.这里写下来,以备后查. 区块 ...

  10. VC++ 实现简单的桌面截图

    使用了EasyX图像库,使用方法请参考:VC++ 制作一个简易的控制台时钟应用 简单的桌面截图代码: ///////////////////////////////////////////////// ...