Wednesday, May 16, 2007

RHCE Study Notes - HTTP

These RCHE study notes were designed to be brief reminders of what you should already be familiar with. This topic covers HTTP server configuration.

One thing to be aware of when working with Apache and the 2.6 kernel is SELinux.

Overview of SELinux

SELinux, is a Mandatory Access Control (MAC) security system for Linux based on the domain-type model. It was written by the NSA (http://www.nsa.gov/selinux/ ) and is comprised of a kernel module (included in all 2.6 kernels), patches to certain security related applications, and a security policy.

More info: http://www.redhat.com/magazine/001nov04/features/selinux/

Study Notes

Here are the brief steps from my RHCE study guide to help you remember the steps to configure a virtual host, and configure permissions.

* HTTP/HTTPS
install httpd, check context with ls -Z
  Q: Create a virtual host www1.example.com w/ subdirectory /var/www/html/www1
  A:
   1) install httpd, modify /etc/httpd/conf/httpd.conf file
    <VirtualHost 192.168.0.1:80="">
    ServerName www1.example.com
    DocumentRoot /var/www/html/www1
    </VirtualHost>
   2) chcon -R --reference /var/www/html /var/www/html/www1
   3) service httpd restart
   4) chkconfig httpd on
  Testing
   service httpd configtest
   ls -Z /var/www/html/www1

The important things to remember are "chcon" to change the context, and "ls -Z" to check it.

No comments: