To start, stop, or manipulate Apache on a running system, use the init script /usr/sbin/rcapache2. Thercapache2 command takes the following parameters:
status
- Checks if Apache is started.
start
- Starts Apache if it is not already running.
startssl
- Starts Apache with SSL support if it is not already running. For more information about SSL support, refer toSection 20.6, “Setting Up a Secure Web Server with SSL”.
stop
- Stops Apache by terminating the parent process.
restart
- Stops and then restarts Apache. Starts the Web server if it was not running before.
try-restart
- Stops then restarts Apache only if it is already running.
reload
orgraceful
- Stops the Web server by advising all forked Apache processes to first finish their requests before shutting down. As each process dies, it is replaced by a newly started one, resulting in a complete “restart” of Apache.
Restart Apache 2 web server, enter:
# /etc/init.d/apache2 restart
If you are using Ubuntu use sudo:
$ sudo /etc/init.d/apache2 restart
To stop Apache 2 web server, enter:
# /etc/init.d/apache2 stop
OR
$ sudo /etc/init.d/apache2 stop
To start Apache 2 web server, enter:
# /etc/init.d/apache2 start
OR
$ sudo /etc/init.d/apache2 start
No comments:
Post a Comment