基本的操作方法
本文假设你的apahce安装目录为/usr/local/apache2,这些方法适合任何情况
#/usr/local/apache2/bin/apachectl start apaceh ##apache启动
#/usr/local/apache2/bin/apachectl stop ##apache停止
#/usr/local/apache2/bin/apachectl restart ##apache重启
#/usr/local/sbin/apachectl graceful ##apache重启服务器时不中断当前的连接
如果apache安装成为linux的服务的话,可以用以下命令操作:
#service httpd start 启动
#service httpd restart 重新启动
#service httpd stop 停止服务
Linux系统为Ubuntu
Start Apache 2 Server /启动apache服务
# /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start
Restart Apache 2 Server /重启apache服务
# /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart
Stop Apache 2 Server /停止apache服务
# /etc/init.d/apache2 stop
or
$ sudo /etc/init.d/apache2 stop