------------------------------------------------------------------------------- access control (access.conf file) Directory will refer to directories or symbolic links the server is passing though to reach the relevent document. for example /www is a symbolic link DIRECTORY It does NOT refer to a sub-tree of the server though the directories the server passes though to reach the alias'ed location is used. EG: will affect the alias Alias /project /student/group/project/www will hav no effect at all if no directory or directory symbolic link for /project exists ------------------------------------------------------------------------------- access control Does this override directory considerations? ------------------------------------------------------------------------------- Seting up a Web Password for a Sub-directory Use the script /www/httpd/support/dbmmanage to create web password database. For Example dbmmanage adduser Note: the user and password is what will be typed in to netscape and as such can be whatever you like. The name of the password file is the file name base to use. It will create two files with ".dat" and ".pag" suffixes. This should be OUTSIDE all web directories if posible. Next in the www directory you wish to protect, create a ".htaccess" file with these lines. You can also and any server `Options' or other host access restrictions. =======8<-------- # # Limit access to this directory # AuthName "Name of Area they need a password for" AuthDBMUserFile /home/davida/www-passwd AuthType Basic require valid-user =======8<-------- For more verbose and detailed instructions look at the file passwd.hints in this directory. ------------------------------------------------------------------------------- A 3 line perl Webserver! #!/usr/bin/perl # # Usage: webserv.pl {directory} {portnum} # Example: webserv.pl /home/LOGINNAME/public_html 4242 # # Start a webserver on port number 'portnum', where 'directory' is the full # path to the directory you wish to serve. People can then access files in # your directory via "http://machinename:portnum/filename.html". Note that # this three-liner is minimal, and does NOT support: auto-indexing, CGI, SSI, # forms/posting, https, htaccess, plus others. Essentially it only supports # 'GET', and is intended just as a curiousity. # # Written by Sarang Gupta (sarang@sarangworld.com) # http://www.sarangworld.com/perlscript.php3 use Socket;($pr,$pt)=@ARGV;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp")); $stat=bind(S,sockaddr_in($pt,INADDR_ANY))||die;listen(S,SOMAXCONN); for(;accept(C,S);){while(){if(/get (\S+)/i){print C `cat $pr/$1`;last}}} ------------------------------------------------------------------------------- Server Moved - Fake Web server! Create a tail script of a static document to output and create a inetd entry to call this document on ANY web server accesss! In /etc/services add... =======8<-------- http 80/tcp httpd # WorldWideWeb server =======8<-------- In /etc/inetd.conf add... =======8<-------- http stream tcp nowait nobody /opt/etc/httpd_moved =======8<-------- Now create the /opt/etc/httpd_moved script with the message to output... =======8<-------- #!/usr/bin/tail -n+4 # # Fake inetd http script which just reports that the server has moved! # HTTP/1.1 200 OK Server: Fake_Tail_Server/1.0 (Unix) Last-Modified: Mon, 6 Jul 1998 02:36:39 GMT Connection: close Content-Type: text/html ....whatever message is required.... =======8<-------- An example script is called httpd_moved.txt in this directory. Make sure the above is executable, then to enable the above HUP the inetd daemon to get it to re-read its config file. -------------------------------------------------------------------------------