Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';我不能让mod_wsgi在MacOSX上与Apache和Django一起工作_Django_Macos_Apache_Mod Wsgi - Fatal编程技术网

Can';我不能让mod_wsgi在MacOSX上与Apache和Django一起工作

Can';我不能让mod_wsgi在MacOSX上与Apache和Django一起工作,django,macos,apache,mod-wsgi,Django,Macos,Apache,Mod Wsgi,我一直试图让mod_wsgi在MacOSX服务器上工作,但我绝对没有运气。我已将LoadModule语句添加到httpd.conf中,并包含以下文件: apache_django_wsgi.conf: WSGIDaemonProcess django WSGIProcessGroup django Alias /plagtest/ "/Users/plagtest/myproject/" <Directory "/Users/plagtest/myproject/"> O

我一直试图让mod_wsgi在MacOSX服务器上工作,但我绝对没有运气。我已将LoadModule语句添加到httpd.conf中,并包含以下文件:

apache_django_wsgi.conf:

WSGIDaemonProcess django
WSGIProcessGroup django

Alias /plagtest/ "/Users/plagtest/myproject/"
<Directory "/Users/plagtest/myproject/">
    Order allow,deny
    Options Indexes
    Allow from all
    IndexOptions FancyIndexing
</Directory>

WSGIScriptAlias /plagtest "/Users/plagtest/myproject/apache/myproject.wsgi"

<Directory "/Users/plagtest/myproject/apache">
    Allow from all
</Directory>
我可以很好地重新启动Apache,但当我浏览到localhost/plagtest/时,会出现“未找到文件”,这是我在错误日志中得到的结果:

File does not exist: /Library/WebServer/Documents/plagtest/

我对Apache并不完全熟悉,而且我相信它可能非常简单,但我无法在网上找到解决方案。在此问题上的任何帮助都将不胜感激。

看起来您的同一路径有两个别名。所以你有一个复制品。删除:

Alias /plagtest/ "/Users/plagtest/myproject/"
<Directory "/Users/plagtest/myproject/">
    Order allow,deny
    Options Indexes
    Allow from all
    IndexOptions FancyIndexing
</Directory>
Alias/plagtest/“/Users/plagtest/myproject/”
命令允许,拒绝
期权指数
通融
范欣德兴指数
如果没有媒体别名,django手册推荐的HTTP conf是:

WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py

<Directory /path/to/mysite.com/mysite>
    <Files wsgi.py>
    Order allow,deny
    Allow from all
    </Files>
</Directory>
WSGIScriptAlias//path/to/mysite.com/mysite/wsgi.py
命令允许,拒绝
通融

我做了这些更改,但仍然运气不佳。我仍然在日志中看到相同的“找不到文件”错误:(不,等等,忘记重新启动Apache:)这确实起到了作用。谢谢!
WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py

<Directory /path/to/mysite.com/mysite>
    <Files wsgi.py>
    Order allow,deny
    Allow from all
    </Files>
</Directory>