Followers

Friday, March 1, 2013

apachectl command line usage

apachectl is a front end to the Apache HyperText Transfer Protocol (HTTP) server. It is designed to help the administrator control the functioning of the Apache httpd daemon.
The apachectl script can operate in two modes. First, it can act as a simple front-end to the httpd command that simply sets any necessary environment variables and then invokes httpd, passing through any command line arguments. Second, apachectl can act as a SysV init script, taking simple one-word arguments like start, restart, and stop, and translating them into appropriate signals to httpd.
If your Apache installation uses non-standard paths, you will need to edit the apachectl script to set the appropriate paths to the httpd binary. You can also specify any necessary httpd command line arguments. See the comments in the script for details.
The apachectl script returns a 0 exit value on success, and >0 if an error occurs. For more details, view the comments in the script.

Synopsis

When acting in pass-through mode, apachectl can take all the arguments available for the httpdbinary.
apachectl [ httpd-argument ]
When acting in SysV init mode, apachectl takes simple, one-word commands, defined below.
apachectl command

Options

Only the SysV init-style options are defined here. Other arguments are defined on the httpd manual page.
start
Start the Apache httpd daemon. Gives an error if it is already running. This is equivalent to apachectl -k start.
stop
Stops the Apache httpd daemon. This is equivalent toapachectl -k stop.
restart
Restarts the Apache httpd daemon. If the daemon is not running, it is started. This command automatically checks the configuration files as in configtest before initiating the restart to make sure the daemon doesn't die. This is equivalent to apachectl -k restart.
fullstatus
Displays a full status report from mod_status. For this to work, you need to have mod_status enabled on your server and a text-based browser such as lynxavailable on your system. The URL used to access the status report can be set by editing the STATUSURL variable in the script.
status
Displays a brief status report. Similar to thefullstatus option, except that the list of requests currently being served is omitted.
graceful
Gracefully restarts the Apache httpd daemon. If the daemon is not running, it is started. This differs from a normal restart in that currently open connections are not aborted. A side effect is that old log files will not be closed immediately. This means that if used in a log rotation script, a substantial delay may be necessary to ensure that the old log files are closed before processing them. This command automatically checks the configuration files as in configtest before initiating the restart to make sure Apache doesn't die. This is equivalent toapachectl -k graceful.
graceful-stop
Gracefully stops the Apache httpd daemon. This differs from a normal stop in that currently open connections are not aborted. A side effect is that old log files will not be closed immediately. This is equivalent to apachectl -k graceful-stop.
configtest
Run a configuration file syntax test. It parses the configuration files and either reports Syntax Okor detailed information about the particular syntax error. This is equivalent to apachectl -t.
The following option was available in earlier versions but has been removed.
startssl
To start httpd with SSL support, you should edit your configuration file to include the relevant directives and then use the normal apachectl start.

Apache Server command line usage

Apache Command Line

You may need to run Apache from the command line occasionally. You can obtain a complete listing of the Apache command line options by using the "-help" argument. For example, you would need to open a command window and cd to the Apache directory. On UNIX, cd into the bin directory under Apache. Now run the command:

    apache -help

Or on UNIX:


    apache-lyris -help

With respect to the command line tools described herein, it is implied that you are running in a command window (MS-DOS prompt on Windows or xterm/cmdtool or equivalent on UNIX/Linux) and are currently in the Apache directory.

UNIX Specific Tools If you are running on Solaris or Linux, there are convenient scripts available to you to start, stop, and restart Apache. These are kept in the Apache/bin directory, directly below the Lyris directory. For example, from that directory, you would run:

    ./stop

or


    ./start

or


    ./restart

Depending on what you need to do.

Windows Specific Tools If you are running on Windows, you may have need for several different command line tools. For example, on Windows you can start Apache in the foreground very easily by issuing the following command from the Apache directory:

    apache

Running Apache using a terminal window is good for debugging, however it blocks that shell. You can, of course, type Ctrl+C to kill that job, but in that case Apache won't exit cleanly. Ideally, you should open another command window and cd to the Apache directory, then run the command:


    apache -k shutdown

If you are running a version of Windows that supports services, such as Windows NT or Windows 2000, you can install Apache as a service using the following command:


    apache -d path_to_apache -i

In the above example, the path_to_apache variable should be substituted by the path to your Apache directory. Thus, if you accepted the defaults in your install, this command will look like:


    apache -d C:\lyris\apache -i

If you want to uninstall the Apache service, run the following command:


    apache -u

If the Apache service is installed, and you want to quickly start and stop it without using the "Services" applet, you can use the "net" utility provided by Windows. The syntax of the "net" command, with respect to stopping and starting services, is:


    net [stop | start] apache

how to get Heapdump in Weblogic

to get Heapdump in weblogic we have to set the follwoing parameters.

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\Heapdump

Jrockit arguments

-Xmanagement:autodiscovery=true,authenticate=false,port=7091,ssl=false  -XX:FlightRecorderOptions=defaultrecording=true