Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

See Which Apache Modules Are Loaded

This guide shows you how to list the modules that your Apache web server is using right now.

How-To Guides2 min read5 steps

What is Apache and what is a module?

Apache is a program that runs on a server. It sends your website to visitors. A module is a small add-on for Apache. Each module adds one feature. For example, mod_rewrite lets you change how web addresses look. mod_ssl lets you use HTTPS. Knowing which modules are loaded helps when a feature does not work.

This guide needs command line access. A VPS or dedicated server gives you root access. Root is the all-powerful admin account. On shared hosting you may not have this access. Ask Hostvento support if you need a module checked.

Steps

  1. Log in to your server with SSH. SSH is a safe way to type commands on a server from your own computer.
  2. Find out which command name your system uses. On CentOS, AlmaLinux and similar systems, it is httpd. On Ubuntu and Debian, it is apache2ctl.
  3. On CentOS-style systems, type this command.
    httpd -M
    This prints every loaded module.
  4. On Ubuntu or Debian, type this command instead.
    apache2ctl -M
    This does the same job.
  5. Read the list. Each line looks like rewrite_module (shared). The word before _module is the module name.

Check for one module only

Add grep to search the list. Grep is a tool that shows only the lines that match a word.

httpd -M | grep rewrite

The | sign passes the list to grep. If you see a line, the module is loaded. If you see nothing, it is not loaded.

Other helpful commands

  • httpd -l lists modules built right into Apache. These cannot be turned off.
  • a2enmod rewrite turns on a module on Ubuntu or Debian. Restart Apache afterwards.

Be careful when you change modules. A wrong change can stop your site. Take a backup of your Apache config files first.

Check from PHP

If you cannot use SSH, PHP can tell you. Make a file with this code, open it in your browser, then delete it.

<?php
print_r(apache_get_modules());

This only works when PHP runs as an Apache module. It will not work with some setups.

Tip: If the command says "command not found", try the other name. Systems use either httpd or apache2ctl.

Quick recap

  • A module adds one feature to Apache.
  • Use httpd -M or apache2ctl -M to list them.
  • Add | grep name to look for one module.
  • On shared hosting, ask Hostvento support.