如何与网络共享您在本地设置的网站
我最近建立了一个通过 MAMP 运行数据库的新站点。它实际上是一个表达式引擎站点,我正在 localhost:8888 上开发它。
我想知道是否有一种简单的方法可以在我的本地服务器运行时通过我的 IP 地址通过网络与其他人(如客户端)共享该网站。
不确定这是否存在安全问题,但这比将其部署到测试服务器更容易。
I've recently set up a new site that runs a database via MAMP. It's actually an expression engine site and I'm developing it at localhost:8888.
I was wondering if there's an easy way to share the site with someone else over the web (like a client) via my IP address while my local server is running.
Not sure if there are security issues with this, but it would be easier than deploying it to a testing server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
80
转发到您的 IP 和本地端口8888
。确保 apache 不仅可以从本地主机访问(使用您的网络 IP:
8888
进行测试)在防火墙中打开端口
8888
(并不总是需要)将您的 ip 提供给您的朋友
If you are behind a router, you'd need to forward incoming port
80
to your ip and locally port8888
.Make sure that apache is not only availabe from localhost (use your networkip:
8888
to test)Open port
8888
in your firewall (not always required)Give your ip to your friends
这可能会变得复杂,因为(我猜)你在路由器上。您需要将特定端口转发到您的计算机并给出您的 IP 地址。如果您的安全性不高,我在执行此操作时会小心。您还需要配置路由器以接受该端口 (8888) 上的连接。
我一直在本地网络上这样做,但当我需要向客户展示时,我总是使用测试服务器。
This can get complicated because (I presume) you're on a router. You need to forward a specific port to your computer and give out your IP address. If you're not up to scratch with security, I'd be careful when doing this. You'll also need to configure your router to accept connections on that port (8888).
I do this all the time on my local network, but I always use a testing server when I need to show clients.
您需要打开路由器中的端口(假设您位于路由器后面)和防火墙。然后,您需要设置 NAT 将端口 8888 转发到运行 Web 服务器的路由器后面的计算机的 IP 地址。
You need to open the port in your router (assuming you are behind a router) and firewall(s). Then you need to setup NAT to forward port 8888 to the IP address of the computer behind the router that is running your webserver.
取决于您的路由器。大多数 SOHO 路由器都可以选择使用 dyndns 并将流量转发到内部主机。如果您的路由器具有这些功能,则:
查看您的路由器手动的。
Depends on your router. Most SOHO routers have an option to use dyndns and forward trafic to an internal host. If your router have these features, then:
See your router manual.