Take the 2-minute tour ×

I am creating an application on DotCloud where I want to host multiple websites using the same PHP service. I already have one site up and running with the "approot" of that site set to a subfolder of my codebase in my dotcloud.yml file.

I'm guessing that I need to remove my approot definition from my dotcloud.yml file then wrap my nginx.conf settings for each subfolder site in a "server" declaration with the server_name set to my alias domain and the root set to the subfolder for that domain. Unfortunately, because I cannot add aliases to a "sandbox" app, I have no way to test a configuration like this without creating another "live" app.

How do I configure my dotcloud.yml file and nginx.conf files to have one alias point at one subfolder (my current approot) and have a second alias point to a different subfolder (a completely different site and domain) on the same PHP service?

share|improve this question
Can you clarify why you want to serve two different sites, with different code bases (it seems), from the same service? Is it to save resources, to re-use some parts of the code, to access some shared local files...? –  jpetazzo Aug 6 '12 at 10:27

1 Answer 1

Not sure if this is exactly what you are looking for but. You could have one dotCloud.yml with multiple services each pointing to a different approot.


   type: php
   approot: site_1
   type: php
   approot: site_2
   type: mysql

then you could use the command line to assign a different alias to each service.

$ dotcloud alias add app.php1 www.example1.com

$ dotcloud alias add app.php2 www.example2.com

Another option:

If you write your code to be multi-tenet then you can look at the host coming in the header of the request and serve up different websites from the same code base. Django does this pretty much out the box on the python side. Not sure if there is something like it with php.

share|improve this answer
The configuration you describe is what I currently have for our www servers and image servers. What I am trying to do is add another code base (which happens to be multi-tenent based on domain) with additional aliases to the existing www service. –  user1106959 Aug 3 '12 at 19:01
this answer is no longer helpful - the alias command doesn't exist. –  changokun Sep 10 '13 at 17:08

Your Answer


