installing both php and django in apache on ubuntu 12.04

April 30, 2013 3.2k views
I have a ubuntu 12.04 droplet that is associated with one domain name. I already have a LAMP stack configured and am serving a php app at some location like I have been recently trying out django now and wish to deploy a home page at the same domain at So is it possible for me to be running both python and php on the same server with python at and php at a sub url of the same domain or at a sub-domain such as I would deeply appreciate a solution to this problem. thanks.
1 Answer
Yes, you would just take the current VirtualHost that you have defined for your PHP enabled website and update the ServerName directive to use:


Then create a new virtual host for your django app:

WSGIScriptAlias / /home/username/public_html/

And you should be all set.

You can also reference this article on the setup:
by Etel Sverdlov
mod_wsgi is a simple and easy to setup tool that serves python web apps from Apache server. It is also one of the recommended ways of getting Django into production. This article covers the steps required to installing an setup mod_wsgi with Apache.
  • Please, please do the tutorial about config python and php project at the same droplet server because a lot of people need it.
    Right now I really want to know how to config wordpress project (php) and flask (python) project at the same droplet.

    So image that 123.456.789.22 is my droplet IP then
    when I using 123.456.789.22/wordpress --> will be wordpress website.
    and 123.456.789.22/flask --> will be flask website.

Have another answer? Share your knowledge.