Set up xampp server on office lan

20,613

Solution 1

Use an .htaccess file or set up permissions in the VirtualHost tags in httpd.conf. All you have to do is put this in a file named .htaccess inside of the folder holding your webpages:

order deny,allow

deny from all

allow from <ip you want>
allow from <ip you want>
allow from <ip you want>
etc...

Solution 2

Perhaps you can try.

open and make sure C:/xampp/apache/conf/httpd.conf

DocumentRoot “C:/xampp/htdocs”
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Allow from all

and open C:/xampp/apache/conf/extra/httpd-vhost.conf add ..

NameVirtualHost name_site:80
 <VirtualHost name_site:80>
 DocumentRoot C:/xampp/htdocs/folder_site/
 ServerAdmin [email protected]
 ServerName xxx.xxx.xxx.xxx
 </VirtualHost>

note: xxx.xxx.xxx.xxx is xampp computer ip. This work on win 7.

If still dosn't work. Try to disable youe windows firewall.

Share:
20,613
Santiago
Author by

Santiago

Updated on July 28, 2022

Comments

  • Santiago
    Santiago almost 2 years

    Im looking to set up a server using xampp within a small office. I will ofcourse secure xampp but in order to make my webapp available to the other 4 PCs on the network do i just create a virtual host? Is there a way to ensure that access to the webapp is only available on the lan?

    The current setup includes 4 pcs sharing an internet connection via a router. How can i set this up as a lan which i can provide access to my webapp?

  • Andy
    Andy over 13 years
    Just a quick side-note, if this does not work for you, you need to check your VirtualHost to make sure it includes AllowOverride All. This allows .htaccess to do its thing.
  • Santiago
    Santiago over 13 years
    Ok, so i should list the IPs in the htaccess file for each pc that should have access. Thanks
  • Santiago
    Santiago over 13 years
    update i can access xampp from a client PC to the server PC. But i cant access the webapp that is being hosted on the server PC - error message is "Object not found". The .htaccess file is inside the folder which has my webapp - C:\xampp\tomcat\webapps\myapp. I can access the server PC by typing the ip address and I assumed that to access the webapp it would be http:<ip address>/myapp. Is the address correct?
  • Santiago
    Santiago over 13 years
    ignore I forgot that i had to specify the port number in the address. So the address should be: http:<ip address>:8080/myapp