Basic Security and Access Control

Apache includes some basic built-in security features that allow primitive access control to Web sites on the server. There are two ways that you can control access to various parts of the Web server. The first is by hostname or IP address. In this case, only hosts that have a certain name or IP address will be allowed to access the protected areas of the site.

The second is by username and password. In this case, a valid username and password is required to access the protected areas of the site.

The file that is used to control access to a directory is .htaccess. First, we will look at how to control access based on hostname or IP address.

Controlling Access by Hostnames or IP Address

Two complementary commands ...

Get Sams Teach Yourself FreeBSD® in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.