Purchase Solution

Using Apache to create a virtual host

Not what you're looking for?

Ask Custom Question

Step 1: Create a Virtual Host

1. Create a new directory "private_club" within the DocumentRoot directory
2. Create a new virtual host on your server with the name "www.private_club.com" that uses the directory you created in (1) as the DocumentRoot for the virtual host

Step 2: Add support for PHP

1. Add support for php files on the www.private_club.com virtual host. (This can be done in more than one way, but you only have to do it one way.) PHP files are a kind of CGI application, so you will have to configure the directory appropriately and add the necessary handlers.)

Step 3: .htaccess

1. Require anyone accessing the directory to login using the login "member" and password "secret"

Step 4: Testing

You can not test the virtual host portion of the project, but you can test the PHP and .htaccess portions. For PHP, you will have to install PHP from http://www.php.net/downloads.php. You will also need a PHP file to test.

PHP files are HTML pages with code embedded in the page itself, similar to a server side include. To create a php file, open a text editor and enter the following:

<html>
<head><title>This is a test!</title></head>
<body>
<h1>
<?php
print "Hello, world!n";
?>
</h1>
</body>
</html>

Save the file as hello.php into the proper directory on your server. When you open the file with a browser, you should get a page that says "Hello world!"

Purchase this Solution

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Javscript Basics

Quiz on basics of javascript programming language.

C# variables and classes

This quiz contains questions about C# classes and variables.