[Apache] Loopback Interface Testing

Sometimes it’s really important to test multiple websites on localhost. How we can do that? Very easy! ;).. Yes we can use different port for each site. Some days ago i found one of the windows hosting server did this for their different users. So we can also be able to to it in apache..

What we need is to initialize the port for each site.. here is an example

We need to edit our httpd.conf file and paste these code in the suitable place

Listen 127.0.0.1:8000
Listen 127.0.0.1:1111
BindAddress 127.0.0.1

Port 1111
Port 8000

ServerName 127.0.0.1

NameVirtualHost *

<VirtualHost *:8000>
DocumentRoot “/home/username/test/example.org/htdocs”
<Directory “/home/username/test/example.org/htdocs”>
Options Indexes FollowSymLinks MultiViews
AllowOverride None

Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost *:1111>
DocumentRoot “/home/username/test/example.com/htdocs/”
<Directory “/home/username/test/example.com/htdocs/”>
Options Indexes FollowSymLinks MultiViews
AllowOverride None

Order allow,deny
Allow from all
</Directory>
</VirtualHost>

done, now port 8000 is for our development and 1111 is for testing purpose

enjoy 😉

Ref: Security Tips for Server Configuration

Advertisements

About Tanveer
RIA (Rich Internet Application) Developer with a wide variety of business applications. Particularly interested in client/server and relational database design. Always interested in migration projects, as well as close interaction with the DB manufacturers.

2 Responses to [Apache] Loopback Interface Testing

  1. David says:

    Hi Tanveer,
    Really nice example to looping back. Just what i need. btw this blog really has some good resource.
    Nice job you have done so far..
    Keep it up…. 😉

  2. Tanveer says:

    Hi David,
    Thanks a lot… for your compliment 😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: