Page 1 of 1

Create an IP based vhost configuration.

PostPosted: 09. January 2008 22:33
by action_bastard
Hello,
I am interested in taking the Invision Power Board I have set up in .htdocs using XAMPP for Windows Online. I would like to have a very small number of associates connect to me to collaborate on working/in-progress designs etc. without uploading to a host. Just use the features of XAMPP. Can anyone please tell me how to Create an IP based vhost configuration and what entries I would need to change in vhost to reflect this?

I am using WinXP SP2 default with XAMPP 1.6.5

Thank you.

PostPosted: 09. January 2008 23:40
by Izzy
These entries go below the last lines that are commented ## out in the httpd-vhosts.conf file.

Listen 80

<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

<VirtualHost 123.123.123.123>
ServerName 123.123.123.123
DocumentRoot "C:/xampp/htdocs/ipb"
<Directory "C:/xampp/htdocs/ipb" >
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "C:/xampp/htdocs/ipb/cgi-bin/"
</VirtualHost>

Change the values to match your own IP and paths.

You must have a fixed IP from your ISP and they have not blocked port 80 incoming - some cable ISP don't allow web servers.

Save the file and restart Apache to have those edits recognized and as I always say here make a backup of any conf or ini file before editing so you always have the default file to fall back on.

If you get any problems after editing the file then issue this command apache -S in a command console in the xampp\apache\bin directory - paste the result here by clicking on the little icon top left of the console window title bar and select Edit from the context menu.

Also paste your httpd-vhosts.conf file along with the above if you get issues and can't work them out.


Next, open C:\WINDOWS\system32\drivers\etc\hosts file by simply dragging it in to your text editor.

Add this lines at the top if it does not exist:
127.0.0.1 localhost
(you can add this line but I don't think it would make much difference)
123.123.123.123 123.123.123.123
These entries are usually placed here if you have used a Name for your server - but always include the localhost entry as we have named the server in the IP based VHost.

Save the file and exit.


Access IPB site:
http://123.123.123.123/

Access XAMPP Welcome Page
http://localhost/
or
http://127.0.0.1/

Here is some reference material for reading:
http://httpd.apache.org/docs/2.3/vhosts ... es.html#ip
http://httpd.apache.org/docs/2.3/mod/co ... irtualhost

PostPosted: 10. January 2008 03:50
by action_bastard
Absolute thanks! You've made the vhost tutorial much clearer.
Truly appreciated.