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.

C H A P T E R 7■ ■ ■Working with ApacheApache (these days in almost all cases Apache2, that is, version 2 of Apache) is the most popular webserver on the Internet (and has been for well over a decade now). It’s available as the apache2 package forDebian/Ubuntu. This chapter covers some useful command-line options, module setup, and thenvarious security issues, including https://, htaccess, and Kerberos integration.7-1. Using the apache2 Command LineThe basic functions of the apache2 command (which may be called httpd in some distros) are to stop,start, and reload Apache2; it’s usually run via apachectl (or apache2ctl in some distros):apachectl stopapachectl startapachectl restart■ Note Debian and Ubuntu use apache2 for this command; some distros instead use httpd. The options shouldall be the same, though. If in doubt, check the apachectl script to see what the HTTPD variable is set to:HTTPD='/usr/sbin/apache2'Various command-line options are available that enable you to manipulate your configurationwithout changing httpd.conf. This can be very useful when testing alternative configurations or testingalternative settings. In effect, it gives you an alternative to backing up your old config file and thenediting the original, so it will make it possible to run tests faster and switch back to your normal config ifyou need to make further changes.It’s particularly useful if you manage config files with Puppet (see Chapter 3), because using thismethod of testing possible changes ensures that the changes will not be overwritten by a scheduledPuppet run while you’re experimenting.After you’ve finished testing with any of these, type the following to restart with your normalsettings:157Download at WoweBook.Com

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

Saved successfully!

Ooh no, something went wrong!