在阿里云服务器中装wampserver

来源:互联网 发布:单片机c语言讲解 编辑:程序博客网 时间:2024/06/05 15:01

我用的是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就可以在外网访问了

原创粉丝点击