php 我怎样才能把我的 WAMP 放到网上供别人访问?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4003644/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can i put my WAMP online for someone to access?
提问by Haroldo
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?
我需要在以下界面上设置什么才能做到这一点?
- my wireless router
- windows7
- WAMP
- 我的无线路由器
- Windows 7的
- WAMP
回答by robjmills
This works very easily for me on WinXP.
这对我来说在 WinXP 上很容易工作。
- Fire up the command prompt and enter
ipconfig /all
- get your local IP address - Log into your router and set up port forwarding to forward HTTP to your local IP address
- Click on your WAMP icon and click again on "Put Online"
- Go to your remote IP (you can find it somewhere like http://www.whatsmyip.org/)
- 启动命令提示符并输入
ipconfig /all
- 获取您的本地 IP 地址 - 登录您的路由器并设置端口转发以将 HTTP 转发到您的本地 IP 地址
- 单击您的 WAMP 图标,然后再次单击“Put Online”
- 转到您的远程 IP(您可以在http://www.whatsmyip.org/之类的地方找到它)
回答by Tomás Metcalfe
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 是开源的,而其他的则需要您在试用期后支付少量月费。
回答by Orbit
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.
在您的网络浏览器栏中输入您的 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!
你的好友终于可以看到你的主页了!
回答by Codemwnci
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 上问这个问题
回答by Daniel
- make sure the incoming traffic on port 80 is not blocked by your firewall or ISP - see this video demo
- then, configure your Router to forward: incoming requests to your External IP port 80 towards your Internal IP port 80 - video demo here
- finally test if port open - video demo
回答by rightstuff
There are multiple factors (outside of the actual WAMP server) that will all prevent requests coming in from outside (e.g., 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 (i.e., '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:
然后:
You'll need to open Windows Firewall to allow incoming port 80 (http) and port 443 (https) TCP packets.
You'll need to "port-forward" ports 80 and 443 in the Router (your WiFi box) to the LAN IP of the server.
You'll need to check if your ISP is blocking incoming port 80 (and 443) requests. If it is, you'll need to change the port this VirtualHost is listening-on\binding-to. You can make this test by using an outside proxy website and entering
http://your.public.ip.address/
for the URL to visit. If the request times out, it never made it through. Afterwards, when you change the port for the VirtualHost, test again with URLhttp://your.public.ip.address:port/
(try port 8080).
您需要打开 Windows 防火墙以允许传入端口 80 (http) 和端口 443 (https) TCP 数据包。
您需要将路由器(您的 WiFi 盒)中的端口 80 和 443“端口转发”到服务器的 LAN IP。
您需要检查您的 ISP 是否阻止传入端口 80(和 443)请求。如果是,您需要更改此 VirtualHost 正在侦听\绑定的端口。您可以通过使用外部代理网站并输入
http://your.public.ip.address/
要访问的 URL 来进行此测试。如果请求超时,它永远不会通过。之后,当您更改 VirtualHost 的端口时,再次使用 URL 进行测试http://your.public.ip.address:port/
(尝试端口 8080)。
Taken from Enabling Internet Access of Websites (for WAMP servers)
回答by lemakanit
changing the port from 80 to another port number will work perfect,and please note that changing the port will require a new inbond rule on your firewall and changes on httpd.config file
将端口从 80 更改为另一个端口号会很完美,请注意,更改端口需要在防火墙上设置新的 inbond 规则并更改 httpd.config 文件