用于虚拟主机的新DocumentRoot工作

时间:2018-06-13 07:05:47

标签: php apache virtualhost

我安装了xampp,它通过运行apache在localhost和默认文档root(/ Applecations / XAMPP / xamppfiles / htdocs)工作

为mydomain.com和文档root设置新的虚拟主机后:(/ Users / myusername / Public / Sites / myProjectFolder)它可以工作,但是去了文档根地址:(/ Applecations / XAMPP / xamppfiles / htdocs)和new记录根源剂量工作

我的httpd-vhost.conf:

<VirtualHost *:80>
    ServerName mydomain.com
    ServerAlias www.mydomain.com
    DocumentRoot "/Users/myusername/Public/Sites/myProjectFolder"
    ErrorLog "/private/var/log/apache2/mydomain.com-error_log"
    CustomLog "/private/var/log/apache2/mydomain.com-access_log" common
    ServerAdmin admin@mydomain.com
        <Directory "/Users/myusername/Public/Sites/myProjectFolder">
            Options Indexes FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
</VirtualHost>

0 个答案:

没有答案