Как узнать установленную версию Apache?
Статья короткая: Как посмотреть версию WEB-сервера Apache2.
Для Debian дистрибутивов
# apache2 -v Server version: Apache/2.4.10 (Debian) Server built: Mar 31 2018 09:39:03
Для Red Hat дистрибутивов
# httpd -v Server version: Apache/2.4.10 (Unix) Server built: Mar 31 2018 09:39:03
Любое использование материалов сайта возможно только с разрешения автора и с обязательным указанием источника.
apache_get_version
Возвращает версию Apache или false в случае возникновения ошибки.
Примеры
Пример #1 Пример использования apache_get_version()
$version = apache_get_version ();
echo » $version \n» ;
?>?php
Результатом выполнения данного примера будет что-то подобное:
Apache/1.3.29 (Unix) PHP/4.3.4
Смотрите также
- phpinfo() — Выводит информацию о текущей конфигурации PHP
User Contributed Notes 2 notes
16 years ago
apache_get_version() — depends on settings in httpd.conf ServerTokens
ServerTokens Full — Apache/2.0.55 (Win32) DAV/2
ServerTokens OS — Apache/2.0.55 (Win32)
ServerTokens Minor — Apache/2.0
ServerTokens Minimal — Apache/2.0.55
ServerTokens Major — Apache/2
ServerTokens Prod — Apache
1 year ago
On my server apache_get_version() will end all web page output, just like die(), with no errors.
So use;
if( function_exists ( «apache_get_version» )) $AVerpache = apache_get_version ();
> else $AVerpache = «unknown» ;
>
print $AVerpache ;
?>
The following may work on your server and return «Apache/x.x.xx»
print $_SERVER [ «SERVER_SOFTWARE» ];
?>
but on mine it only returns «Apache».
- Функции Apache
- apache_child_terminate
- apache_get_modules
- apache_get_version
- apache_getenv
- apache_lookup_uri
- apache_note
- apache_request_headers
- apache_response_headers
- apache_setenv
- getallheaders
- virtual
- Copyright © 2001-2023 The PHP Group
- My PHP.net
- Contact
- Other PHP.net sites
- Privacy policy
3 Methods of Checking Apache Version
In this guide, you will be shown three simple methods to check the version of Apache running on your Linux server. Apache web server is a widely used software that powers many websites. Knowing your Apache version is important for security updates, compatibility, and troubleshooting. By following these methods, you can easily determine your Apache version and stay informed about your web server’s software.
What is Apache?
Before delving into the methods of checking Apache versions, it’s important to have a basic understanding of what Apache is. Apache is a freely available, open-source web server software runs on numerous operating systems. It was initially released in 1995 and is maintained by the Apache Software Foundation.
Apache acts as an HTTP server, serving webpages and other files over the internet. Its main function is to efficiently handle requests from clients or users and deliver content reliably.
Renowned for its stability, security, and scalability, Apache is a popular selection for peoples, businesses, and other organizations seeking a dependable web server for hosting their websites. It also offers flexibility through a wide range of modules that allow web developers to customize the server’s behavior according to their specific requirements. Apache follows a module-based system, enabling developers to add or remove components as needed.
To ensure the best performance and security, it is crucial to keep Apache up to date. Regular updates guarantee that you have the latest security patches and avoid potential issues encountered in previous versions.
Centos/Redhat — Как узнать версию apache в Linux
Сегодня веб сервер Apache является одним из самых популярных и широко используемым HTTP-сервером в мире. Однако иногда бывает случай когда, требуется узнать версию apache, запущенного на конкретном сервере. Перед проверкой убедитесь, что следующие команды выполняться от имени пользователя root или sudo. Проверять установленную версию веб сервера Apache мы будем на дистрибутиве Centos.
Чтобы проверить установленную версию веб-сервера Apache на вашем сервере Linux, то нужно выполнить следующую команду:

В результате мы видим что версия установленного веб сервера равна Apache/2.4.37
Если нам этой информации мало и мы хотим еще увидеть номер версии Apache и параметры компиляции, то нужно использовать тот же флаг -V, но только в верхнем регистре.

Всем спасибо, я надеюсь что вам моя статья хоть чем-то помогла.
