Ubuntu – Apache2 modules folder where is it

Apache2

I actually used to install, manipulate and configure apache on windows and ultimately install and configure new modules to my local server, and the case isn't the same on Ubuntu.

I installed apache2, but I still can't find the modules folder, I mean the structure that I got on my computer isn't the same that I knew on windows!

  • the path is this : /etc/init.d/apache this path is the start|stop|restart|reload.
  • and the www directory is located here : /var/www/*.html

So, I am supposed to copy a module file that I got mod_security2.so to this location /usr/local/apache/modules/.
In my case I don't have this structure for apache folders

$ ls /etc/apache2
apache2.conf    envvars         mods-enabled     sites-enabled
conf-available  magic           ports.conf
conf-enabled    mods-available  sites-available

So where should I paste the module file knowing that the files inside mods-enabled are *.load and *.so.

Best Answer

Be prepared to ditch a lot of what you know from Windows. In particular, to install the security2 module, install libapache2-mod-security2:

sudo apt-get install libapache2-mod-security2

The module shared library files go in /usr/lib/apache2/modules, not that you should use your own when there's a packaged version available.

Related Question