Accessing xampp vhost from remote pc on local network

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

Accessing xampp vhost from remote pc on local network

Postby danielevigi » 01. April 2014 08:18

I have a vhost configuration like this:
Code: Select all
NameVirtualHost *:80


<VirtualHost *:80>
  DocumentRoot C:/xampp-portable/htdocs/mysite1
  ServerName local.mysite1.it
  ServerAlias local.mysite1.it
  <Directory C:/xampp-portable/htdocs/mysite1>
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
    Options Indexes FollowSymLinks
  </Directory>
</VirtualHost>

<VirtualHost *:80>
  ServerName local.mysite2.it
  DocumentRoot C:/xampp-portable/htdocs/mysite2
  <Directory C:/xampp-portable/htdocs/mysite2>
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>
</VirtualHost>

<VirtualHost *:80>
   ServerName localhost
   DocumentRoot C:/xampp-portable/htdocs/
   <Directory C:/xampp-portable/htdocs/>
      Options Indexes FollowSymLinks Includes ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
      Require all granted
   </Directory>
</VirtualHost>


In xampp conf I have the following code:
Code: Select all
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
   Order deny,allow
   #Deny from all
   #Allow from ::1 127.0.0.0/8 \
   #   fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
   #   fe80::/10 169.254.0.0/16
   #ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
   Allow from all
   #Require all granted
</LocationMatch>


I want to access xampp from other PCs on my lan that have an ip in the range 192.168.1.*. When I try to access xammp from other computer in the lan I give the error "Forbidden - You don't have permission to access / on this server."
Another question: with this configuration I can access only the first site. How can I access also the others sites?
danielevigi
 
Posts: 2
Joined: 31. March 2014 12:06
Operating System: Windows 7

Re: Accessing xampp vhost from remote pc on local network

Postby danielevigi » 02. April 2014 09:35

I solved the problem. I added this line on file host of the computer from which I wanted to access the site:
Code: Select all
192.168.1.[ip-on-lan-of-pc-with-xampp] local.mysite1.it
danielevigi
 
Posts: 2
Joined: 31. March 2014 12:06
Operating System: Windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 80 guests