How to have PHP and mod_wsgi python app on the same domain?

Posted by Lazik on Server Fault See other posts from Server Fault or by Lazik
Published on 2013-11-07T07:26:11Z Indexed on 2013/11/07 9:57 UTC
Read the original article Hit count: 204

Filed under:
|
|
|
|

I am using apache with mod_wsgi (python3) on ubuntu 12.04.

I have a python app (bottle) which is at www.mysite.com/

In my python app I have routes like www.mysite.com/abbb?q=blab

I would like a path www.mysite.com/forum to resolve to a php app (simple machine forums)

Ideally I would like to use apache to handle the forum part and pass it to php (instead of coding it in the python app). Don't know if it's possible.

I'm new to this, I have read https://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive but I don't understand how to use it.

Here is my apache conf for the mod_wsgi app, I don't know how to specify the PHP portion.

<VirtualHost *:80>
ServerName www.ex.com
ServerAlias ex.com *.ex.com

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}$1 [R=301,L]

WSGIDaemonProcess ex user=www-data group=www-data processes=1 threads=5
WSGIScriptAlias / /var/www/vhosts/ex/app.wsgi


<Directory /var/www/vhosts/ex>
    WSGIProcessGroup ex
    WSGIApplicationGroup %{GLOBAL}
    Order deny,allow
    Allow from all
</Directory>    
</VirtualHost>

© Server Fault or respective owner

Related posts about apache2

Related posts about ubuntu