Linux Workshop
Lab 15 Apache hosts & access control Requirements
Quick Reference Objectives to learn
➢ Apache server installed (httpd, apache or
#Apache + virtual host + access control
apache2)
vi /etc/httpd/conf/httpd.conf or
vi /etc/apache2/httpd.conf or
vi /etc/apache2/vhosts.d/vhost.conf NameVirtualHost 172.28.24.24
ServerName
wwwX.example.com
ServerAdmin
[email protected]
DocumentRoot
/var/www/wwwX/html
Errorlog
logs/wwwX-errorlog
Customlog
logs/wwwX-accesslog combined
/var/www/wwwX/html>
To Do 1. Place or create a web site (index.html) as a virtual host, e.g.
2. If time permits, add authentication to the web site.
Indexes Includes
Order
allow,deny
allow from
.example.com
AllowOverride
AuthConfig
cd /srv/www/htdocs or cd /var/www/htdocs echo “DLDB” > index.html
Options
vi /var/www/wwwX/html/.htaccess #Requires AllowOverride AuthConfig AuthName
“Whitehouse stuff”
AuthType
Basic
AuthUserFile
/etc/httpd/conf/wwwX.htpasswd
require
valid-user
htpasswd -mc
/etc/httpd/conf/wwwX.htpasswd username
chgrp apache
/etc/httpd/conf/wwwX.htpasswd
chmod g+r
/etc/httpd/conf/wwwX.htpasswd
Theory Modules LPIC 1 Certification Bible, isbn 0-7645-4772-0 ➢ p. 625-637 Using Apache Downloadable manual(www.novell.com/documentation) SUSE LINUX Enterprise Server – Install. and Admin. ➢ p. 529-554 Ch. 22 The Apache Web Server
Extra References ➢ www.tldp.org ➢ www.apache.org
© October 2, 2005, wiki.novell.com/index.php/Roberts_Quick_References, author of Foundations of Linux networking