zoukankan      html  css  js  c++  java
  • Apache 安装卸载等基本命令以及Apache文件结构

    一、win下的基本命令(cmd中,Apache安装目录下执行):
      安装服务:httpd -k install -n 服务名称
      卸载服务:sc delete 服务名称
      启动服务:httpd start
      重启服务:httpd restart
      停止服务:httpd -k shutdwn


    二、linux系统环境下的命令:
      1、Start Apache 2 Server /启动apache服务
        # /etc/init.d/apache2 start
        or
        $ sudo /etc/init.d/apache2 start

      2、 Restart Apache 2 Server /重启apache服务
        # /etc/init.d/apache2 restart
        or
        $ sudo /etc/init.d/apache2 restart

      3、Stop Apache 2 Server /停止apache服务
        # /etc/init.d/apache2 stop
        or
        $ sudo /etc/init.d/apache2 stop

    三、Apache的一些基本配置:

      服务都需要监听一个端口,例如:mysql(3306)、oracle(1521)、mssql(1433)、ftp(21)、ssh(22)
      apache 这个web服务默认在80端口监听...

      端口(port):
        1.一台机器可以有 1~65535 号端口
        2.在实际开发中,我们经常使用
          netstat –an 
          netstat –anb 

        来查看机器有哪些端口在监听,如果发现有异常端口监听,则可以关闭该端口,
        通过改命令我们可以发现是哪个程序在监听该端口,从而关闭。

        3.一台的80端口被 apache 监听,则该端口不能再被其他的应用程序监听. (一个端口只能被一个程序监听)。
        4.端口分为有名端口 1-1024 号 ,其它端口可以自己分配。

     

      apache如何去配置端口
        apache软件 配置是在 httpd.conf 文件中配置,该文件在apache安装目录下的 conf
        在 httpd.conf 文件中我们修改端口: Listen 81
        注:修改完后,一定要重新启动apache

    四、Apache包文件结构:
      bin : 可执行文件所在文件夹
      conf : apache配置文件
      htdocs : 初始站点文件夹
      moduls : apache的模块所在位置

  • 相关阅读:
    结对项目刘畅2016012040
    Daily target小队介绍(刘畅,陈杰,杨有存,唐祎琳,王晓哲,邵汝佳)
    第四、十七章读书报告
    2016012040+小学四则运算练习软件项目报告
    JAVA之路(二)
    使用pip命令可能遇到的报错
    monkey命令
    Mitmproxy 手机配置代理
    appium安装与简单使用
    自动化测试第十一节---unittest
  • 原文地址:https://www.cnblogs.com/wsybky/p/8469825.html
Copyright © 2011-2022 走看看