Apache权限与同一主机中的PHP和Django冲突

时间:2019-01-28 18:23:37

标签: django apache ubuntu-18.04

我正在尝试在同一主机(ubuntu)的apache2下运行php和django。拳头我有 django_app.conf (有效)。

<VirtualHost *:80>

        ServerName siteindjango .com.br
        ServerAlias www.siteindjango.com.br

        LoadModule wsgi_module "/home/example   /imob/env/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"



        ErrorLog /home/example  /imob/error.log
        CustomLog /home/example /imob/access.log combined

        Alias /favicon /home/example/imob/framework/static/favicon.ico
        Alias /static /home/example/imob/framework/static
        Alias /media /home/example/imob/framework/media

        <Directory /home/example/imob/framework>
                <Files wsgi.py>
                Require all granted
                </Files>
         </Directory>

        <Directory /home/example/imob/framework/media/>
                Require all granted
         </Directory>

         <Directory /home/example/imob/framework/static/>
                Require all granted
        </Directory>

WSGIDaemonProcess imob processes=2 threads=5 display-name=%{GROUP} python-path=/home/example    /imob/framework/:/home/example  /imob/env/lib/python3.6/site-packages
WSGIProcessGroup imob
WSGIScriptAlias / /home/example /imob/framework/framework/wsgi.py

</VirtualHost>

和PHP virtuahost不能与其他vhost一起使用。如果将相同的PHP虚拟主机放在其他主机中,则可以正常工作。

php_app.conf

    ServerName siteinphp.com.br
    ServerAlias www.siteinphp.com.br
    #ServerAdmin siteinphp@example.com


    DocumentRoot /home/phpsite/radio
    #ErrorLog /home/phpsite /radio/error.log
    #CustomLog /home/phpsite/radio/access.log combined

    <Directory /home/phpsite/radio>

            AllowOverride All
            Allow from All
           Require all granted
    </Directory>

错误日志:

  

您无权访问此服务器上的/。

apache错误日志:

  

[2019年1月28日星期一18:15:02.707809] [authz_core:错误] [pid 1599]   [客户端60.217.72.16:59870] AH01630:服务器拒绝了客户端   配置:/home/example/imob/framework/framework/wsgi.py

显然django应用程序正在阻止.wsgi脚本中的php权限

1 个答案:

答案 0 :(得分:0)

完整的php_app.conf看起来如何,或者如果文件不起作用,该文件看起来如何?