Set up xampp server on office lan

放肆的年华 提交于 2019-12-10 15:39:56

问题


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?


回答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...



回答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 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.



来源:https://stackoverflow.com/questions/4926396/set-up-xampp-server-on-office-lan

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!