Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

1 vhost for php and python-django

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
kmchen
Posts: 74
Joined: 2013-04-24 06:29

1 vhost for php and python-django

#1 Post by kmchen »

Hi,

On a Debian Stretch Apache 2.4 I'm asked to create an entry to a python/django application on a vhost holding a php website. The website served as http://website.com, the python/django application would be accessed as http://website.com/djangoApp

I know to do this for a normal python application using Alias directive. But Django requires specific settings I found here: https://docs.djangoproject.com/fr/2.0/h ... i/modwsgi/ that I did not succeed to implement in my specific access per subdirectory needs.

That trial, for example, when accessing to http://website.com/djangoApp leads to the djangoApp directory listing instead of executing scripts:

Code: Select all

<VirtualHost *:80>
        ServerAdmin webmaster@website.com
        ServerName www.website.com

    <Directory /var/www/djangoApp/>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

    WSGIDaemonProcess djangoApp python-path=/var/www/djangoApp python-home=/home/user/Envs/djangoApp
    WSGIProcessGroup djangoApp
    WSGIScriptAlias /djangoApp /var/www/djangoApp//wsgi.py

        Alias /djangoApp /var/www/djangoApp

        WSGIScriptAlias /djangoApp/ /var/www/djangoApp/djangoApp/wsgi.py

        <Directory /var/www/djangoApp>
                Require all granted
        </Directory>

        DocumentRoot /var/www/wp-cfa/
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>

        <Directory /var/www/wp-cfa/>
                Options FollowSymLinks MultiViews Includes
                AllowOverride All
                Require all granted
        </Directory>

        <Location /php5-fpm-status>
                Action php5-fcgi /cgi-bin/fast-cgi-fake-handler virtual
                SetHandler php5-fcgi
        </Location>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
Any help apreciated

Post Reply