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

  • 相关阅读:
    解决安装Visual Studio 2012后SQL Server 2008 远程过程调用失败的问题
    解决 Visual Studio 2012 有时不能调试的问题
    WPF实现窗体最小化后小图标在右边任务栏下
    WinForm实现窗体最小化后小图标在右边任务栏下
    C# 开机启动代码
    C# ?? 操作符示例
    WPS页面设置
    PCA(主成分分析)和LDA详解
    MySQL命令行导入sql文件时出现乱码解决方案
    IKAnalyzer 独立使用 配置扩展词典
  • 原文地址:https://www.cnblogs.com/wsybky/p/8469825.html
Copyright © 2011-2022 走看看