Wamp Server:在线,但无法从外部访问 [英] Wamp Server: Online but inaccessible from outside

查看:358
本文介绍了Wamp Server:在线,但无法从外部访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

配置:

OS-> Win 7 x64
Wamp server versions-> wampserver2.2e - php5.4.3 - httpd-2.4.2 - mysql5.5.24
Skype is not installed. Port 80 is available.
hosts file has the lines-> 
127.0.0.1       localhost
::1             localhost
httpd.conf file has the required value `Require all granted` in  #onlineoffline tag

问题:

我需要将服务器置于联机状态(是的,我了解风险,但这是我需要做的临时事情).我也了解类似的问题已经发布,并且我几乎遍历了所有问题及其解决方案(您将在下面找到).

I need to put my server online (yes I understand the risks but this is a temporary thing that I need to do). I also understand that similar questions have been posted and I have gone through almost all of the them and their solutions (you will find out below).

问题陈述: Wamp图标为绿色.状态显示为在线.使用本地主机,一切都可以轻松进行.但是,当我使用我的公共IP时,无法显示页面.我已经检查了访问日志,并且在尝试访问时似乎没有任何日志.

Problem statement: Wamp icon is Green. Status shows as Online. Everything woks without any hassles using localhost. But the moment I use my public IP I get page cannot be displayed. I have checked the access logs and there doesnt seem to be any log for the time I attempt the access.

尝试过的解决方案:(我猜一切都可以)

  • 使用路由器,我尝试进行端口转发.我也尝试过 无需使用路由器.
  • 尝试启用和禁用防火墙.
  • 尝试了允许"行.
  • 尝试安装/删除/重新启动Apache服务
  • 试图将localhost:80更改为<ip>:80
  • 尝试了多个在线/离线切换
  • 尝试安装版本2.5的32位版本
  • 尝试安装64,但版本为2.5
  • 尝试使用Require all granted代码前的空格(从无到2)
  • With router I have tried with port forwarding. I have also tried without using the router.
  • Tried with Firewall enabled and disabled.
  • Tried the "allow" lines.
  • Tried install/remove/restart of Apache service
  • Tried changing localhost:80 to <ip>:80
  • Tried multiple online/offline toggles
  • Tried installing 32 bit variant of version 2.5
  • Tried installing 64 but variant of version 2.5
  • Tried playing with the spaces before the Require all granted code (from none to 2)

注意

在我以前的Windows安装中,所有东西都可以正常工作.重新安装后,我不记得自己的一生,为使它正常工作而进行了更改.我有备份,但是看到绿色图标后就删除了(愚蠢的我!).我必须阅读过无数的解决方案,但我目前仍受困于像这个人一样(wamp服务器论坛).如果有人能帮助我解决这个问题,我将非常感谢.

Everything used to work in my previous installation of Windows. Post re-installing I can't remember for the life of me the settings I changed to get it to work. I had the backup but that I deleted the moment I saw the green icon (foolish me !). I must have read countless solutions but I'm currently stuck like this person (wamp server forum). Would really really appreciate if anyone could help me resolve this.

其他信息:

<Directory "c:/wamp/www/"> 
    Options Indexes FollowSymLinks 
    AllowOverride All 
    # onlineoffline tag - don't remove
    Require all granted 
</Directory> 

推荐答案

回复:静态IP. 该评论被认为意味着您的运行WAMPServer的PC(即Apache)应具有静态IP,以便在您重新启动PC或路由器时,它始终获得相同的IP地址,以便始终从路由器到Web服务器PC进行端口转发.保持不变,因此端口转发始终转发到内部网络内部的正确PC.

Re: Static IP. That comment was supposed to mean that Your PC running the WAMPServer i.e. Apache should have a static IP, so that when you reboot your PC or your router it always gets the same IP address so that the Port Forwarding from your router to your webserver PC always remains the same and therefore the port forwarding always forwards to the correct PC inside your internal network.

在本节中:

<Directory "c:/wamp/www/"> 
    Options Indexes FollowSymLinks 
    AllowOverride All 
    Require all granted 
    # onlineoffline tag - don't remove
    Require all granted 
</Directory> 

您使该语句Require all granted出现两次,只需要执行一次.

You have this statement Require all granted occuring twice, you only need it once.

Apache 2.4.2知道IPV6,因此很高兴接受IPV6范围内的连接.

Apache 2.4.2 is IPV6 aware so it should be quite happy accepting connections in the IPV6 range.

您可以检查Apache Listen指令,httpd.conf文件中可能有类似的内容

You could check your Apache Listen directive, it is possible that you have something like this in the httpd.conf file

Listen 0.0.0.0:80

0.0.0.0部分将告诉Apache仅在IPV4网络上侦听.如果是这种情况,请将其更改为

The 0.0.0.0 part will tell Apache to only listen on the IPV4 network. If that is the case change it to

Listen 80

这样它既可以监听IPV4,也可以监听IPV6.

So that it listens to both IPV4 and IPV6.

Listen 0.0.0.0:80
Listen [::0]:80

您的路由器也支持IPV6吗?否则,路由器将不接受IPV6范围内的任何外部连接,因此,这些连接当然不会通过路由器.检查路由器是否支持IPV6,是否已打开IPV6(可选功能)!

Also does your router support IPV6? If not then any external connections from the IPV6 range will not be accepted by your router, and therefore of course those connections will not make it past your router. Check that your router is IPV6 capable and if it is that you have IPV6 turned on, if it is an optional feature!

这篇关于Wamp Server:在线,但无法从外部访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆