WSGIScriptAlias WSGI脚本别名定义的无效选项

时间:2017-09-08 10:09:20

标签: django apache

我正试图在Windows Server上的Apache上运行Django。 我根据thetrevorharmon和mod_wsgi根据Graham Dumpleton安装了Python,Apache等。

我启动服务器httpd -k start并收到以下错误

C:\Apache24\htdocs>httpd -k start
AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host.example.com] does not exist
AH00112: Warning: DocumentRoot [C:/Apache24/docs/dummy-host2.example.com] does not exist
AH00526: Syntax error on line 55 of C:/Apache24/conf/extra/httpd-vhosts.conf:
Invalid option to WSGI script alias definition.

我的httpd-vhosts.conf

# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "logs/dummy-host.example.com-error.log"
    CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "c:/Apache24/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "logs/dummy-host2.example.com-error.log"
    CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

# Nowe, dodane przeze mnie
# SITE_FOLDER = OctopusWeb
WSGIPythonPath C:/Apache24/htdocs/OctopusWeb
<VirtualHost *:80>
    # YOUR_SITE_URL_HERE.COM
    ServerName localhost 
    # YOUR_SITE_ADMIN_EMAIL@DOMAIN.COM
    ServerAdmin janekpel
    DocumentRoot C:/Apache24
    Alias /static/ C:/Apache24/htdocs/OctopusWeb/static/
    <Directory C:/Apache24/htdocs/OctopusWeb/static>
        Order deny,allow
        Require all granted
    </Directory>

    WSGIScriptAlias / C:/Apache24/htdocs/OctopusWeb/wsgi.py WSGIApplicationGroup %{GLOBAL}

    <Directory C:/Apache24/htdocs/OctopusWeb>
        <Files wsgi.py> Order deny,allow
        Require all granted
        </Files>
    </Directory>
</VirtualHost>

第55行包含

WSGIScriptAlias / C:/Apache24/htdocs/OctopusWeb/wsgi.py WSGIApplicationGroup %{GLOBAL}

你能帮助mi解决这个问题吗?

0 个答案:

没有答案