在阿里云服务器中装wampserver

我用的是64位的Windows server 2012 R2 64位,所以下载wamp时装64位的。

装wamp时可能会遇到例如缺少msvr110.dll、ddl140啊之类的各种乱七八糟的问题,度娘了一下午,发现了只要安装visual C++2012或visual C++2015就好了,其实都可以,但是一定要注意版本!!!一定要是64位的。安装wampserver的最后会分别提示是否使用IE和notepad分别作为localhost和文本文件的打开方式,此时如果没有安装notepad,在之后使用时会出错,所以可以选择先下载安装 notepad++。

安全组配置结束,这时点击wampserver—>Apache—>httpd.conf和httpd-vhosts.conf修改访问权限:
将 httpd.conf内onlineoffline tag标签后面和httpd-vhosts.conf中的Require local改为Require all granted(前者是只允许本地访问,后者是允许全网访问,详见Apache2.4改动日志),之后便可以在外网中访问服务器部署的wampserver了。

此时应该访问本地localhost没问题了,但是外网可能还是访问不了,于是:
网是找了很多解决办法,都没有说到点子上,说要找到如下这一段代码,再进行修改,
解决办法:
一、

<Directory />
    AllowOverride none
    Require all denied
</Directory>

直接替换成这一段:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
#    Deny from all
    Allow from all
#允许所有访问
    Satisfy all
</Directory>

二、找到这一段:

<Directory "d:/wamp/www/">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all
    #
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don't remove    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

替换成:

<Directory "d:/wamp/www/">
   #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride all
    #
    # Controls who can get stuff from this server.
    #
#   onlineoffline tag - don't remove
    Order Deny,Allow
#    Deny from all
#  Allow from 127.0.0.1
    Allow from all
</Directory>

重启wamp就可以在外网访问了

  • 0
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值