Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm building a website where users can learn to build the django website online. So lets say a user user1 wants to build a django website. For this user I want to create a new django website which would be accessible with URL "http://mywebsite/user1". To modify the code there is a online webinterface where user can edit/create new files for his project.

So for user user1 I have django code at "/home/user1/django". Similarly for user userN I have django code at "home/userN/django". User should be able to access this django instance from url "http://mywebsite/userN". Now lets say a request came at "http://mywebsite/userN". At this point I want to launch a new process with the django code from location "home/userN/django".

How do I setup apache in such a way that whenever a request comes for the website of a user (http://mywebsite/user1 ) a new process serves that request?

share|improve this question

migrated from stackoverflow.com Sep 18 '12 at 15:55

This question came from our site for professional and enthusiast programmers.

2  
I doubt anyone is going to help you chew up answers if you don't narrow down your questions to actual problems you haven't been able to solve while trying. Anyway you might find this helpful: redrobotstudios.com/blog/2008/12/12/… –  Hedde Sep 18 '12 at 10:27
    
The above link talks about using one codebase of django for all the subdomains with different databases. I'm very new to django and apache server. So I want to know the path I should follow to solve this problem. –  ajay singh Sep 18 '12 at 11:21
    
You should setup Apache for virtual hosts: httpd.apache.org/docs/2.2/vhosts/examples.html I doubt if it works for your link example. I would go for user1.mywebsite.com , http: //user2.mysite.com In the virtual host config of apache you can point Apache to the right Django dir. –  het.oosten Sep 18 '12 at 13:02
    
In my case websites would be added dynamically. Is there a way I can set up the virtual host dynamically( through code) ? –  ajay singh Sep 18 '12 at 14:01
    
To setup such environments as you plan, I'd strongly recommend you learn and train yourself to set up and pimp apache. If you're an apache ninja then, then turn back to your initial project. SO users will then surely help you to solve detailed issues. –  alk Sep 18 '12 at 14:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.