dounayan3643 2015-11-02 12:06 采纳率: 0%
浏览 61

本地计算机虚拟主机重定向到Web服务器根目录

I am trying to setup Virtual Hosts for a project on my Mac, I have done this before at work with no problems so I am guessing there is a config file somewhere that is causing the issue, could anyone tell me the files I should be checking for issues like this, for testing I have created the following in:

FILE: /etc/hosts

127.0.0.1 test.co.uk

FILE: /etc/apache2/extra/httpd-vhosts.conf

<VirtualHost localhost:80>
<Directory "/Users/ric/Sites/test">
   Options Indexes FollowSymLinks MultiViews
   AllowOverride all
       Order Deny,Allow
       Allow from all
</Directory>
    DocumentRoot "/Users/ric/Sites/test"
    ServerName test.co.uk
</VirtualHost>

The test directory exists and has an index.php with

<?php echo "Test";

But I am always redirected to the web server root /Users/ric/Sites

I have looked in phps error log which has nothing as it isn't technically an error, apaches access_log has nothing related.

I would appreciate a pointer in the right direction for config files that could be causing this..

I can post my httpd.conf and php.ini if this would help..?

Or is there a way to clean install PHP, remove all current config and start again? As I feel like I am looking for a needle in the haystack.

Regards Ric

  • 写回答

1条回答 默认 最新

  • doucanshou6998 2015-11-02 13:04
    关注

    Instead of

    Order Deny,Allow Allow from all

    use

    Require all granted

    then restart apache

    评论

报告相同问题?

悬赏问题

  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容