Report this

What is the reason for this report?

installing both php and django in apache on ubuntu 12.04

Posted on April 30, 2013

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 www.domain.com/php/application/

I have been recently trying out django now and wish to deploy a home page at the same domain at www.domain.com. So is it possible for me to be running both python and php on the same server with python at www.domain.com and php at a sub url of the same domain or at a sub-domain such as php.domain.com?

I would deeply appreciate a solution to this problem. thanks.



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!

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.

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 php.domain.com <br> <br>Then create a new virtual host for your django app: <br><VirtualHost *:80> <br> ServerName domain.com <br> ServerAlias www.domain.com <br> WSGIScriptAlias / /home/username/public_html/domain1.com/MyTestProject.wsgi <br></VirtualHost> <br> <br>And you should be all set. <br> <br>You can also reference this article on the setup: <br>https://www.digitalocean.com/community/articles/installing-mod_wsgi-on-ubuntu-12-04

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.