mac上的apache vhosts无法识别

时间:2016-10-11 02:51:13

标签: macos apache

我试图启用虚拟主机,但由于某种原因它无法被识别。

的/ etc /主机

127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost 
127.0.0.1       trekfed.cutlerplace.net

/private/etc/apache2/httpd.conf

LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so

# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf

/private/etc/apache2/extra/httpd-vhosts.conf

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/usr/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
    CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "/usr/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"
    CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common
</VirtualHost>

Include /private/etc/apache2/extra/vhosts/*.conf

/private/etc/apache2/extra/vhosts/trekfed.conf

<VirtualHost *:80>

    LogLevel info

    ServerName trekfed.cutlerplace.net
    ServerAdmin cheng@trekfederation.com

    # Static files
    DocumentRoot "/Users/arcee123/Documents/trekfed"
    Alias /static/ /Users/arcee123/Documents/trekfed/static/

    <Directory "/Users/arcee123/Documents/trekfed/static">
        Order deny,allow
        Allow from all
    </Directory>

    # WGSI configuration
    WSGIDaemonProcess trekfed.cutlerplace.net processes=2 threads=15 display-name=%{GROUP} python-path=/Users/arcee123/Documents/trekfed/:/Users/arcee123/Documents/VirtualEnvs/venv-trek/lib/python3.5/site-packages

    WSGIProcessGroup mysite.com

    WSGIScriptAlias / /Users/arcee123/Documents/trekfed/trekfed/wsgi.py

    <Directory "/Users/arcee123/Documents/trekfed">
        <Files wsgi.py>
            Order allow,deny
            Allow from all
        </Files>
    </Directory>

</VirtualHost>

当我执行apachectl -S时,这是回复:

VirtualHost configuration:
ServerRoot: "/usr/local/opt/httpd24"
Main DocumentRoot: "/usr/local/var/www/htdocs"
Main ErrorLog: "/usr/local/var/log/apache2/error_log"
Mutex default: dir="/usr/local/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/usr/local/var/run/apache2/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="daemon" id=1
Group: name="daemon" id=1

当我运行apachectl configtest时,我期待两个虚拟主机的警告,以及另一个警告(如果需要)。但我得到的唯一回应是Syntax OK

我错过了什么?我无法告诉我为了让虚拟主体失去我所缺少的东西。将vhost地址放入浏览器的唯一响应是默认的apache响应。

感谢。

0 个答案:

没有答案