sudo apache2停止不起作用

时间:2012-02-26 19:00:52

标签: django ubuntu apache2 amazon-web-services

不确定为什么,但是当我跑步时:

ubuntu@ip-10-46-206-16:/etc/init.d$ sudo apache2 stop
Usage: apache2 [-D name] [-d directory] [-f file]
               [-C "directive"] [-c "directive"]
               [-k start|restart|graceful|graceful-stop|stop]
               [-v] [-V] [-h] [-l] [-L] [-t] [-S] [-X]
Options:
  -D name            : define a name for use in <IfDefine name> directives
  -d directory       : specify an alternate initial ServerRoot
  -f file            : specify an alternate ServerConfigFile
  -C "directive"     : process directive before reading config files
  -c "directive"     : process directive after reading config files
  -e level           : show startup errors of level (see LogLevel)
  -E file            : log startup errors to file
  -v                 : show version number
  -V                 : show compile settings
  -h                 : list available command line options (this page)
  -l                 : list compiled in modules
  -L                 : list available configuration directives
  -t -D DUMP_VHOSTS  : show parsed settings (currently only vhost settings)
  -S                 : a synonym for -t -D DUMP_VHOSTS
  -t -D DUMP_MODULES : show all loaded modules 
  -M                 : a synonym for -t -D DUMP_MODULES
  -t                 : run syntax check for config files
  -X                 : debug mode (only one worker, do not detach)

它似乎没有停止服务器。我仍然试图ping ip并返回默认页面。有原因吗?

5 个答案:

答案 0 :(得分:1)

这不是编程问题。我想你必须在http://serverfault.com

寻找答案

答案 1 :(得分:1)

尝试:

 sudo service apache2 stop

见这里:

旧的方式是:

sudo /etc/init.d/apache2 stop

请注意,执行sudo apache2 stop时,您正在从PATH运行apache2,而不是从当前文件夹运行(通常,.不在PATH中)。请尝试sudo ./apache2 stop

见这里:

答案 2 :(得分:0)

您必须输入apache2 init脚本的完整路径。例如:

sudo /etc/init.d/apache2 stop

答案 3 :(得分:0)

检查ubuntu @ ip-10-46-206-16:/etc/init.d$ ./apache2 stop

这将解决你的问题

答案 4 :(得分:0)

命令中缺少一件事,我遇到了同样的问题:

sudo apache2 stop

应该是

sudo service apache2 stop

希望没有人能够找到缺少服务命令的部分:)

相关问题