I always waste a lot of time and bring a lot of stress on myself when I’m working on multiple website projects on my desktop. You load up your htdocs folder and it’s cluttered with numerous folders and require you to read the entire list before you eventually find the folder that contains your desired work.

I eventually figured out how to setup multiple ports inside Apache’s httpd.conf file and it has been a life saver, however folder naming schema has been a problem until I developed a solution this weekend.
Step One
First, we’re going to add a few lines to the bottom of our httpd.conf file located in the conf/ folder of the original Apache 2 folder.
# :81 - phpMyAdmin
Listen 81
<Virtualhost *:81>
DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs/_/”
</VirtualHost># :82
Listen 82
<Virtualhost *:82>
DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs/82/”
</VirtualHost># :83
Listen 83
<VirtualHost *:83>
DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs/83/”
</Virtualhost># :84
Listen 84
<VirtualHost *:84>
DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs/84/”
</Virtualhost># :85
Listen 85
<VirtualHost *:85>
DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs/85/”
</Virtualhost># :86
Listen 86
<VirtualHost *:86>
DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs/86/”
</Virtualhost># :88
Listen 88
<VirtualHost *:88>
DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs/88/”
</Virtualhost># :89
Listen 89
<VirtualHost *:89>
DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs/89/”
</Virtualhost># :90
Listen 90
<VirtualHost *:90>
DocumentRoot “C:/Program Files/Apache Group/Apache2/htdocs/90/”
</Virtualhost>
The first group of lines is for my phpMyAdmin setup that I’ve designated for port 81 and setup inside the folder ‘_‘. When I go to http://127.0.0.1:81/ I’m taken right into my localhost phpMyAdmin setup flawlessly. This step is optional but highly recommended to any MySQL developer.
If you noticed, we skip port 87 on this windows setup. Firefox blocks port 87 from being viewed, so I simply removed it from the first configuration.
Step Two
Next, we’re going to create the folders necessary for this setup.
Step Three
We’re going to restart Apache. Press Start, click Run…, type ‘services.msc‘, and you’ll be presented with the following window.

Click to select ‘Apache2‘ under the Name column then click the Service Restart button circled above. Once the dialog is finished, you can close out of the services window and you’re technically done.
Optional Step
The next step is optional and purely visual. I’ve made an index file to help me organize the ports, name them, and provide a quick interface.
Create ‘index.php‘ in your htdocs/ folder and add the following contents:
<html>
<head>
<style type=”text/css”>
body { padding: 50px; font: normal normal 22px Verdana; color: #303030; }
a { font: normal normal 26px Verdana; color: #105ca5; }
a.bold { font-weight: bold; }
</style>
</head>
<body><?php
$ports = array (
82 => “friend network”
,83 => “unused”
,84 => “unused”
,85 => “unused”
,86 => “unused”
,88 => “unused”
,89 => “unused”
,90 => “unused”
);foreach ( $ports as $port => $description )
{
print “<a href=\”http://127.0.0.1:” . $port . “/\”>:” . $port . “</a> ” . $description . “<br /><br />”;
}print “<a href=\”http://127.0.0.1:81/\”>phpMyAdmin</a>\n”;
?></body>
</html>
As you can see, I’ve already named the first port, 82, to “friend network” inside the port array list. Every other port is named “unused”.
Final Result
This is what comes up when I visit http://127.0.0.1/ :
Click one of the available ports and boom, you’re at the new address of your project.

