常用指令:/usr/local/apache-httpd

启动:

service httpd start
/usr/local/apache-httpd/bin/apachectl start

重启;

service httpd restart
/usr/local/apache-httpd/bin/apachectl restart 

停止

service httpd stop
/usr/local/apache-httpd/bin/apachectl stop

查看版本

httpd -v

查看运行状态:

service httpd status
查看Apache httpd进程:
ps -ef | grep httpd

查看服务信息:

httpd -S

常用命令:/usr/local/apache2

本文假设你的apahce安装目录为/usr/local/apache2,这些方法适合任何情况
apahce启动命令:

/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  

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