Apache 将我的主机指向库/Web服务器/文档中的用户/用户名/站点

Apache 将我的主机指向库/Web服务器/文档中的用户/用户名/站点,apache,laravel-5,server,Apache,Laravel 5,Server,I(在macbook pro Yosemite 10.10.5上运行)有一个包含以下内容的主机文件: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot “/Users/samir/Sites/theblog/” ServerName theblog.dev ServerAlias www.theblog.dev ErrorLog "/usr/local/var/log

I(在macbook pro Yosemite 10.10.5上运行)有一个包含以下内容的主机文件:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot “/Users/samir/Sites/theblog/”
    ServerName theblog.dev
    ServerAlias www.theblog.dev
    ErrorLog "/usr/local/var/log/apache2/dummy-host2.example.com-error_log"
    CustomLog "/usr/local/var/log/apache2/dummy-host2.example.com-access_log" common
</VirtualHost>

服务器管理员webmaster@localhost
DocumentRoot“/Users/samir/Sites/theblog/”
ServerName theblog.dev
服务器别名www.theblog.dev
ErrorLog“/usr/local/var/log/apache2/dummy-host2.example.com-error\u log”
CustomLog“/usr/local/var/log/apache2/dummy-host2.example.com-access_log”通用
对于位于/Users/samir/Sites/theblog/的文件夹,我希望能够从转到访问它,但现在访问/theblog的唯一方法是,如果我将其复制并粘贴到/Library/WebServer/Documents,我如何将位置更改为Users/samir/Sites?我如何使url工作

顺便说一下,我用的是laravel 5


提前谢谢你

我认为您正在使用Laravel应用程序

请尝试以下方法:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot “/Users/samir/Sites/theblog/public”
    <Directory /Users/samir/Sites/theblog/public/>
      Allow from all
    </Directory>
    ServerName theblog.dev
    ServerAlias www.theblog.dev
    ErrorLog "/usr/local/var/log/apache2/dummy-host2.example.com-error_log"
    CustomLog "/usr/local/var/log/apache2/dummy-host2.example.com-access_log" common
</VirtualHost>

服务器管理员webmaster@localhost
DocumentRoot“/Users/samir/Sites/theblog/public”
通融
ServerName theblog.dev
服务器别名www.theblog.dev
ErrorLog“/usr/local/var/log/apache2/dummy-host2.example.com-error\u log”
CustomLog“/usr/local/var/log/apache2/dummy-host2.example.com-access_log”通用

是否使用名称VirtualHost*:80启用了VirtualHost?抱歉?什么意思?在哪里?Apache需要一个NameVirtualHost指令来启用位于httpd.conf文件中的virtualhostIs?