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的模块所在位置

  • 相关阅读:
    手机怎么知道5G基站的存在?(小区搜索和SSB简介)
    Python中*args,**kwargs两个参数的作用?
    python之jupyter的安装
    国内安装python库速度慢的解决办法
    MOSFET:金属-氧化物半导体场效应晶体管
    C# 小知识点汇总
    ajax和form和七个中间件
    BBS功能分析
    MVC和MTV
    自关联和auth模块
  • 原文地址:https://www.cnblogs.com/wsybky/p/8469825.html
Copyright © 2011-2022 走看看