- Apache Modules – List All Enabled (Loaded)
- List Enabled Modules in HTTPD
- List Loaded Modules in Apache2
- How to Load and Unload Kernel Modules in Linux
- List All Loaded Kernel Modules in Linux
- How to Load and Unload (Remove) Kernel Modules in Linux
- How to Manage Kernel Modules Using modprobe Command
- Easy way to show currently loaded kernel modules in Linux
- Show currently loaded kernel modules in Linux
- Show loaded modules using lsmod command
- Check if Specific Kernel Module is Loaded
- Get Information about Specific Module
Apache Modules – List All Enabled (Loaded)
Apache has a lot of modules (or “mods”) that extend its core functionality for special purposes.
How to list installed Apache modules – is a common question as it is very often required to check which Apache modules are loaded/enabled.
List of installed Apache modules can be found using special option for httpd/apachectl (CentOS, RHEL etc.) or apache2/apache2ctl (Ubuntu, Debian etc.) commands.
Cool Tip: Would you like to know how to list all Apache virtual hosts (VHosts)? Really simple! Read more →
-M option lists all loaded/enabled static (statically compiled into the httpd binary) and shared (compiled as dynamic shared objects that exist separately from the main httpd binary) Apache modules.
List Enabled Modules in HTTPD
Get a list of all loaded/enabled modules in HTTPD on RHEL , CentOS etc.:
List Loaded Modules in Apache2
Get a list of all loaded/enabled modules in Apache2 on Ubuntu , Debian etc.:
In the brackets will be shown whatever each Apache module is static or shared (see explanation of each above).
As a pleasant bonus you will also get a syntax check of the all Apache configuration files.
Loaded Modules: core_module (static) mpm_prefork_module (static) http_module (static) so_module (static) auth_basic_module (shared) cgi_module (shared) version_module (shared) wsgi_module (shared) Syntax OK
It was really simple, wasn’t it?
How to Load and Unload Kernel Modules in Linux
A kernel module is a program which can loaded into or unloaded from the kernel upon demand, without necessarily recompiling it (the kernel) or rebooting the system, and is intended to enhance the functionality of the kernel.
In general software terms, modules are more or less like plugins to a software such as WordPress. Plugins provide means to extend software functionality, without them, developers would have to build a single massive software with all functionalities integrated in a package. If new functionalities are needed, they would have to be added in new versions of a software.
Likewise without modules, the kernel would have to be built with all functionalities integrated directly into the kernel image. This would mean having bigger kernels, and system administrators would need to recompile the kernel every time a new functionality is needed.
A simple example of a module is a device driver – which enables the kernel to access a hardware component/device connected to the system.
List All Loaded Kernel Modules in Linux
In Linux, all modules end with the .ko extension, and they are normally loaded automatically as the hardware is detected at system boot. However a system administrator can manage the modules using certain commands.
To list all currently loaded modules in Linux, we can use the lsmod (list modules) command which reads the contents of /proc/modules like this.
Module Size Used by rfcomm 69632 2 pci_stub 16384 1 vboxpci 24576 0 vboxnetadp 28672 0 vboxnetflt 28672 0 vboxdrv 454656 3 vboxnetadp,vboxnetflt,vboxpci bnep 20480 2 rtsx_usb_ms 20480 0 memstick 20480 1 rtsx_usb_ms btusb 45056 0 uvcvideo 90112 0 btrtl 16384 1 btusb btbcm 16384 1 btusb videobuf2_vmalloc 16384 1 uvcvideo btintel 16384 1 btusb videobuf2_memops 16384 1 videobuf2_vmalloc bluetooth 520192 29 bnep,btbcm,btrtl,btusb,rfcomm,btintel videobuf2_v4l2 28672 1 uvcvideo videobuf2_core 36864 2 uvcvideo,videobuf2_v4l2 v4l2_common 16384 1 videobuf2_v4l2 videodev 176128 4 uvcvideo,v4l2_common,videobuf2_core,videobuf2_v4l2 intel_rapl 20480 0 x86_pkg_temp_thermal 16384 0 media 24576 2 uvcvideo,videodev .
How to Load and Unload (Remove) Kernel Modules in Linux
To load a kernel module, we can use the insmod (insert module) command. Here, we have to specify the full path of the module. The command below will insert the speedstep-lib.ko module.
# insmod /lib/modules/4.4.0-21-generic/kernel/drivers/cpufreq/speedstep-lib.ko
To unload a kernel module, we use the rmmod (remove module) command. The following example will unload or remove the speedstep-lib.ko module.
# rmmod /lib/modules/4.4.0-21-generic/kernel/drivers/cpufreq/speedstep-lib.ko
How to Manage Kernel Modules Using modprobe Command
modprobe is an intelligent command for listing, inserting as well as removing modules from the kernel. It searches in the module directory /lib/modules/$(uname -r) for all the modules and related files, but excludes alternative configuration files in the /etc/modprobe.d directory.
Here, you don’t need the absolute path of a module; this is the advantage of using modprobe over the previous commands.
To insert a module, simply provide its name as follows.
To remove a module, use the -r flag like this.
Note: Under modprobe, automatic underscore conversion is performed, so there is no difference between _ and – while entering module names.
For more usage info and options, read through the modprobe man page.
Do not forget to check out:
That’s all for now! Do you have any useful ideas, that you wanted us to add to this guide or queries, use the feedback form below to drop them to us.
Easy way to show currently loaded kernel modules in Linux
This tutorial is going to teach you how to show currently loaded kernel modules in Linux. Kernel modules are pieces of code that can be loaded or unloaded from the kernel on demand. The loaded kernel modules therefore, are the ones that are currently loaded into your system’s memory and that your kernel is either utilizing or about to utilize for accomplishing a specific task.
Show currently loaded kernel modules in Linux
Show loaded modules using lsmod command
lsmod is a command-line utility that displays the presently loaded kernel modules.
Run the following command to see a list of all loaded kernel modules on your Linux system.
The command will display a list of currently loaded kernel modules with their sizes as shown below
Module Size Used by btrfs 1327104 0 blake2b_generic 20480 0 xor 24576 1 btrfs raid6_pq 114688 1 btrfs ufs 81920 0 qnx4 16384 0 hfsplus 110592 0 hfs 61440 0 minix 36864 0 ntfs 106496 0 msdos 20480 0 jfs 188416 0 xfs 1499136 0 libcrc32c 16384 2 btrfs,xfs cpuid 16384 0 vsock_loopback 16384 0 vmw_vsock_virtio_transport_common 36864 1 vsock_loopback vmw_vsock_vmci_transport 32768 2 vsock 45056 7 vmw_vsock_virtio_transport_common,vsock_loopback,vmw_vsock_vmci_transport nls_iso8859_1 16384 1 snd_ens1371 32768 4 snd_ac97_codec 139264 1 snd_ens1371 gameport 20480 1 snd_ens1371 ac97_bus 16384 1 snd_ac97_codec snd_pcm 114688 3 snd_ac97_codec,snd_ens1371 crct10dif_pclmul 16384 1 ghash_clmulni_intel 16384 0 snd_seq_midi 20480 0 aesni_intel 372736 0 snd_seq_midi_event 16384 1 snd_seq_midi crypto_simd 16384 1 aesni_intel snd_rawmidi 36864 2 snd_seq_midi,snd_ens1371 cryptd 24576 2 crypto_simd,ghash_clmulni_intel snd_seq 73728 2 snd_seq_midi,snd_seq_midi_event glue_helper 16384 1 aesni_intel snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi snd_timer 40960 3 snd_seq,snd_pcm vmw_balloon 24576 0 snd 94208 13 snd_seq,snd_seq_device,snd_timer,snd_ac97_codec,snd_pcm,snd_rawmidi,snd_ens1371 joydev 24576 0 input_leds 16384 0 serio_raw 20480 0 soundcore 16384 1 snd vmw_vmci 73728 2 vmw_balloon,vmw_vsock_vmci_transport mac_hid 16384 0 sch_fq_codel 20480 2 vmwgfx 311296 7 ttm 73728 1 vmwgfx drm_kms_helper 237568 1 vmwgfx cec 53248 1 drm_kms_helper rc_core 61440 1 cec fb_sys_fops 16384 1 drm_kms_helper syscopyarea 16384 1 drm_kms_helper sysfillrect 16384 1 drm_kms_helper sysimgblt 16384 1 drm_kms_helper parport_pc 45056 0 ppdev 24576 0 lp 20480 0 parport 65536 3 parport_pc,lp,ppdev drm 548864 10 vmwgfx,drm_kms_helper,ttm ip_tables 32768 0 x_tables 49152 1 ip_tables autofs4 45056 2 crc32_pclmul 16384 0 psmouse 155648 0 mptspi 24576 2 mptscsih 45056 1 mptspi mptbase 98304 2 mptspi,mptscsih ahci 40960 0 libahci 36864 1 ahci e1000 143360 0 scsi_transport_spi 32768 1 mptspi pata_acpi 16384 0 i2c_piix4 28672 0 hid_generic 16384 0 usbhid 57344 0 hid 135168 2 usbhid,hid_generic
lsmod command basically reads the contents of the /proc/modules and prints it in a formatted manner.
Thus, you can also check currently loaded modules by just printing the contents of the /proc/modules file.
Check if Specific Kernel Module is Loaded
To list specific module, run the following command
Replace ModuleName with the name of the module you want to list.
For example, to list KVM related modules, use the command below.
kvm_intel 282624 0 kvm 663552 1 kvm_intel
Get Information about Specific Module
To get all the information about specific module, run the following command
sudo modinfo ModuleName
Replace ModuleName with the name of the module you want to list its information.
For example, to check information about the kvm kernel modules above, run the command below.
filename: /lib/modules/5.4.0-48-generic/kernel/arch/x86/kvm/kvm.ko license: GPL author: Qumranet srcversion: FB5884BFC5A986FE809B1AC depends: retpoline: Y intree: Y name: kvm vermagic: 5.4.0-48-generic SMP mod_unload sig_id: PKCS#7 signer: Build time autogenerated kernel key sig_key: 69:0F:B2:8C:24:82:6C:28:AB:28:F7:D2:E5:B8:D0:0B:2C:EF:1F:87 sig_hashalgo: sha512 signature: 5B:AF:F6:07:76:0F:C2:B9:6B:05:C4:A6:E8:58:E8:BB:63:8B:DE:4A: CC:5F:81:AF:A2:AC:7D:D0:42:1B:CA:45:EA:79:3D:11:18:F0:E6:45: 73:CE:FB:63:02:26:0E:7E:B9:28:17:03:70:84:10:65:7F:6E:DA:B2: 89:55:0B:E7:22:76:1E:EF:99:3F:79:D5:7B:E7:39:96:68:57:EE:9E: D3:9A:B6:3A:3E:39:1F:C5:4A:82:CD:36:7A:D9:22:79:12:EC:E9:F7: DC:C5:6D:B2:DE:FF:CF:63:B8:A8:E3:A0:09:39:E9:6C:3C:F7:88:5F: 2B:51:F2:CD:AA:89:68:6F:CB:19:68:5B:E7:61:E0:E0:31:12:E7:B8: D5:5D:76:14:1E:A2:40:E4:49:26:94:12:66:56:B8:AD:91:DB:EA:0F: F0:DB:08:F9:71:62:24:DC:92:BC:89:8F:2E:F8:C8:7E:56:A1:85:7C: EC:98:A8:E9:CB:EA:07:90:BC:52:21:D9:EC:0B:26:3A:53:03:AA:79: 22:D8:F2:1C:2A:91:2D:59:D3:FD:A5:C4:77:4C:C1:75:CA:54:2F:22: E4:9B:D6:85:8A:B7:B4:23:87:AE:D4:89:57:7D:77:49:95:80:BB:11: A6:A2:81:5B:93:A0:F1:9E:69:AB:CE:61:58:30:C2:5B:9E:41:09:72: E2:7E:48:60:02:18:12:A7:8B:0C:B0:83:5E:D6:8A:A2:83:20:1C:3E: 31:95:40:10:93:C0:35:17:66:4D:3E:45:11:2E:71:95:29:A2:02:90: 18:E2:5A:F2:72:94:2B:4B:E6:7A:FF:5C:E3:1D:6D:38:E0:30:35:FC: 65:35:CB:6C:36:63:E9:35:83:56:89:AD:BF:1B:BA:06:0B:E5:14:8B: F6:B0:1A:D4:13:AF:E1:CD:4D:CE:9B:DE:A6:51:C0:90:5A:19:15:CC: F2:6D:77:B0:C6:04:02:88:17:1C:A7:59:7A:6C:EB:5B:17:6B:65:82: 41:24:4E:A0:7F:8D:3F:9A:A6:16:A9:82:A2:02:32:EF:FE:09:2F:A5: 5C:C7:0E:83:01:96:EC:D2:A7:C4:79:7E:90:5B:03:63:D7:48:59:B7: 88:DC:75:CB:91:5D:88:BB:1F:D9:DE:79:A2:A3:A6:3B:53:D3:2B:47: 72:A0:A3:9F:CA:9B:DD:4B:41:23:D3:26:E0:29:0F:9C:13:6F:3E:29: 01:1D:28:D2:86:E4:E7:8B:F3:F5:A5:EB:F8:CB:A8:51:BD:5D:11:2A: 56:DC:7E:EE:5B:DB:E6:68:18:9C:23:AE:BB:BE:64:E0:E9:9F:83:A5: 01:4A:A4:6B:8F:88:97:9D:54:D3:DE:5A parm: nx_huge_pages:bool parm: nx_huge_pages_recovery_ratio:uint parm: ignore_msrs:bool parm: report_ignored_msrs:bool parm: min_timer_period_us:uint parm: kvmclock_periodic_sync:bool parm: tsc_tolerance_ppm:uint parm: lapic_timer_advance_ns:int parm: vector_hashing:bool parm: enable_vmware_backdoor:bool parm: force_emulation_prefix:bool parm: pi_inject_timer:bint parm: halt_poll_ns:uint parm: halt_poll_ns_grow:uint parm: halt_poll_ns_grow_start:uint parm: halt_poll_ns_shrink:uint
Congratulations, you have reached the end of the article. You have learned how to show currently loaded kernel modules in linux