Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
<Location   /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from gnulix.org
AuthType Basic
AuthName "Server status"
AuthUserFile "gnulixusers"
Require valid-user
Satisfy Any
</Location>

There are more ways to protect material on your web server, but the methods
discussed here should get you started and will probably be more than
adequate for most circumstances. Look to Apache’s online documentation for
more examples of how to secure areas of your site.


Apache Modules


The Apache core does relatively little; Apache gains its functionality from
modules. Each module solves a well-defined problem by adding necessary
features. By adding or removing modules to supply the functionality you want
Apache to have, you can tailor the Apache server to suit your exact needs.


A number of core modules are included with the basic Apache server. Many
more are available from other developers. The Apache Module Registry is a
repository for add-on modules for Apache; you can find it at
https://httpd.apache.org/modules/. The modules are stored in the
/usr/lib/apache2/modules directory.


Each module adds new directives that you can use in your configuration files.
As you might guess, there are far too many extra commands, switches, and
options to describe them all in this chapter. The following sections briefly
describe a subset of those modules available with Ubuntu’s Apache
installation.


To enable a module, use this command:


Click here to view code image
matthew@seymour:~$ sudo a2enmod module_name


To disable a module, use this:


Click here to view code image
matthew@seymour:~$ sudo a2dismod module_name


Note that you need to use the actual name of the module, not the filename,

Free download pdf