Emmanuel Benoist Home Page

Exercise Apache

Create a Virtual Host

Create a directory containing a file index.html and a index.php file
In the file /etc/hosts (for Unix), or /Windows/System32/drivers/etc (for Windows) redirect the adress www.mysite.ch to the IP address 127.0.0.1
Create a new virtual host on your apache server.
Define its document root to be your new directory. Define the default file to be index.php (at first and index.html after)

Password Protect a directory

Create a new directory restricted containing an index.php. Define a .htaccess file for restricting the access to this directory to one person. User: toto; Password: titi;