In my last post of this series, I’ve shown you how to create a MySQL database using the GUI tools. In the fifth part of this tutorial, we’re now going to see how to add a virtual host.
A virtual host allows your web server to serve multiple websites from a unique shared IP address. Apache in this case, knows which website to serve based on the domain name requested by the web browser.
For this tutorial, we’re going to add a virtual host so that we can install phpMyAdmin to manage our MySQL database.
Usually we would install phpMyAdmin in a directory and configure an aliase so that it could be accessed from any website hosted on this web server (ie.: http://www.myfirstwebsite.com/phpmyadmin, http://www.mysecondwebsite.com/phpmyadmin, etc.).
But let’s not go there right now, we don’t want to get confused from the start.
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin info@thewebhostinghero.com
DocumentRoot /www/phpmyadmin
ServerName phpmyadmin
ErrorLog logs/phpmyadmin-error_log
CustomLog logs/phpmyadmin-access_log common
</VirtualHost>
127.0.0.1 phpmyadmin
The IP address 127.0.0.1 is a loopback address which means that it always point to your local computer.

The error message is caused by the fact that there’s simply no files in C:\www\phpmyadmin and that Apache has been configured to deny directory browsing. Once we have installed phpMyAdmin, we won’t see this error message again.
Stay tuned as next time we’ll install phpMyAdmin in our virtual host directory.
Click here to subscribe in a RSS reader or by email to receive updates.
Posted in Apache · MySQL · PHP · Tutorials · Windows Server | 2 Comments
2 responses so far ↓
1. Response by : How To Install Your Own Web Server - Installing phpMyAdmin on Jun 12, 2008 at 1:28 pm
[...] Extract the content from the archive to your hard drive in C:wwwphpmyadmin (if you followed this tutorial). [...]
2. Response by : Hakan Atil on Dec 30, 2009 at 2:53 pm
Thank you for the tut. I helped me a lot.
Leave a Comment