13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 7 ■ WORKING WITH APACHEdistribution, you won’t have any control over which modules are built in like this. If you want a differentset of built-ins, you’ll need to recompile Apache2 yourself. As a rule, you shouldn’t need to do this;anything that’s missing from the built-in list can be installed dynamically (which I’ll describe in amoment). You’ll need to recompile if you want to disable any of the built-in modules, but avoid this ifpossible, since compiling your own software is far less maintainable than using your distro’s packagingsystem.To get a list of the built-in modules, use this command:apache2 -iDynamic shared objects (DSOs) are the other type of module. These exist separately from the mainbinary and can easily be loaded when the server starts or reloads. So, you can take them in and out asyou need. Again, your distro package will probably include a few of these modules, and separatepackages will be available for other modules.In general, a Fedora-type system will by default load most of the modules that are provided with theserver, whereas a Debian system will load only a few. You’ll need to choose to load the rest using thea2enmod tool, which I’m about to explain.With Debian, you’ll find all the module load information in the directory /etc/apache2/modsavailable/;this is also where the config files (when needed for a particular module) live, and you canedit the configuration here. To load a module, a symlink is created from /etc/apache2/modsenabled/modulename.loadto /etc/apache2/mods-available/modulename.load.> ls -l /etc/apache2/mods-enabled/…lrwxrwxrwx 1 root root 27 2009-07-14 14:20 php5.conf -> ../mods-available/php5.conflrwxrwxrwx 1 root root 27 2009-07-14 14:20 php5.load -> ../mods-available/php5.load...■ Note The lines in /etc/apache2/apache2.conf that handle this are as follows:Include /etc/apache2/mods-enabled/*.loadInclude /etc/apache2/mods-enabled/*.confEach modulename.conf file is usually a single line like this:LoadModule modulename /usr/lib/apache2/modules/modulename.soYou could, if you like this method of managing module configuration but are not using Debian, set up somethingsimilar yourself by manually creating these directories and the appropriate *.load and *.conf files and adding theinclude lines for both directories. Then remove the LoadModule lines and the module configuration from the main161Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!