I tried searching, but I couldn't really figure out the best search terms to find my answer.
I have a Ubuntu 10.04 server with Apache. I want to set up a site that will be versioned, so my file structure will look like:
/var/www/MyApp1.0
/var/www/MyApp1.1
/var/www/dev -> /var/www/html/MyApp1.1
/var/www/test -> /var/www/html/MyApp1.0
Where "dev" and "test" are symbolic links to the other folders. So my URL for those two environments will be "http://my-url.com/dev" or "http://my-url.com/test". For my prod environment, I want the URL in the browser to be just "http://my-url.com", without redirecting to something like "http://my-url.com/prod".
How can I set it up so that the base URL points to a specific version without a redirect changing the URL?
Thanks,
Travis
EDIT:
I feel that I should give more detail about our current setup and make it known that we don't have a ton of time to spend on making a ton of changes. Forgive the length, but I'm trying to paint an accurate image of our current setup, in order to get the best solution.
Our dev team consists of 9 people, 5 that work on our main project (C++), 3 that work on art for our main project, and me, working on all web design to supplement our main project. We use MS SourceSafe for version control. I know PLENTY of people have their gripes with it, but it is something that we have been using for a while and are not looking to change it at this point, since we have too many other priorities.
Each member of the dev team (including myself) works on a Windows workstation. We do not have Apache installed on any of our local machines. Before I started working here, they had a Ubuntu Linux server set up with Apache installed to host the site. They would develop in a dev area on that Linux server and whenever they were going to create a new web build, they would copy the files to their local machine and from there, check them into SourceSafe.
Since I have been here, I set up a Samba share on the Linux server and have it mapped to a network drive on my Windows workstation. This way, I can check files out and in without needing to copy them to my local machine. Since I am now the only person working on web stuff, I leave the files checked out all the time, and wrote a batch script to do the "build" process. Whenever I want to update our test environment with a new version, I run the batch script and it does the following:
- create a new folder to contain the new site version
- copy the files from the dev environment to the new folder
- update the "test" link to point to the new folder
- check the project in to SourceSafe, keeping the files checked out
- label the project, using comments from a text changelog that I update as I make changes
So we do have a version control system in place that may not be the best, but works for us. I suppose that I could stop creating versioned folders and using symbolic links, but I kind of like having the ability to easily switch between different versions by simply and quickly updating a symbolic link.
I truly appreciate the answers letting me know what the actual best practices are (I realize now that I didn't give this topic a good title for my question). I found those very informative, and as someone who has only ever really worked by myself or in a small team of others who are equally inexperienced, I did not know that information before, and will follow those practices for future endeavors.
However, for the sake of time and ease, is there a good way for me to keep my current setup and just redirect the base URL to a different folder without changing the URL? Essentially, I would make /var/www a symbolic link to MyApp1.0, but the problem I would run into there is that I wouldn't be able to access /var/www/dev or /var/www/test anymore.
Thanks again,
Travis