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
- Log in to your server with SSH. SSH is a safe way to type commands on a server from your own computer.
- Find out which command name your system uses. On CentOS, AlmaLinux and similar systems, it is
httpd. On Ubuntu and Debian, it isapache2ctl. - On CentOS-style systems, type this command.
This prints every loaded module.httpd -M - On Ubuntu or Debian, type this command instead.
This does the same job.apache2ctl -M - Read the list. Each line looks like
rewrite_module (shared). The word before_moduleis 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 -llists modules built right into Apache. These cannot be turned off.a2enmod rewriteturns 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.
httpd or apache2ctl.Quick recap
- A module adds one feature to Apache.
- Use
httpd -Morapache2ctl -Mto list them. - Add
| grep nameto look for one module. - On shared hosting, ask Hostvento support.