鍍金池/ 問答/PHP  Linux/ 在阿貍云ECS上用端口配置Apache虛擬主機,沒效果……

在阿貍云ECS上用端口配置Apache虛擬主機,沒效果……

公司目前只有一個域名通過備案,網(wǎng)站已經(jīng)上線,我想為開發(fā)配個虛擬主機,所以用端口來區(qū)分。
Cent7系統(tǒng),httpd-vhost.conf 里的配置如下(假設(shè)公司域名 my.com):

這是我配得,用8081,防火墻已開放,且netstat顯示httpd已監(jiān)聽該端口

<VirtualHost *:8081>

DocumentRoot "/home/my/www"
ServerName www.my.com
ServerAlias my.com
ErrorLog "/home/my/logs/error_log"
CustomLog "/home/my/logs/access_log" combined

<Directory "/home/my/www">
    SetOutputFilter DEFLATE
    Options FollowSymLinks
    AllowOverride All
    Require all granted
    DirectoryIndex index.php
</Directory>

</VirtualHost>

下面是原來配好的,域名也是 my.com

<VirtualHost *:80>

DocumentRoot "/home/ecs/www"
ServerName www.my.com

</VirtualHost>

現(xiàn)在問題是,我在瀏覽器地址欄里鍵入
www.my.com:8081/index.php

結(jié)果顯示的還是
/home/ecs/www/index.php

為什么不是
/home/my/www/index.php

請問哪里配錯了呢?謝謝大家!

回答
編輯回答
背叛者

在阿里云后臺的安全組中添加你的端口配置

clipboard.png

2018年8月3日 02:07