\documentclass{cmlab}

\RCS $Revision: 1.1 $

\usepackage{alltt,key,xr}
\externaldocument[lt-]{../../linux_training-plus-config-files-ossi/build/masterfile}
\ifx\pdftexversion\undefined \else
  \usepackage[pdfpagemode=None,pdfauthor={Nick Urbanik}]{hyperref}
\fi

\newcommand*{\labTitle}{Configuring WebDAV on Apache}

\begin{document}

\section{Aim}
\label{sec:aim}

WebDAV is already very important, but will be increasingly so over the
next year.  Here you will learn how to set up and configure a WebDAV
enabled folder on your web server, and understand how to use it from
two WebDAV clients: IE 5.x, and Microsoft Word.

\section{Background}
\label{sec:background}

See the chapter on Apache in the \emph{Linux Training Materials
  Project}.  I have written a detailed description of WebDAV and where
  you can find more information about it.


\section{Procedure}
\label{sec:procedure}

\begin{enumerate}
\item \label{stp:make-website-dir}Create a directory to be cotrolled
  by WebDAV\@.  It must be writable by the user \texttt{apache}.
  \begin{alltt}
$ sudo mkdir /var/www/html/\emph{mywebsite}
$ sudo chown apache.apache /var/www/html/\emph{mywebsite}
  \end{alltt}

\item WebDAV locks files opened for writing.  It stores this lock
  information into a database.  You need to create a directory to hold
  this database.
  \begin{alltt}
$ sudo mkdir /var/lock/WebDAV
$ sudo chown apache.apache /var/lock/WebDAV
  \end{alltt}

\item Servers report all error messages and give feedback to the
  system administrator through the server logs.  Open two terminal
  windows and run the follwoing commands, one in each:
  \begin{alltt}
$ sudo tail -f /var/log/httpd/error_log
$ sudo tail -f /var/log/httpd/access_log
\end{alltt}
\textbf{Keep these two windows open, viewing the log files, from now
  till the end of the class.}

\item Open your web server configuration inside a text editor:
  \begin{alltt}
$ sudo emacs /etc/httpd/conf/httpd.conf
  \end{alltt}%$
  \textbf{Keep this editor open, from now till the end of the class.}
  
\item Append to the end of \texttt{/etc/httpd/conf/httpd.conf} the
  example configuration from
  page~\vref{lt-sec:mod_dav-configuration-example} of the \emph{Linux
    Training Materials Project}.

  Edit it to match the directory name you made in
  step~\ref{stp:make-website-dir}.
  Don't forget to add the location of the WebDAV lock database.

  Note that you created the file \texttt{/etc/httpd/conf/passwd} when
  you did the exercise about web server authentication.  You will use
  the user names and passwords that you created then.

\item Restart your web server while viewing the \texttt{error\_log}
  file.  Watch the error messages in the log file, and if they refer
  to a configuration error, click on the editor, correct the error,
  and restart the server.

\item Go to a Windows machine running Internet Explorer 5.0 or later.

\item Make sure that IE is configured so that it can connect to your
  web server without going to a proxy server.  This step is essential.

\item View the directory you created as a normal web site.  For
  example, if I created the directory
  \texttt{/var/www/html/mywebsite}, and the name server has registered
  my computer name as \url{nick.tycm.vtc.edu.hk}, then I would type
  the following into the URL bar of IE:
  \begin{alltt}
http//nick.tycm.vtc.edu.hk/mywebsite/
  \end{alltt}

\item If you cannot see your web site, then the proxy settings on IE
  are wrong.  Choose Tools $\rightarrow$ Internet Options
  $\rightarrow$ Connections $\rightarrow$ LAN settings then make sure
  that the web browser is set so that it will connect directly to your
  web server.
 
\item  If you can see you site, then:
  \begin{enumerate}
  \item select the URL and type \key{Control-C}

  \item click File $\rightarrow$ Open

  \item Paste the URL into the dialog box with \key{Control-V}

  \item Check the check box item: \textsf{Open as a web folder}
  \end{enumerate}

\item Open Windows Explorer, and copy a directory containing files

\item Paste into your web folder.  If this does not work, check that
  the directory is owned by apache, and check that the directory that
  holds the lock files exists and is owned by apache.  Read the error
  and access log files.

\item Start Microsoft Word, and open a new file on the WebDAV server,
  save it there (make sure that you choose ``Web Folders'').
\end{enumerate}
\end{document}
