installing both php and django in apache on ubuntu 12.04

  • Posted on April 30, 2013
  • anuragrAsked by anuragr

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.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Yes, you would just take the current VirtualHost that you have defined for your PHP enabled website and update the ServerName directive to use: <br> <br>ServerName <br> <br>Then create a new virtual host for your django app: <br><VirtualHost *:80> <br> ServerName <br> ServerAlias <br> WSGIScriptAlias / /home/username/public_html/ <br></VirtualHost> <br> <br>And you should be all set. <br> <br>You can also reference this article on the setup: <br>