4

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?

Santiago
  • 982
  • 3
  • 14
  • 30

2 Answers2

4

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...
Andy
  • 8,749
  • 5
  • 34
  • 59
  • 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. – Andy Feb 07 '11 at 20:57
  • Ok, so i should list the IPs in the htaccess file for each pc that should have access. Thanks – Santiago Feb 07 '11 at 21:29
  • *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:/myapp. Is the address correct? – Santiago Feb 10 '11 at 18:37
  • *ignore* I forgot that i had to specify the port number in the address. So the address should be: http::8080/myapp – Santiago Feb 10 '11 at 18:43
3

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 root@gmail.com
 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.