热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

在LAN中配置LAMPWeb服务器-ConfigureLAMPwebserverinaLAN

iwantconfigurealampwebservertoshowawebpageonlytotheothershostconnectedontheLAN.We

i want configure a lamp webserver to show a webpage only to the others host connected on the LAN. We can suppose that the ip on the lamp server is: 192.168.2.4 and i want that if a host goes on 192.168.2.4 the server shows a webpage only if the host is connected in LAN.

我想配置一个灯网络服务器,只向局域网上连接的其他主机显示一个网页。我们可以假设灯服务器上的IP是:192.168.2.4并且我想如果主机继续运行192.168.2.4,则只有主机在LAN中连接时,服务器才会显示网页。

What i need to set?

我需要设置什么?

2 个解决方案

#1


1  

In the virtual host file i.e /etc/apache2/sites-enabled/default, you can mention the IP's which you want to allow. Search for 'Allow From' section in the file and edit the IPs you want to add. Don't forget to restart apache2 server by sudo service apache2 restart

在虚拟主机文件中,即/ etc / apache2 / sites-enabled / default,您可以提及要允许的IP。在文件中搜索“允许来自”部分,然后编辑要添加的IP。不要忘记通过sudo service apache2 restart重启apache2服务器

#2


0  

If that pc or server only has private ip you shouldnt configure anything, but if that pc or server has public ip you could create a virtual interface (if you use linux) and configure the virtual host with that interface

如果该PC或服务器只有私有IP,你不应该配置任何东西,但如果该PC或服务器有公共IP,你可以创建一个虚拟接口(如果你使用Linux)并配置具有该接口的虚拟主机


推荐阅读
author-avatar
mobiledu2502924857
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有