一、为了安全,改掉了默认端口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后,在别人电脑上打开,报错,提示这个:
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
网是找了很多解决办法,都没有说到点子上,说要找到如下这一段代码,再进行修改,
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
可我每次安装,压根都没有这一段代码!
解决办法:
一、
后面灵光一闪,一句一句找,找到这一段。对了,就是这一段,
AllowOverride none
Require all denied
直接替换成这一段:
Options FollowSymLinks
AllowOverride None
Order deny,allow
# Deny from all
Allow from all
#允许所有访问
Satisfy all
二、找到这一段:
#
# 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
替换成:
#
# 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
到这里,大功告成!外网可正常访问!