我正在为我的网络服务器运行 Ubuntu (+LAMP) 堆栈。网络服务器的一切似乎都运行良好。例如我有 index.php 页面
<?php
phpinfo();
?>
在 /var/www/html 和 /var/www/mytestsite.com/ 下 从网络服务器内部,两个站点 @ http://MyServerIPAddress/hello.php
&http://MyServerIPAddress/mytestsite.com/hello.php
都在显示正确的 phpinfo。
当我从服务器外部测试相同的内容时,我只能访问 /var/www/html 内部的
页面但是对
Messagehttp://MyServerIPAddress/hello.php
的页面访问
显示http://MyServerIPAddress/mytestsite.com/hello.php
Not Found
The requested URL /example.com was not found on this server.
Apache/2.4.7 (Ubuntu) Server at *MyServerIPAddress* Port 80.
这是我用于 apache 的 mytestsite.com.conf
<VirtualHost *:80>
ServerAdmin admin@mytestsite.com
ServerName mytestsite.com
ServerAlias www.mytestsite.com
DocumentRoot /var/www/mytestsite.com
</VirtualHost>
并且还将文件夹访问和所有者设置与 /var/www/html 和 /var/www/mytestsite.com 匹配
我需要什么额外的配置才能访问 /var/www/html 文件夹之外的站点?