When managing a VPS or dedicated server, it’s essential to know which version of Apache is currently installed. Keeping your server up-to-date ensures better performance, compatibility with modules, and protection against known vulnerabilities.
In this guide, we’ll show several simple ways to check the installed Apache version on your system.
If you have root access to your Linux VPS or dedicated server, the easiest way to check your Apache version is using the command line.
Open your terminal and run:
apache2 -v
Or, if you’re on a CentOS/Red Hat system:
httpd -v
This will return output similar to:
Server version: Apache/2.4.57 (Ubuntu) Server built: 2024-01-10T16:21:17
This shows both the current version and the build date.
Another quick method is to use the apachectl utility:
apachectl -v
Or:
apache2ctl -v
Output will be the same as the previous method. This tool is useful for controlling and monitoring Apache.
If Apache’s ServerSignature and ServerTokens are enabled (not recommended in production), you can check the version by accessing a non-existent page or directory (e.g., /test404) and reviewing the footer of the default 404 page.
However, for security reasons, this feature is often disabled in production environments.
We strongly recommend disabling version disclosure on public servers. Exposing your exact Apache version can make your server more vulnerable to targeted attacks if you haven’t applied recent security updates.
To disable it, edit your Apache configuration file (apache2.conf or httpd.conf) and add:
ServerSignature Off
ServerTokens Prod
Then restart Apache:
sudo systemctl restart apache2
Knowing your Apache version is a basic but important step in managing your server environment. You can check it in seconds via terminal or control tools like apachectl.