简体   繁体   English

如何将我的 WAMP 放到网上供他人访问?

[英]How can I put my WAMP online for someone to access?

I would like to briefly open up my computer and allow my business partener to see what I've been developing on the my localhost.我想简单地打开我的计算机,让我的业务合作伙伴查看我在本地主机上开发的内容。 I understand there are probably some security issues with this but I only want to open up my computer for a few minutes.我知道这可能存在一些安全问题,但我只想打开我的电脑几分钟。

What do I need to setup on the following interfaces to do this?我需要在以下接口上设置什么才能做到这一点?

  1. my wireless router我的无线路由器
  2. windows7视窗7
  3. WAMP WAMP

This works very easily for me on WinXP.这对我来说在 WinXP 上很容易工作。

  • Fire up the command prompt and enter ipconfig /all - get your local IP address启动命令提示符并输入ipconfig /all - 获取您的本地 IP 地址
  • Log into your router and set up port forwarding to forward HTTP to your local IP address登录您的路由器并设置端口转发以将 HTTP 转发到您的本地 IP 地址
  • Click on your WAMP icon and click again on "Put Online"单击您的 WAMP 图标,然后再次单击“Put Online”
  • Go to your remote IP (you can find it somewhere like http://www.whatsmyip.org/ )转到您的远程 IP(您可以在http://www.whatsmyip.org/之类的地方找到它)

Another option is simply using a tunnelling service like:另一种选择是简单地使用隧道服务,如:

Localtunnel is open source, while the others require you to pay a small monthly fee after a trial period. Localtunnel 是开源的,而其他的则需要您在试用期后支付少量月费。

To allow external connections to your server you have to restart WAMP in online mode.要允许外部连接到您的服务器,您必须以在线模式重新启动 WAMP。

Left-click the WAMP icon and select Put Online.左键单击 WAMP 图标并选择在线。

Wait for the icon status to change to white again.等待图标状态再次变为白色。

Enter your IP into your web browser bar and hit enter.在 Web 浏览器栏中输入您的 IP,然后按 Enter。

If you get the same forbidden page as before hit F5 to let the browser load the newest version.如果您得到与之前相同的禁止页面,请按 F5 让浏览器加载最新版本。

If it's still not working you probably have to enable port 80 forwarding in your router configuration.如果它仍然不起作用,您可能必须在路由器配置中启用端口 80 转发。

Finally your buddy can see your homepage!你的好友终于可以看到你的主页了!

If your Apache server is up and running already on your localhost, then you should just be able to set up a route within your router to point at your computer for traffic coming IN on port 80.如果你的 Apache 服务器已经在你的本地主机上启动并运行,那么你应该能够在你的路由器中设置一个路由来指向你的计算机以接收来自端口 80 的流量。

EDIT: I just checked my router settings, and it calls this 'services'.编辑:我刚刚检查了我的路由器设置,它称之为“服务”。 It allows incoming requests on a specific port to be listened to, and forwards the request onto a specific computer (by IP) attached to the router.它允许侦听特定端口上的传入请求,并将请求转发到连接到路由器的特定计算机(通过 IP)。

You would be better asking this question on superuser.com你最好在 superuser.com 上问这个问题

  • make sure the incoming traffic on port 80 is not blocked by your firewall or ISP -see this video demo确保端口 80 上的传入流量未被防火墙或 ISP 阻止 -请参阅此视频演示
  • then, configure your Router to forward: incoming requests to your External IP port 80 towards your Internal IP port 80 - video demo here然后,配置您的路由器转发:传入请求到您的外部 IP 端口 80 到您的内部 IP 端口 80 - 视频演示在这里
  • finally test if port open - video demo最后测试端口是否打开 -视频演示

There are multiple factors (outside of the actual WAMP server) that will all prevent requests coming in from outside (eg, from the internet) from reaching the running Apache server.有多种因素(在实际 WAMP 服务器之外)都会阻止来自外部(例如,来自 Internet)的请求到达正在运行的 Apache 服务器。

First, you need to make sure you have a static IP address, and preferably also a registered domain name with an "A" record (DNS) set to that IP address - for both the ServerName and all the ServerAlias hosts (ie, 'www') that are used in the VirtualHost.首先,您需要确保您有一个静态 IP 地址,最好还有一个注册域名,其中“A”记录 (DNS) 设置为该 IP 地址 - 对于ServerName和所有ServerAlias主机(即,'www ') 在 VirtualHost 中使用。

Otherwise, if you have a dynamic IP address, use a Dynamic DNS client to sync the changing IP address with the domain name's DNS records.否则,如果您有动态 IP 地址,请使用动态 DNS 客户端将更改的 IP 地址与域名的 DNS 记录同步。

Then:然后:

  1. You'll need to open Windows Firewall to allow incoming port 80 (http) and port 443 (https) TCP packets.您需要打开 Windows 防火墙以允许传入端口 80 (http) 和端口 443 (https) TCP 数据包。

  2. You'll need to "port-forward" ports 80 and 443 in the Router (your WiFi box) to the LAN IP of the server.您需要将路由器(您的 WiFi 盒)中的端口 80 和 443“端口转发”到服务器的 LAN IP。

  3. You'll need to check if your ISP is blocking incoming port 80 (and 443) requests.您需要检查您的 ISP 是否阻止传入端口 80(和 443)请求。 If it is, you'll need to change the port this VirtualHost is listening-on\\binding-to.如果是,您需要更改此 VirtualHost 正在侦听\\绑定的端口。 You can make this test by using an outside proxy website and entering http://your.public.ip.address/ for the URL to visit.您可以通过使用外部代理网站并输入http://your.public.ip.address/作为要访问的 URL 来进行此测试。 If the request times out, it never made it through.如果请求超时,它永远不会通过。 Afterwards, when you change the port for the VirtualHost, test again with URL http://your.public.ip.address:port/ (try port 8080).之后,当您更改 VirtualHost 的端口时,使用 URL http://your.public.ip.address:port/再次测试(尝试端口 8080)。

Taken from Enabling Internet Access of Websites (for WAMP servers)取自启用网站的 Internet 访问(适用于 WAMP 服务器)

将端口从 80 更改为另一个端口号会很完美,请注意,更改端口需要在防火墙上设置新的 inbond 规则并更改 httpd.config 文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM