Apache 无法使用网站url访问网站(localhost:port-works)

Apache 无法使用网站url访问网站(localhost:port-works),apache,ubuntu,web,virtualbox,Apache,Ubuntu,Web,Virtualbox,我有以下配置: 主机:Windows7 虚拟化软件:VirtualBox 嘉宾:Ubuntu 15.10 32位 apache版本:apache/2.4.12(Ubuntu) 具有以下网站配置:() 我可以访问该网页。但当我尝试时: http://testSite.com/index.html 它不起作用 我想,这是一些重定向问题,因此,我将/etc/hosts更改为以下内容 127.0.0.1 testSite.com 但它仍然不起作用 请指出我做错了什么?因为您正在收听非

我有以下配置:

主机:Windows7

虚拟化软件:VirtualBox

嘉宾:Ubuntu 15.10 32位

apache版本:apache/2.4.12(Ubuntu)

具有以下网站配置:()

我可以访问该网页。但当我尝试时:

  http://testSite.com/index.html
它不起作用

我想,这是一些重定向问题,因此,我将/etc/hosts更改为以下内容

  127.0.0.1     testSite.com
但它仍然不起作用


请指出我做错了什么?

因为您正在收听非标准端口号,即8888,所以必须将此端口号添加到所有URL中

所以你必须使用

http://testSite.com:8888/index.html
补充说明:

这里还混合了Apache2.2和Apache2.4访问语法,因此在使用Apache2.4时,可以删除Apache2.2语法,请参阅注释行

<Directory /srv/www/testSite.com/web/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
#     Order allow,deny
#     allow from all
      Require all granted
      AddHandler mod_python .py
      PythonHandler mod_python.publisher
      PythonDebug On
 </Directory>

选项索引跟随符号链接多视图
不允许超限
#命令允许,拒绝
#通融
要求所有授权
AddHandler mod_python.py
PythonHandler mod_python.publisher
蟒蛇
http://testSite.com:8888/index.html
<Directory /srv/www/testSite.com/web/>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride None
#     Order allow,deny
#     allow from all
      Require all granted
      AddHandler mod_python .py
      PythonHandler mod_python.publisher
      PythonDebug On
 </Directory>