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 APACHE3. Set the parameter loadmodule, which will then be used when parsing theconfig file:apache2 -D loadmoduleSo, if your config file includes this:01 02 LoadModule my_other_module03 then my_other_module will be loaded only if the parameter is set. You canuse this for testing modules before adding them permanently by definingloadmodule in the config, or you can use it for testing anything else that youput within an appropriate IfDefine section. The IfDefine section can betemporary (that is, you can remove it after testing) to allow you to switchquickly backward and forward when testing a module or a section of config.When you’re happy, remove lines 01 and 03 to avoid the need for theparameter to be passed in.4. Get information about Apache:apache2 -lapache2 -Lapache2 -SThe first outputs a list of compiled modules so you can check which modulesare available and loaded already. The second gives a list of directives (such asthe SSL directives discussed in recipe 7-4) and where they apply. This can bereally useful for troubleshooting purposes. The third shows the VirtualHostsettings as constructed from the config file. Again, this can be useful whentroubleshooting to check which settings are being applied to whichVirtualHost and that nothing has been missed. Add this section to your configfile, and then run apache2 -S to take a look at the VirtualHost settings:ServerAdmin othersite_web@localhostDocumentRoot /var/www/myothersite/Options FollowSymLinks +IncludesAllowOverride NoneErrorLog /var/log/apache2/othersite_error.log7-2. Apache2: Dealing with ModulesApache2 is modular, which means there’s a core system and then a set of modules that you can includein the main system if you choose. Some of the modules are statically built, which means that they’rebuilt in when the server is compiled and can’t be removed without recompiling the server. Thesemodules can’t be loaded or unloaded on the fly. If you’re using the Apache2 package for your160Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!