Create an IP based vhost configuration.

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Create an IP based vhost configuration.

Postby action_bastard » 09. January 2008 22:33

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.
action_bastard
 
Posts: 4
Joined: 07. January 2008 16:57

Postby Izzy » 09. January 2008 23:40

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
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby action_bastard » 10. January 2008 03:50

Absolute thanks! You've made the vhost tutorial much clearer.
Truly appreciated.
action_bastard
 
Posts: 4
Joined: 07. January 2008 16:57


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 114 guests