美文网首页
阿里云 windows server 2012 wampserv

阿里云 windows server 2012 wampserv

作者: jackswang | 来源:发表于2018-01-07 13:52 被阅读0次

一.所需软件

1.wampserver3.0.6_x64.exe

2.notepadplus_7.4.2.0.exe

3.vcredist_x64.exe

4.vc_redist.x64.exe

二.安装软件(请按照顺序安装)

1.安装notepadplus_7.4.2.0.exe

2.安装vcredist_x64.exe

3.安装vc_redist.x64.exe

4.安装wampserver3.0.6_x64.exe

安装时会让你选择notepad可执行文件,这里必须要选择正确,如果没有选择正确会发生错误

三.外网访问www下的内容

1.将网站放入www下

2.将httpd-vhots.conf和httpd.conf 中的 Require local改为 Require all granted

3.到阿里云添加安全组规则,将端口范围设置为 80/80,授权对象为0.0.0.0/0 (如果您服务器监听的是其他端口号,则要添加其他的端口号)

此时通过在浏览器中输入公网Ip地址就可以访问到www目录下的文件了

四.通过端口访问指定网站

您可以通过ip地址+端口号直接访问指定的文件

找到httpd.conf文件,添加

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

这里就是用来监听端口的配置文件,您可以在这里添加所要监听的端口号

然后到httpd-vhots.conf中添加

<VirtualHost *:80>    //端口号
    ServerName localhost 
    DocumentRoot e:/wamp64/www/T1
    <Directory  "e:/wamp64/www/T1/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
<VirtualHost *:81>    //端口号
    ServerName localhost 
    DocumentRoot e:/wamp64/www/T2
    <Directory  "e:/wamp64/www/T2/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

相关文章

网友评论

      本文标题:阿里云 windows server 2012 wampserv

      本文链接:https://www.haomeiwen.com/subject/vkbpnxtx.html