Welcome to WebmasterWorld Guest from 54.144.243.34

Forum Moderators: brotherhood of lan & mack

Development environment for multiple websites

   
7:50 am on Jul 19, 2010 (gmt 0)

5+ Year Member



Hi,

I'm working roughly on around 30 websites. Most of these are Joomla sites. At the moment I'm working on these sites myself, but in the not to distant future I will be working on these websites with another person.

To make this all go as smoothly as possible I'm looking into file version management and development environments.

After doing some research I found the following "tool" for my version control system: [subversion.apache.org...]
Which is hosted on [unfuddle.com...]

That's one option does anyone have any other suggestions?

For the development environment I have been struggling to find a "tool". People use a local Apache in one way or another, either by installing it or using xampp or something along those lines.

This however doesn't seem to be an option for my situation. Around 30 sites, means around 30 different hosts with 30 different setups... I simply don't have the knowledge or the time to "clone" all these different setups on a local machine. If anyone has a suggestion on how to do this, please so share!

So I looked into "developing" on the server the site is hosted but with a sub-domain. This however brings forth the issue of working with a dev.mydomain.com instead of www.mydomain.com. This is a problem because I'm always working with absolute URL's with the WWW infront of it for SEO purposes and having to make the right changes every time between development and live environment to cope with this isn't ideal. Is there a way around this?

Last but certainly not least is the fact that the development environment needs a database as well. While I'm working on the site in development environment, other people are still adding content to the live site. Is there a way to sync to development environment to the live site but not the otherway around?

I have little to no experience with this so any help/tips are greatly appreciated.
11:13 am on Jul 20, 2010 (gmt 0)

WebmasterWorld Administrator brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



For the development environment I have been struggling to find a "tool". People use a local Apache in one way or another, either by installing it or using xampp or something along those lines.

This however doesn't seem to be an option for my situation. Around 30 sites, means around 30 different hosts with 30 different setups... I simply don't have the knowledge or the time to "clone" all these different setups on a local machine. If anyone has a suggestion on how to do this, please so share!


Installing LAMP/WAMP (Windows or Linux + Apache, MySQL and PHP) is not hard to do, in fact it's quite easy.

There are two things you essentially need to do
1) Change a 'hosts' file so that when you want to load up local versions, the domain you designate points to your local server

2) Edit one file in apache (apache2.conf) to map your domains to specific folders in your apache setup.

Typically what I do is use your actual domain names but replace dots with underscores, so you can access both your local and web based sites.

e.g. www.example.com online, www.example_com local
www.webmasterworld.com online, www.webmasterworld_com local

IMO it's an easy way to manage your sites.

Last but certainly not least is the fact that the development environment needs a database as well. While I'm working on the site in development environment, other people are still adding content to the live site. Is there a way to sync to development environment to the live site but not the otherway around?


You can install MySQL with your WAMP/LAMP setup.

If you need access to the online database, you can connect to the databases remotely, i.e. use your local website but the web based database.

Some cheap hosts disallow this, but on the whole you can do this no problem.


Have you noticed huge differences in the server environments of your 30 sites? I'm not 100% sure, but for the likes of Joomla, with PHP/MySQL available and heavily used by it, you shouldn't notice too much difference in hosting.
10:31 am on Jul 21, 2010 (gmt 0)

5+ Year Member



Thank you for your reply.

In addition to this.

Testing on the same server seems a good solution.
But then I'll run into problems with the absolute URL's I'm using...

Is there a way to "trick" my pc/browser into thinking that [mydomain.com...] is actually [dev.mydomain.com?...]
Kinda like you do when you test locally and you change your host file?
10:58 am on Jul 21, 2010 (gmt 0)

WebmasterWorld Administrator brotherhood_of_lan is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Usually if I'm referencing the domain in PHP... I use $_SERVER['SERVER_NAME'] so no changes are required, regardless of where the domain and software is sitting on.

But if there's variables I need to be different locally/live then I have some logic like this at the top of any software I'm running, for example


if(is_file('/var/www/localfile'))
{
// local db connection goes here
$_SERVER['SERVER_NAME'] = 'www.example_com';
}
else
{
// external db connection here
$_SERVER['SERVER_NAME'] = 'www.example.com';
}

... where a file called /var/www/localfile exists on my local machine but not on the live site.

It would be good practice to remove any 'hard encoded' references to the domain where possible...


Is it a huge problem for you? If you can give an example of where your hard encoded references to your domain are, there might be a quick fix solution. If they're embedded in pages of content then it may be a little harder.
7:12 am on Jul 22, 2010 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



- among the version/revision control systems, the "big 3" include git, subversion and cvs (in order of increasing "maturity".)
you might want to check out the other two and understand what the (dis)advantages and philosophical differences are.

- i would suggest you find a development server solution that allows you to use a "dev" subdomain.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month