sudo apachectl stop

apachectl是Apache超文本传输协议服务器的前端程序。 其设计意图是帮助管理员控制Apachehttpd后台的功能。





MacOS中安装完Apache之后,在/usr/sbin/目录下有apachectl和httpd两个文件





apachectl是一个shell脚本,是用来开启关闭重启apache服务的,在脚本里面是执行了/usr/sbin/httpd命令的(可能每个人安装的apache目录不一样),而httpd是apache的daemon,也就是守护进程。执行了apachectl start命令后,会开启两个httpd的进程(父子关系),可以用top命令查看。会发现在命令行下用kill命令杀死其中一个时,再top查看又会出现两个httpd,只是PID变了,也就是说当你kill掉httpd后,系统又立马生成两个httpd进程,用命令apachctl
stop后,top之后这两个httpd就不存在了,也证明了apachectl start开启了这连个httpd daemon,apache就是用这两个httpd来提供服务的。





守护进程是指在UNIX或其他多任务操作系统中在后台执行的电脑程序,并不会接受电脑用户的直接操控。此类程序会被以进程的形式初始化。守护进程程序的名称通常以字母“d”结尾:例如,syslogd就是指管理系统日志的守护进程。 通常,守护进程没有任何存在的父进程,且在UNIX系统进程层级中直接位于init之下。守护进程程序通常通过如下方法使自己成为守护进程:对一个子进程调用fork,然后使其父进程立即终止,使得这个子进程能在init下运行。这种方法通常被称为“脱壳”。 系统通常在启动时一同起动守护进程。 ...





/usr 的由来及/usr目录结构

在 linux 文件结构中,有一个很神奇的目录 —— /usr。之前一直没有怎么关注过它,反正程序都是安装在里边的,也没有什么值得追根溯源的东西。直到有一天 fedora 要简化整个文件系统体系,看到讨论才想到,usr 到底是什么的缩写呢,它又是怎么来的呢?





usr 是 unix system resources 的缩写;

usr 是 user 的缩写;

usr 是 unix software resources 的缩写。

根据常识判断,是 user 缩写的可能性不大,因为和 /home 冲突了嘛。不过是 system resources 还是 software resources 的缩写还真不好说。特此查了好多东西,却发现竟然连 wikipedia 也模棱两可。

后来终于找到了 相关的文档和介绍。(via,cache)

/usr usually contains by far the largest share of data on a system. Hence, this is one of the most important directories in the system as it contains all the user binaries, their documentation, libraries, header files, etc…. X and its supporting libraries can
be found here. User programs like telnet, ftp, etc…. are also placed here. In the original Unix implementations, /usr was where the home directories of the users were placed (that is to say, /usr/someone was then the directory now known as /home/someone).
In current Unices, /usr is where user-land programs and data (as opposed to ’system land’ programs and data) are. The name hasn’t changed, but it’s meaning has narrowed and lengthened from “everything user related” to “user usable programs and data”. As such,
some people may now refer to this directory as meaning ‘User System Resources’ and not ‘user’ as was originally intended.(via 1,2)

/usr 是系统核心所在,包含了所有的共享文件。它是 unix 系统中最重要的目录之一,涵盖了二进制文件,各种文档,各种头文件,x,还有各种库文件;还有诸多程序,例如 ftp,telnet 等等。

曾经的 /usr 还是用户的家目录,存放着各种用户文件 —— 现在已经被 /home 取代了(例如 /usr/someone 已经改为 /home/someone)。现代的 /usr 只专门存放各种程序和数据,用户目录已经转移。虽然  /usr 名称未改,不过其含义已经从“用户目录”变成了“unix 系统资源”目录。值得注意的是,在一些 unix 系统上,仍然把 /usr/someone 当做用户家目录,如 Minix。

至此,真相大白。看来就像前一阵子的 /var/run 移到 /run 一样。

真的是不看不知道,一看吓一跳呀。原来 linux 几经进化,好多目录的诞生和用途已经产生了根本的变化。历史车轮在前进,长江后浪推前浪,正所谓:学习历史,收获真知;尽心竭力,前进不止。

附录:/usr 目录结构

/usr/bin : 所有可执行文件,如 gcc,firefox 等(指不包含在 /sbin 和 /bin 内的);

/usr/include : 各种头文件,编译文件等时需要使用;

/usr/include/’package-name’ : 程序特定的头文件;

/usr/lib : 所以可执行文件所需要的库文件;

/usr/local : /usr 通常只包含系统发行时自带的程序,而 /usr/local 则是本地系统管理员用来自由添加程序的目录;

/usr/X11R6 : x 系统的二进制文件,库文件,文档,字体等。它不等同于 /usr 的作用,只有 x 才能调用这些库文件等,其他程序不读取或者使用。因为 linux 没有原生图形界面,而且 linux 大部分情况下是 for server 的,所以图形界面没有意义;其中 X11R6 代表 version 11 release 6;

/usr/X11R6/bin : x 的二进制文件,包含运行 x 的必须文件;

/usr/X11R6/include : x 相关的头文件;

/usr/X11R6/lib : x 库文件;

/usr/X11R6/lib/modules : x 的模块,启动时加载。缺少 video4linux, DRI and GLX 和 输入输出设备 模块,将工作不正常;

/usr/X11R6/lib/X11/fonts : x font server 的字体文件;

/usr/doc : 文档。实际是 /usr/share/doc 的软链接;

/usr/etc : 一个极少用到的配置文件存放地;

/usr/games : 曾经包含游戏等文件,现在很少用到;

/usr/info : 系统相关信息,是 /usr/share/info 的软链接;

/usr/man : man 手册,已经移至 /usr/share/man;

/usr/sbin : 类似 /sbin,root 可以执行。但此目录不包含在环境变量 $PATH 中,它包含的程序类似于 chroot, useradd, in.tftpd and pppconfig;

/usr/share : 它包含了各种程序间的共享文件,如字体,图标,文档等。(/usr/local 对应的目录是  /usr/loca/share);

/usr/share/doc : 类似应用程序的 man 手册。它包含程序的说明文件,默认配置文件等;

/usr/share/info : 不常用,已经被 man 代替;

/usr/share/man : app 的 manual;

/usr/share/icons : 应用程序的图标等文件,分为 png,svg 等多种格式;

/usr/share/fonts : 字体文件,系统范围内可使用,~/.fonts 仅当前用户可用;

/usr/src : linux 内核的源码和说明文档等;

/usr/src/linux : linux 源代码;

/usr/src/linux/.config : 内核编译过程产生的文件;通常由命令 ‘make config’ , ‘make menuconfig’ 或 ‘make xconfig’ 执行后产生;

/usr/src/linux/.depend, /usr/src/linux/.hdepend : ‘make dep’ 检测编译依赖时需要的文件,由 /usr/src/linux/.config 产生;

/usr/src/linux/COPYING : GNU license;

/usr/src/linux/Makefile : 编译内核所需的 Makefile;

/usr/src/linux/Rules.make : 当有多个 Makefile 时,根据它的规则执行 make;

/usr/tmp : 已经被众多发行版抛弃的临时文件夹。

版权声明:本文为博主原创文章,未经博主允许不得转载。

XAMPP 1.8.2-2 Apache Web Server won't start, always stops immediately的更多相关文章

  1. Using Apache Web Server with Jboss AS 7

    In real-world projects, it's common to find Apache web server as a front door to your application se ...

  2. Django部署到Apache Web Server

    Windows环境下,将Django部署到Apache Web Server 在Windows上部署Django(用mod_wsgi)会出现各种奇怪的问题,现简单记录下配置过程及遇到的错误及解决方法. ...

  3. 解决Apache Web Server的几个错误

    一.安装好Apache后服务里没有Apache服务 在命令行进入安装apache的bin目录下,输入命令 httpd.exe -k install -n Apache2.4 二.Apache web ...

  4. yum安装Apache Web Server后各个文件存放位置

    yum安装Apache Web Server后各个文件存放位置   用yum安装apache软件: yum -y install httpd 安装完成后,来查看理解yum安装软件的过程和安装路径.   ...

  5. kill 挂起 Apache Web Server

    [root@hadoop1 ~]# kill -l 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8 ...

  6. 禁掉Apache web server签名 How to turn off server signature on Apache web server

    有的时候,我们为了从安全角度考虑,防止黑客恶意攻击.我们会隐藏掉server信息,比方,一般我们会发现例如以下信息. 我用的是centos (fedora, RHEL也一样) $ sudo vi /e ...

  7. Windows环境下,将Django部署到Apache Web Server

    在Windows上部署Django(用mod_wsgi)会出现各种奇怪的问题,现简单记录下配置过程及遇到的错误及解决方法. 环境搭建                                   ...

  8. What is the difference Apache (Http Server) and Tomcat (Servlet Container)

    The Apache Project The Apache Project is a collaborative software development effort. Its goal is to ...

  9. 持续集成之二:搭建SVN服务器--Apache HTTP Server安装

    安装环境 Red Hat Enterprise Linux Server release 7.3 (Maipo) jdk1.7.0_80 httpd-2.4.35.tar.gz apr-1.6.5.t ...

随机推荐

  1. Til the Cows Come Home 最短路Dijkstra+bellman(普通+优化)

    Til the Cows Come Home 最短路Dijkstra+bellman(普通+优化) 贝西在田里,想在农夫约翰叫醒她早上挤奶之前回到谷仓尽可能多地睡一觉.贝西需要她的美梦,所以她想尽快回 ...

  2. Head First PHP&MySQl第四章代码

    addemail.php <!DOCTYPE html> <html lang="cn" dir="ltr"> <head> ...

  3. redis 字符串 数据类型

    1 字符串 设置:   set    key  value   获取:  get  key    删除:  del   key getrange   key    0 3    截取字符串内容    ...

  4. PythonError解决方案

    # Pip Error pip install * error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visua ...

  5. OCR(光学字符识别)技术简介

    OCR技术起源 OCR最早的概念是由德国人Tausheck最先提出的,1966年他们发表了第一篇关于汉字识别的文章,采用了模板匹配法识别了1000个印刷体汉字.早在60.70年代,世界各国就开始有OC ...

  6. python3小demo

    总结常用的功能小实例,快速学习并掌握python技能 1.墨迹天气 import requests from lxml.html import etree import json import tim ...

  7. vue——echarts更换主题

    链接:https://blog.csdn.net/Sunshine0508/article/details/90067437 //等配置安装好了以后 在main.js里引入echarts主题的js,一 ...

  8. python接口测试—mysql数据库操作

    python操作mysql数据库 1.安装pymysql库 在python中安装pymysql第三方库,通过pip install pymysql 命令进行安装. 2.python操作mysql数据库 ...

  9. Java读取二进制文件的方式

    public static void readFile(String fileName){ File file = new File(fileName); if(file.exists()){ try ...

  10. docker 安装与使用的相关问题

    Error response from daemon: i/o timeout $ sudo docker search centos Error response from daemon: Get ...