wampserver+阿里云服务器 记一次发布php系统

今天帮朋友发布个系统,刚买的阿里云的云服务器,过程记录下来,作为以后备用!用的是wampserver集成环境。

 

一、为了安全,改掉了默认端口3306.   为什么要改呢?因为中国好多玩黑客玩攻击的人,常用的3306  1433 3389等端口,每天都好多人在尝试攻击!

 

改端口方法很简单,在apache的安装目录中有这个文件:my.ini打开它,里面有句代码叫port=3306, 找到它,改掉即可!

 

二、因为购买的阿里云服务器,windows系统肯定是非常干净不带丝毫其它东西!一般电脑都需要一个VC++运行库,几乎所有电脑都有!如果没有,很多软件会报错,无法安装无法使用!所以再安装PHP环境时遇到这个错误:无法启动此程序,因为计算机中丢失MSVCR110.dll

 

解决办法是去下载电脑相对应32位或64位的VC++运行库,我这里使用的安装包下载地址是:

http://www.microsoft.com/en-us/download/details.aspx?id=30679

 

 

 

三、在服务器上一切都OK后,在别人电脑上打开,报错,提示这个:

Forbidden

You don't have permission to access / on this server.

 

Apache/2.4.9 (Win64) PHP/5.5.12 Server at htm.duuuh.com Port 80

 

 

网是找了很多解决办法,都没有说到点子上,说要找到如下这一段代码,再进行修改,

<Directory />

    Options FollowSymLinks

    AllowOverride None

    Order deny,allow

    Deny from all

Satisfy all

</Directory>

可我每次安装,压根都没有这一段代码!

 

解决办法:

一、

后面灵光一闪,一句一句找,找到这一段。对了,就是这一段,

<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>

 

 

到这里,大功告成!外网可正常访问!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值