Welcome! 閮餃
蝢撖園 蝢撖嗥曄 蝢撖嗉憯 蝢撖嗉賣 蝢撖嗅啣

Advanced

Change History

Message: [HOW TO] Start, Restart, and Stop an Apache Web Server (3 Ways for Red Hat, Ubuntu, Debian, and SUSE)

Changed By: HP
Change Date: November 03, 2009 07:30PM

[HOW TO] Start, Restart, and Stop an Apache Web Server (3 Ways for Red Hat, Ubuntu, Debian, and SUSE)
There are mainly three kinds of ways to start/restart an Apache Server for different Linux distributions.

Taking <b>start</b> as a quick example, they are:
<code>
Shell>> /usr/local/apache2/bin/apachectl -k start (Red Hat)
Shell>> /usr/local/apache2/bin/httpd -k start (when you don't have apachectl in Red Hat)
Shell>> /etc/init.d/apache2 start (Ubuntu, Debian, SUSE)</code>

<b>NOTE:</b> The path of <b>apachectl</b> and <b>httpd</b> may differ from "/usr/local/apache2/bin/" depending on your installations and in some cases you don't even have to specify the patch.

<b>I. Use of apachectl</b> (Red Head)

Basically, it is easy to start/restart/stop an Apache web server by the commands

Shell>> apachectl -k start
Shell>> apachectl -k restart
Shell>> apachectl -k stop

to start, restart, stop your Apache server, respectively. Note you may need to specify the path to the apachectl command. For example, you may use

<b>Full path:</b>
Shell>> /usr/local/apache2/bin/apachectl -k restart

or

<b>Relative path:</b>
Shell>> bin/apachectl -k restart (when the console is in /usr/local/apache2/ in this case)

for restarting Apache.


Also, it is recommeded to use the parameter "graceful" to stop the sever after finishing serving all the HTTP requests while attempting the restart the sever. That is, we use

Shell>> apachectl -k graceful

to restart the Apache server.

<b>You may also note that in SUSE Linux, you can restart (or start) the server by the command:

Shell> /etc/init.d/apache2 restart</b>

<b>II. Use of httpd</b>

However, due to different versions of installation, sometimes <b>apachectl</b> simply doesn't work. Instead, you may use the command <b>httpd</b> (with a shell path specified). You may use

Shell>> ./bin/httpd -k restart

or

Shell>> ./bin/httpd -k graceful

to restart your Apache http daemon service.

<b>III. Use of apache2 (Ubuntu, Debian, SUSE)</b>

<code>Shell> /etc/init.d/apach2 start|restart|stop</code>

You may use the following command for restarting in Ubuntu:

<code>Shell> sudo /etc/init.d/apach2 start/restart/stop</code>

The Apache Official Documents for
1. <a href=http://httpd.apache.org/docs/2.2/stopping.html>Stopping and Restarting</a>
2. <a href=http://httpd.apache.org/docs/2.2/programs/apachectl.html>apachectl - Apache HTTP Server Control Interface</a>
3. <a href=http://httpd.apache.org/docs/2.2/programs/httpd.html>httpd - Apache Hypertext Transfer Protocol Server</a>
Changed By: HP
Change Date: November 03, 2009 07:27PM

[HOW TO] Start, Restart, and Stop an Apache Web Server (3 Ways for Red Hat, Ubuntu, Debian, and SUSE)
There are mainly three kinds of ways to start/restart an Apache Server for different Linux distributions.

Taking <b>start</b> as a quick example, they are:
<code>
Shell>> /usr/local/apache2/bin/apachectl -k start (Red Hat)
Shell>> /usr/local/apache2/bin/httpd (when you don't have apachectl in Red Hat)
Shell>> /etc/init.d/apache2 start (Ubuntu, Debian, SUSE)
</code>

Note the path of apachectl and httpd depends on your installation and in some install you don't have to specify the patch.
Shell>> /etc/init.d/apache2 start (Ubuntu, Debian, SUSE)</code>

<b>NOTE:</b> The path of <b>apachectl</b> and <b>httpd</b> may differ from "/usr/local/apache2/bin/" depending on your installations and in some cases you don't even have to specify the patch.

<b>I. Use of apachectl</b> (Red Head)

Basically, it is easy to start/restart/stop an Apache web server by the commands

Shell>> apachectl -k start
Shell>> apachectl -k restart
Shell>> apachectl -k stop

to start, restart, stop your Apache server, respectively. Note you may need to specify the path to the apachectl command. For example, you may use

<b>Full path:</b>
Shell>> /usr/local/apache2/bin/apachectl -k restart

or

<b>Relative path:</b>
Shell>> bin/apachectl -k restart (when the console is in /usr/local/apache2/ in this case)

for restarting Apache.


Also, it is recommeded to use the parameter "graceful" to stop the sever after finishing serving all the HTTP requests while attempting the restart the sever. That is, we use

Shell>> apachectl -k graceful

to restart the Apache server.

<b>You may also note that in SUSE Linux, you can restart (or start) the server by the command:

Shell> /etc/init.d/apache2 restart</b>

<b>II. Use of httpd</b>

However, due to different versions of installation, sometimes <b>apachectl</b> simply doesn't work. Instead, you may use the command <b>httpd</b> (with a shell path specified). You may use

Shell>> ./bin/httpd -k restart

or

Shell>> ./bin/httpd -k graceful

to restart your Apache http daemon service.

<b>III. Use of apache2 (Ubuntu, Debian, SUSE)</b>

<code>Shell> /etc/init.d/apach2 start|restart|stop</code>

You may use the following command for restarting in Ubuntu:

<code>Shell> sudo /etc/init.d/apach2 start/restart/stop</code>

The Apache Official Documents for
1. <a href=http://httpd.apache.org/docs/2.2/stopping.html>Stopping and Restarting</a>
2. <a href=http://httpd.apache.org/docs/2.2/programs/apachectl.html>apachectl - Apache HTTP Server Control Interface</a>
3. <a href=http://httpd.apache.org/docs/2.2/programs/httpd.html>httpd - Apache Hypertext Transfer Protocol Server</a>
Changed By: HP
Change Date: November 03, 2009 07:24PM

How to [HOW TO] Start, Restart, and Stop an Apache Web Server (apachectl (3 Ways for httpd)Red Hat, Ubuntu, Debian, and SUSE)
There are mainly three kinds of ways to start/restart an Apache Server for different Linux distributions.

Taking <b>start</b> as a quick example, they are:
<code>
Shell>> /usr/local/apache2/bin/apachectl -k start (Red Hat)
Shell>> /usr/local/apache2/bin/httpd (when you don't have apachectl in Red Hat)
Shell>> /etc/init.d/apache2 start (Ubuntu, Debian, SUSE)
</code>

Note the path of apachectl and httpd depends on your installation and in some install you don't have to specify the patch.

<b>I. Use of apachectl</b> (Red Head)

Basically, it is easy to start/restart/stop an Apache web server by the commands

Shell>> apachectl -k start
Shell>> apachectl -k restart
Shell>> apachectl -k stop

to start, restart, stop your Apache server, respectively. Note you may need to specify the path to the apachectl command. For example, you may use

<b>Full path:</b>
Shell>> /usr/local/apache2/bin/apachectl -k restart

or

<b>Relative path:</b>
Shell>> bin/apachectl -k restart (when the console is in /usr/local/apache2/ in this case)

for restarting Apache.


Also, it is recommeded to use the parameter "graceful" to stop the sever after finishing serving all the HTTP requests while attempting the restart the sever. That is, we use

Shell>> apachectl -k graceful

to restart the Apache server.

<b>You may also note that in SUSE Linux, you can restart (or start) the server by the command:

Shell> /etc/init.d/apache2 restart</b>

<b>II. Use of httpd</b>

However, due to different versions of installation, sometimes <b>apachectl</b> simply doesn't work. Instead, you may use the command <b>httpd</b> (with a shell path specified). You may use

Shell>> ./bin/httpd -k restart

or

Shell>> ./bin/httpd -k graceful

to restart your Apache http daemon service.


<b>III. Use of apache2 (Ubuntu, Debian, SUSE)</b>

<code>Shell> /etc/init.d/apach2 start|restart|stop</code>

You may use the following command for restarting in Ubuntu:

<code>Shell> sudo /etc/init.d/apach2 start/restart/stop</code>

The Apache Official Documents for
1. <a href=http://httpd.apache.org/docs/2.2/stopping.html>Stopping and Restarting</a>
2. <a href=http://httpd.apache.org/docs/2.2/programs/apachectl.html>apachectl - Apache HTTP Server Control Interface</a>
3. <a href=http://httpd.apache.org/docs/2.2/programs/httpd.html>httpd - Apache Hypertext Transfer Protocol Server</a>
Changed By: HP
Change Date: October 22, 2009 03:54AM

How to Start /, Restart / , and Stop an Apache Web Server (apachectl or httpd)
I. Use of apachectl (Red Head)

Basically, it is easy to start/restart/stop an Apache web server by the commands

Shell>> apachectl -k start
Shell>> apachectl -k restart
Shell>> apachectl -k stop

to start, restart, stop your Apache server, respectively. Note you may need to specify the path to the apachectl command. For example, you may use

Full path:
Shell>> /usr/local/apache2/bin/apachectl -k restart

or

Relative path:
Shell>> bin/apachectl -k restart (when the console is in /usr/local/apache2/ in this case)

for restarting Apache.


Also, it is recommeded to use the parameter "graceful" to stop the sever after finishing serving all the HTTP requests while attempting the restart the sever. That is, we use

Shell>> apachectl -k graceful

to restart the Apache server.

You may also note that in SUSE Linux, you can restart (or start) the server by the command:

Shell> /etc/init.d/apache2 restart


II. Use of httpd

However, due to different versions of installation, sometimes apachectl simply doesn't work. Instead, you may use the command httpd (with a shell path specified). You may use

Shell>> ./bin/httpd -k restart

or

Shell>> ./bin/httpd -k graceful

to restart your Apache http daemon service.



The Apache Official Documents for
1. Stopping and Restarting
2. apachectl - Apache HTTP Server Control Interface
3. httpd - Apache Hypertext Transfer Protocol Server
Changed By: HP
Change Date: October 22, 2009 03:53AM

How to Start / Restart / Stop an Apache Web Server (apachectl or httpd)
<b>I. Use of apachectl</b> (Red Head)

Basically, it is easy to start/restart/stop an Apache web server by the commands

Shell>> apachectl -k start
Shell>> apachectl -k restart
Shell>> apachectl -k stop

to start, restart, stop your Apache server, respectively. Note you may need to specify the path to the apachectl command. For example, you may use

<b>Full path:</b>
Shell>> /usr/local/apache2/bin/apachectl -k restart

or

<b>Relative path:</b>
Shell>> bin/apachectl -k restart (when the console is in /usr/local/apache2/ in this case)

for restarting Apache.


Also, it is recommeded to use the parameter "graceful" to stop the sever after finishing serving all the HTTP requests while attempting the restart the sever. That is, we use

Shell>> apachectl -k graceful

to restart the Apache server.

<b>You may also note that in SUSE Linux, you can restart (or start) the server by the command:

Shell> /etc/init.d/apache2 restart</b>

<b>II. Use of httpd</b>

However, due to different versions of installation, sometimes <b>apachectl</b> simply doesn't work. Instead, you may use the command <b>httpd</b> (with a shell path specified). You may use

Shell>> ./bin/httpd -k restart

or

Shell>> ./bin/httpd -k graceful

to restart your Apache http daemon service.



The Apache Official Documents for
1. <a href=http://httpd.apache.org/docs/2.2/stopping.html>Stopping and Restarting</a>
2. <a href=http://httpd.apache.org/docs/2.2/programs/apachectl.html>apachectl - Apache HTTP Server Control Interface</a>
3. <a href=http://httpd.apache.org/docs/2.2/programs/httpd.html>httpd - Apache Hypertext Transfer Protocol Server</a>
Changed By: HP
Change Date: August 22, 2009 03:38AM

How to Start / Restart / Stop an Apache Web Server (apachectl or httpd)
<b>I. Use of apachectl</b>
(Red Head)

Basically, it is easy to start/restart/stop an Apache web server by the commands

Shell>> apachectl -k start
Shell>> apachectl -k restart
Shell>> apachectl -k stop

to start, restart, stop your Apache server, respectively. Note you may need to specify the path to the apachectl command. For example, you may use

<b>Full path:</b>
Shell>> /usr/local/apache2/bin/apachectl -k restart

or

<b>Relative path:</b>
Shell>> bin/apachectl -k restart (when the console is in /usr/local/apache2/ in this case)

for restarting Apache.


Also, it is recommeded to use the parameter "graceful" to stop the sever after finishing serving all the HTTP requests while attempting the restart the sever. That is, we use

Shell>> apachectl -k graceful

to restart the Apache server.


<b>II. Use of httpd</b>

However, due to different versions of installation, sometimes <b>apachectl</b> simply doesn't work. Instead, you may use the command <b>httpd</b> (with a shell path specified). You may use

Shell>> ./bin/httpd -k restart

or

Shell>> ./bin/httpd -k graceful

to restart your Apache http daemon service.



The Apache Official Documents for
1. <a href=http://httpd.apache.org/docs/2.2/stopping.html>Stopping and Restarting</a>
2. <a href=http://httpd.apache.org/docs/2.2/programs/apachectl.html>apachectl - Apache HTTP Server Control Interface</a>
3. <a href=http://httpd.apache.org/docs/2.2/programs/httpd.html>httpd - Apache Hypertext Transfer Protocol Server</a>
Changed By: HP
Change Date: August 05, 2009 03:38PM

How to Start/ / Restart/ / Stop an Apache Web Server (apachectl or httpd)
I. Use of apachectl

Basically, it is easy to start/restart/stop an Apache web server by the commands

Shell>> apachectl -k start
Shell>> apachectl -k restart
Shell>> apachectl -k stop

to start, restart, stop your Apache server, respectively. Note you may need to specify the path to the apachectl command. For example, you may use

Full path:
Shell>> /usr/local/apache2/bin/apachectl -k restart

or

Relative path:
Shell>> bin/apachectl -k restart (when the console is in /usr/local/apache2/ in this case)

for restarting Apache.


Also, it is recommeded to use the parameter "graceful" to stop the sever after finishing serving all the HTTP requests while attempting the restart the sever. That is, we use

Shell>> apachectl -k graceful

to restart the Apache server.


II. Use of httpd

However, due to different versions of installation, sometimes apachectl simply doesn't work. Instead, you may use the command httpd (with a shell path specified). You may use

Shell>> ./bin/httpd -k restart

or

Shell>> ./bin/httpd -k graceful

to restart your Apache http daemon service.



The Apache Official Documents for
1. Stopping and Restarting
2. apachectl - Apache HTTP Server Control Interface
3. httpd - Apache Hypertext Transfer Protocol Server
Changed By: HP
Change Date: July 11, 2009 03:33PM

How to Start/Restart/Stop an Apache Web Server (apachectl or httpd)
<b>I. Use of apachectl</b>

Basically, it is easy to start/restart/stop an Apache web server by the commands

Shell>> apachectl -k start
Shell>> apachectl -k restart
Shell>> apachectl -k stop

to start, restart, stop your Apache server, respectively. Note you may need to specify the path to the apachectl command. For example, you may use

<b>Full path:</b>
Shell>> /usr/local/apache2/bin/apachectl -k restart

or

<b>Relative path:</b>
Shell>> bin/apachectl -k restart (when the console is in /usr/local/apache2/ in this case)

for restarting Apache.


Also, it is recommeded to use the parameter "graceful" to stop the sever after finishing serving all the HTTP requests while attempting the restart the sever. That is, we use

Shell>> apachectl -k graceful

to restart the Apache server.


<b>II. Use of httpd</b>

However, due to different versions of installation, sometimes <b>apachectl</b> simply doesn't work. Instead, you may use the command <b>httpd</b> (with a shell path specified). You may use

Shell>> ./bin/httpd -k restart

or

Shell>> ./bin/httpd -k graceful

to restart your Apache http daemon service.



The
Apache Official Documents for
1. <a href=http://httpd.apache.org/docs/2.2/stopping.html>
Stopping and Restarting:
</a>
2.
<a href=http://httpd.apache.org/docs/2.2/stoppingprograms/apachectl.html>apachectl - Apache HTTP Server Control Interface</a>
3. <a href=
http://httpd.apache.org/docs/2.2/stoppingprograms/httpd.html>httpd - Apache Hypertext Transfer Protocol Server</a>
Changed By: HP
Change Date: July 11, 2009 03:29PM

How to Start/Restart/Stop an Apache Web Server (apachectl or httpd)
<b>I. Use of apachectl</b>

Basically, it is easy to start/restart/stop an Apache web server by the commands

Shell>> apachectl -k start
Shell>> apachectl -k restart
Shell>> apachectl -k stop

to start, restart, stop your Apache server, respectively. Note you may need to specify the path to the apachectl command. For example, you may use

<b>Full path:</b>
Shell>> /usr/local/apache2/bin/apachectl -k restart

or

<b>Relative path:</b>
Shell>> bin/apachectl -k restart (when the console is in /usr/local/apache2/ in this case)

for restarting Apache.


Also, it is recommeded to use the parameter "graceful" to stop the sever after finishing serving all the HTTP requests while attempting the restart the sever. That is, we use

Shell>> apachectl -k graceful

to restart the Apache server.


<b>II. Use of httpd</b>

However, due to different versions of installation, sometimes <b>apachectl</b> simply doesn't work. Instead, you may use the command <b>httpd</b> (with a shell path specified). You may use

Shell>> ./bin/httpd -k restart

or

Shell>> ./bin/httpd -k graceful

to restart your Apache http daemon service.


Apache Official Document for Stopping and Restarting:
<a href=http://httpd.apache.org/docs/2.2/stopping.html>http://httpd.apache.org/docs/2.2/stopping.html</a>

Original Message

雿: HP
Date: July 11, 2009 03:17PM

How to Start/Restart/Stop an Apache Web Server (apachectl or httpd)
Basically, it is easy to start/restart/stop an Apache web server by the commands

Shell>> apachectl -k start
Shell>> apachectl -k restart
Shell>> apachectl -k stop

to start, restart, stop your Apache server, respectively. Also, it is recommeded to use the parameter "graceful" to stop the sever after finishing serving all the HTTP requests while attempting the restart the sever. That is, we use

Shell>> apachectl -k graceful

to restart the Apache server.


However, due to different versions of installation, sometimes apachectl simply doesn't work. Instead, you may use the command httpd (with a shell path specified). You may use

Shell>> ./bin/httpd -k restart

or

Shell>> ./bin/httpd -k graceful

to restart your Apache http daemon service.


Apache Official Document for Stopping and Restarting:
http://httpd.apache.org/docs/2.2/stopping.html