【问题标题】:Apache2 restart failed on ubuntuubuntu 上的 Apache2 重启失败
【发布时间】:2015-01-25 16:48:20
【问题描述】:

当我尝试从 ubuntu 重新启动 apache 服务器时,它显示为失败... 我输入了命令, $service apache2 重启

它显示,

  • 重新启动 Web 服务器 apache2 [失败]

当我签入日志文件时,在 var/apache2/errorlog 中提供的描述是,

[mpm_prefork:notice] [pid 1263] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.5 已配置——恢复正常运行

【问题讨论】:

    标签: ubuntu apache2


    【解决方案1】:

    很可能是你运行命令时没有使用sudo,试试:

    sudo service apache2 restart
    

    【讨论】:

      【解决方案2】:
      1. 在 linux/ubuntu 上我们可以重启 appache 服务器:-

        sudo service apache2 restart
        
      2. 换一种方式

        sudo service apache2 reload
        

      【讨论】:

        【解决方案3】:

        Debian/Ubuntu Linux 特定命令 您可以在 Debian Linux 版本 7.x 或 Ubuntu Linux 版本 Ubuntu 14.10 或更早版本上使用 service 或 /etc/init.d/ 命令,如下所示:

        重启 Apache 2 网络服务器,输入:

        # /etc/init.d/apache2 restart
        

        $ sudo /etc/init.d/apache2 restart
        

        $ sudo service apache2 restart
        

        要停止 Apache 2 Web 服务器,请输入:

        # /etc/init.d/apache2 stop
        

        $ sudo /etc/init.d/apache2 stop
        

        $ sudo service apache2 stop
        

        要启动 Apache 2 Web 服务器,请输入:

        # /etc/init.d/apache2 start
        

        $ sudo /etc/init.d/apache2 start
        

        $ sudo service apache2 start
        

        关于 Debian/Ubuntu Linux systemd 用户的说明 在 Debian Linux 版本 8.x+ 或 Ubuntu Linux 版本 Ubuntu 15.04+ 或更高版本上使用以下命令:

        启动命令

        systemctl start apache2.service
        

        停止命令

        systemctl stop apache2.service
        

        重启命令

        systemctl restart apache2.service
        

        CentOS/RHEL (Red Hat) Linux 版本 4.x/5.x/6.x 或更旧的特定命令

        开始

        service httpd start
        

        停止

        service httpd stop
        

        重启

        service httpd restart
        

        CentOS/RHEL (Red Hat) Linux 版本 7.x 或更新的特定命令 大多数现代发行版现在使用 systemd,因此您需要使用以下命令:

        启动命令

        systemctl start httpd.service
        

        停止命令

        systemctl stop httpd.service
        

        重启命令

        systemctl restart httpd.service
        

        在 Linux/Unix 上启动/停止/重新启动 Apache 的通用方法 语法如下(必须以root用户运行):

        停下来

        apachectl -k stop
        

        重启

        apachectl -k restart
        

        优雅重启吧

        apachectl -k graceful
        

        开始

        apachectl -f /path/to/your/httpd.conf
        apachectl -f /usr/local/apache2/conf/httpd.conf
        

        如果其他服务占用了80端口(例如:Skype),

        试试代码:

        sudo /etc/init.d/apache2 stop
        

        后跟代码:

        sudo killall apache2
        

        然后确保没有服务在端口 80 上运行代码:

        sudo netstat -l|grep www
        

        然后(重新)启动 apache 代码:

        sudo /etc/init.d/apache2 restart
        

        【讨论】:

          【解决方案4】:

          尝试停止 apache 服务器并重新启动。 在 ubuntu 终端输入命令

          sudo apachectl stop
          

          然后再次启动apache服务器

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 2014-10-12
            • 1970-01-01
            • 2012-08-01
            • 1970-01-01
            • 2019-08-20
            • 1970-01-01
            • 2013-10-26
            相关资源
            最近更新 更多