File structure that supports multiple projects


#1

Hello!

I’m new to dreamhost and would like to know an ideal file structure that supports multiple projects. Here is a description of what I want:

I want to be able to host multiple web projects. Every project should be able to get it’s own subdomain. I also want every project to be able to in a subversion repository (I’m not sure if every project should have it’s own repository or if multiple projects can share one). I also want to be able to use bugzilla/trac (can they manage multiple projects?).

(Sidenote: Is it still as hard to install Trac here on dreamhost as it seems by the wiki article?)

I thought it would be good to get a good file structure from the beginning so I don’t create a mess.

When I connect to my acount through ssh I’m inside my home directory: ~/

I guess I need a folder for every domain, for every subversion repository and for every bugzilla/trac (if I can’t manage multiple projects with one and the same).

Should I have like:

~/project1/
~/project1/svn/
~/project1/bugzilla/ or ~/project1/trac/
~/project2/
~/project2/svn/
~/project2/bugzilla/ or ~/project2/trac/

etc…?

or

~/projects/
~/projects/project1/
~/projects/project2/
~/svn/project1/
~/svn/project2/
~/bugzilla/project1/
~/bugzilla/project2/

etc…?

Any ideas or other tips related to this?

Also if someone would also say how a ruby on rails project would fit in the file structure please add a sidenote about it :slight_smile:

Thanks in advance!

Hope you made it all the way down here =)

Martin Lundberg
Student, Sweden


#2

Dreamhost’s default setup places all domains and subdomains in the top-level of your home directory, but this can be changed when you add the domains or at any time after. These folders are the DocumentRoots for your domains.

~/example.net ~/example2.org ~/sub.example2.org I don’t use Subversion or Trac on DH servers, but I use both at home. Trac does not support multiple projects, so you’ll need to set up Trac directories for each one separately, which also means separate Subversion repositories. I use the a directory structure like this, giving my Trac instances the same name as their corresponding svn repositories:

/var/svn/project1 /var/svn/project2 /var/trac/project1 /var/trac/project2 This could easily be adapted to work here by putting the svn and trac directories into your home directory. This only requires one Trac installation; you can use .htaccess to set up your Trac environments on a per-site/directory basis.

Using multiple Subversion repositories also gives you an easy way to grant access to others on a per-project basis. I group related projects together and put anything that may need unusual permissions into its own repository.

DocumentRoots for Rails sites can be set up the same way as any other site, with one small change. Create the project in its domain folder like your other sites, then modify the root directory in the panel to include the ‘public’ subdirectory (ie, ~/example.com/public).

It’s not everything you’ve asked for, but I hope this helps get you started.


If you want useful replies, ask smart questions.


#3

Hello kchrist!

Thanks for answering my question. Lets see if I get what you mean.

You were thinking about a file structure like this:

~/svn/project1/
~/svn/project2/
~/svn/rubyonrailsproject/
~/trac/project1/
~/trac/project2/
~/trac/rubyonrailsproject/
~/project1.mydomain.com/
~/project2.mydomain.com/
~/rubyonrailsproject.mydomain.com/

After creating the last ruby on rails subdomain I go into dreamhost panel and change the web directory to ~/rubyonrailsproject.mydomain.com/public/

(If I wanted I could add all projects to a ~/projects/projectnames/ too, right?)

I only have to install Trac ones and then multiple trac enviorments (somehow, I’ll learn later) using .htaccess.

I know this is almost just a repeatition of what you said but I want to make sure I understand you.

Thanks again!

Martin Lundberg
Student, Sweden


#4

Yep, you’ve got it. Given your needs, that’s how I would do it.


If you want useful replies, ask smart questions.


#5

Hello again!

About subdomains. Lets say I’ve got a project that I call “bill” which I give the domain: http://bill.mydomain.com, If I then want to add a subversion repository for that project, what should I call that domain? In the subversion dreamhost wiki page they say to create svn.domain.com, but then it’s liek I only got one svn for the whole account. What is my options? http://svn.bill.mydomain.com? http://billsvn.mydomain.com?

Thanks in advance!

Martin Lundberg
Student, Sweden


#6

I’d use svn.sub.example.com. That’s how I do my MySQL hosts: db.(sub.)domain. I think I’d do Subversion hosts the same way if I set any up here.


If you want useful replies, ask smart questions.


#7

Thanks again kchrist!

Martin Lundberg
Student, Sweden