/go/keepalivetimeout changes the Apache setting KeepAliveTimeout in Apache's main configuration file. It is the number of seconds Apache keeps an idle connection open, waiting for the visitor's next request. The setting matters only while keepalive is On. After changing the file, the command reloads PHP-FPM and the web server. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Check the current value
/go/keepalivetimeout return
# Set it to 3 seconds
/go/keepalivetimeout 3
# Go back to the default of 5 seconds
/go/keepalivetimeout
Arguments
| Argument | Required | Default | Notes |
|---|---|---|---|
[seconds] |
No | 5 |
A whole number of seconds. Apache also accepts a number with an ms suffix. All arguments are joined with spaces. |
return |
No | — | Prints the current value. Not case-sensitive. |
--noreload |
No | — | Only recognized as the sole argument, and currently has no effect on the reload. |
The command has no other options.
Examples
# Read the current value
/go/keepalivetimeout return
# Close idle connections after 2 seconds
/go/keepalivetimeout 2
# Back to the default
/go/keepalivetimeout
# Check the line in the configuration file (Debian and Ubuntu)
grep -n "KeepAliveTimeout" /etc/apache2/apache2.conf
Output
| Outcome | What you get |
|---|---|
return |
The current value, such as 5. Empty if it can’t be read. Exit code 1. |
| Value set | KeepAliveTimeout updated successfully., then the output of reload. |
| Unsupported operating system | Unknown operating system. The exit code is 0. |
The confirmation line is printed even when the file wasn’t changed.
Logging
Every run is appended to /var/log/go/keepalivetimeout.log.
See the full reference at /go/keepalivetimeout and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
