Abbey Workshop

PHP: Configuring Apache and PHP for Multiple Ports

Often when working with the web, you need to work with more than one site at the same time. The combination of PHP and Apache can be configured to run a different web site on different server ports. The steps to do this are outlined below.

Changing httpd.conf

Below are the changes that need to be made to httpd.conf to setup two virtual hosts. One on port 80 and one on port 81.

# Lines that follow setup two virtual hosts on this machine
# The following lines tell the Apache Server to listen on more than one port
Listen 80

Listen 81


# The VirtualHost statements setup two document roots on different ports
<VirtualHost 127.0.0.1:80>
	ServerAdmin temp@temp.com
	DocumentRoot "c:/dir1"
	ServerName www.host1.com
</VirtualHost>


<VirtualHost 127.0.0.1:81>
	ServerAdmin temp@temp.com
	DocumentRoot "c:/dir"
	ServerName www.host2.com
</VirtualHost>
	

The Listen statements are needed to tell Apache to accept requests on those ports. The VirtualHost statement defines the location of the document root, links the host to one of the ports being listened to, and defines a host name for that port.

Google
  Web abbeyworkshop.com   

Copyright © Abbey Workshop 2006

Music Only Search
The Black MP3 Album
The MP3 Album Lyrics
Wprld Music Plus
Mp3 Songs Blog
Music Search Store
First Music Search
Mega MP3 Blog
E MP3 BLog
My MP3 Diary
Fast MP3 Finder
My Blog MP3
Mp3 Songs Mart
My MP3 Songs Album
Top Music Group
Mp3 Tune Records
Song Album Guide
Music DataDite
MP3 Buying Guide
Top MP3 Downloads
MP3 Tune Festival
FAST MP3 Downloads
MP3 Mart Online
Upper MP3
Premium MP3 Site
Music Data online
Fine MP3 Audio
Cheap Music Albums
Fine mp3 downloads
World MP3 Music Records
Mp3 Music Data Direct
The Fine Mp3
MP3 Files World
Home Music Store
DatMP3
Fat MP3 Audio
MP3 ZigZag
MP3 Songs Direct
MP3 Tune World
E MP3 Log
Boom MP3 Music
Speedy MP3
Top 20 MP3 music
Deep MP3 World
Deep MP3 Download
Best-20 MP3
Top Twenty MP3
Deep MP3
Big MP3 Guide
Deep MP3 Audio
Mp3 R.O.B.
MP3-Pop Online
Greate-20-MP3
MP3 Appear
3T-MP3