Mac OSX版(酋长)虚拟主机 - 挑战配置自定义虚拟主机

问题描述 投票:0回答:1

我在我的Mac配置的本地Apache服务器。我想自定义的配置虚拟主机前:project1.local等..

我可以访问本地主机文件的根目录是默认/库/ Web服务器/文档

我创建文件夹/库/ Web服务器/文件/ typo3project内新的文件夹

比我列入/etc/apache2/httpd.conf:包括/private/etc/apache2/vhosts/*.conf

而且里面的虚拟主机,我创建自定义的虚拟主机配置文件:typo3project.local.conf

我收到403错误(您没有权限访问....在此服务器上。)

我设置文件夹的权限的。drwxr-XR-X

typo3project.local.conf

<VirtualHost *:80> 
    DocumentRoot "/Library/WebServer/Documents/typo3knjiga/" 
    ServerName typo3knjiga.test 
    <Directory "/Library/WebServer/Documents/typo3knjiga"> 
        AllowOverride All 
        Require all granted 
    </Directory> 
</VirtualHost>
apache localhost virtualhost osx-elcapitan
1个回答
1
投票

您的虚拟主机配置不指定DirectoryIndex。如果没有启用选项指标,这可能导致403,因为是当你要求http://typo3knjiga.test/没有返回允许的资源。假设你有一个index.html或index.php文件,尝试添加以下内容:

<VirtualHost *:80>
    ...
    DirectoryIndex index.html index.php
</VirtualHost>

BTW你不提它,但我假设你已经添加一条记录到你的/etc/hosts文件,如:

127.0.0.1 typo3knjiga.test
© www.soinside.com 2019 - 2024. All rights reserved.