multiple projects stored outside of C:/wamp/
Posted by: ronnystalker (---.range86-149.btcentralplus.com)
Date: June 27, 2009 06:25AM

I'm new to wampserver and have a vision of how i want to use it and am unsure :

(a) if its possible
(b) if its wise to do it this way

== My Current Set-Up ==

I have many, many existing projects. About a 30 overall and 4 projects that I deal with on a daily basis.

ProjectA is hosted for public access by Hosting Company A on ServerA (PLESK)
ProjectB is hosted for public access by Hosting Company B on ServerB (CPanel/WHM)
etc...
ProjectZ..etc...


All my projects are under version control in a subversion repository which sits on my local machine (Windows XP)

I use both Dreamweaver and PHPED to develop my projects.

On my local machine I have working copies of each project stored in a "projects" folder.
E.g The the web scripts of ProjectA are in:
"C:\Documents and Settings\Me\My Documents\projects\ProjectA\webserve\"

Each of these, local, project folders are structured similar to this:
My Documents/projects/
--ProjectA/
---.svn/
---my_project_notes/
----README.txt
---webserve/
----inc_library
-----MyApp/
------bootstrap.php
-----ZendFramework/
----public_html/
-----.htaccess
-----index.php

As you can see:
* the project folder also contains files and notes that are related to the project, under version control. But these are not necessarily hosted on the public servers. Only the files in the "webserve" folder are uploaded to the live servers.
* public_html/index.php includes scripts that reside in webserve/inc_library/MyApp/ include path.

== My Current Work Cycle ==

One day I'd build my apps using Phing, but for now my method is very direct:

* I tweak the code
* upload to live server
* then refresh the browser to run unit tests /or just see what happened
* back to tweaking code
* at end of day: commit to svn

== My Vision Work Cycle ==

I'd like some extra steps in the cycle like:

* I tweak the code
* test on dev server first,
* back to tweaking code, or
* upload to live server
* then test on live server
* commit to svn
* back to tweaking code


== My Vision Set-Up - Incorporating a Wampserver ==

I really DO NOT want to have move my projects folder into the "C:\wamp\www" folder becuase it would ruin my local file strucure/back ups processes etc.

I really DO NOT want create an extra subversion working copy of each project in that "C:\wamp\www" folder cos it would also be hassle to keep everything synchronised.

So, now i would like use Wampserver to test my projects on my local machine:

If i point my browser to, local, "http:// projectA"
I'd like to cause Wampserver to serve documents that have are stored in:
"C:\Documents and Settings\Me\My Documents\projects\ProjectA\webserve\public_html\"

Likewise, If i point my local browser to "http: //projectB" ...i'd like it to point to the apropriate folder that resides *outside* of the "C:\wamp\www" directory.


This would be very handy.

Also, because projectA and projectB are hosted on different servers, with different set-ups, i'd like to be able to ensure that Wampserver reflects these different configurations and flip between them easily.

Is this possible?

I have read the following tutorial but still can't seem to get them to work cos it shows the files residing within the "C:/wamp/client1" directory:

* [www.trailheadinteractive.com]


How would YOU do it?

I'd love to see a STEP-BY-STEP tutorial that specifically outlines how to acheive these goals - i am sure others would find it useful too.

Any HELP much appreciated.



Edited 7 time(s). Last edit at 06/27/2009 06:47AM by ronnystalker.

Options: ReplyQuote
Re: multiple projects stored outside of C:/wamp/
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: June 27, 2009 10:23AM

yes this is possbile.... except for the bit about wamp changing configuration for files in project B and project A

on the wamp menu ud need to install new version of apache , php and mysql( to suit the other server or if they both have the same version then , install a second copy ans rename it) and then modify the$ config files for this setup...

when u click the wamp menu you can swtich the versoin of php ,mysql , apache and the new settings will acttive..


but i dont know of anyway to make this happen automatically by just using a different folder destination...


apache is the only one i think that allows different settings to different folders being served.





but as for the first part- you will use vhosts c:/wamp/bin/apache/apachex.x.x/conf/extra/vhosts.conf

in apache and your hosts file in c:/windows/system32/drivers/etc/hosts to set it up.


-------------------------------

NameVirtualHost *:80

<VirtualHost *:80>
ServerName project1
DocumentRoot C:\Documents and Settings\Me\My Documents\projects\ProjectA\webserve\project1
#other directives here
</VirtualHost>

<VirtualHost *:80>
ServerName project2
DocumentRoot C:\Documents and Settings\Me\My Documents\projects\ProjectB\webserve\project2
#other directives here
</VirtualHost>

------------------------------


just keep adding blocks like this... you can add extra bits of code here to affect apache for this site..


also you will need to enable vhosts in apache so it will look at this file

c:/wamp/bin/apache/apachex.x.x/conf/httpd.conf


find this 10 lines from the end

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

and change to

# Virtual hosts
Include conf/extra/httpd-vhosts.conf


save and restart wamp




Then open the hosts file in the windows folder i mentioned earlier and add a line for each site

127.0.0.1 project1
127.0.0.1 project2

etc etc

if you need any other help jsut ask.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]



Edited 1 time(s). Last edit at 06/27/2009 10:26AM by stevenmartin99.

Options: ReplyQuote
Re: multiple projects stored outside of C:/wamp/
Posted by: ronnystalker (---.range217-42.btcentralplus.com)
Date: June 27, 2009 07:25PM

Thanks for your speedy reply - its very helpful.

Re: "yes this is possbile.... except for the bit about wamp changing configuration for files in project B and project A "

Still - WampServer makes the config switching a lot easier than other any other method...so i guess thats ok.

But, could I suggest a new WAMPServer feature:

Some kind of "Project Profile" save mechanism and a "Project Profile Switcher".

I guess, from my limited knowledge, this could be done by encapsulating a project's settings and files within a project profile.

Probably not the easiest of tasks. But it would be very handy.

Options: ReplyQuote
Re: multiple projects stored outside of C:/wamp/
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: June 27, 2009 10:29PM

there is already a modulised version of wamp avaiable from the addons menu above and last time i check there was a way of saving settups.. then jsut one click of the menu and ul be able to change from Setup A to Setup B etc but i havent really used it

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: multiple projects stored outside of C:/wamp/
Posted by: ronnystalker (---.range86-136.btcentralplus.com)
Date: July 01, 2009 04:55AM

Thanks again for your tips.

I have managed to supplement my WampServer with the ModulesWamp extensions.
However, I have not spotted any Workspace-like modules that can switch between Server Profiles.

My French is not great. So, I hope i did not miss it via my pigeon-transalation efforts.

For anyone interested in applying this add-on ...here is my Native-English language summary of the installation process outlined in the "Description" page, that is linked-to from this site's Addons page:
[www.wampserver.com]

--
To install ModulesWamp (beta1 version) over Wampserver 2.0
you basically have to :

* Have latest version of WampServer already installed

* Download the latest version of ModulesWamp from [www.wampserver.com]

* Copy and keep for safe-keeping the following two files of the stadard WampServer installation. They will get overwritten when you install (or, to be specific, overlay) the ModulesWamp extension. You will then have them ready if you want to uninstall the ModulesWamp extension in the future.

Create a new folder in the C:\wamp\ directory and name it
C:\wamp\_originals_for_uninstall_ModulesWamp (you could name it anything. But its probably a good idea to have a standard name to keep some consistency between users )

Copy these files into that folder.
* wampmanager.tpl
* scripts/refresh.php

* Unzip the contents of the ModulesWamp file that you downloaded. Then drop those files into the "C:\wamp\" directory (or the directory where Wampserver was installed - if you veered from the default)

(This is when those two files that you just saved will get overwritten)

* Then add a module called ModuleVHosts (which, apperantly is required to make it all work):The published instructions are pretty clear - CTRL+F for "ModuleVHosts" to jump to there within: [www.wampserver.com]

Here is the procedure to follow:
- Start WAMP
- right click on the icon of WAMP and to click on "Install module"
- a console opens asking for the path to the module to install
- copy and paste in the path to "ModuleVHosts", it is in the directory of installation of WAMP/Modules/ModuleVHosts.zip
- press enter
- a description of the module will display in the console, press enter
- You will know it is installed successfully when/if you see the message: "Module installed"
And that it!

You can see the readme files for each module that comes with ModulesWamp by looking in the C:\wamp directory.
named in the form of: readme_[module name].txt

Its in French. But, I used some translation software to get a gist of what each one does.
See
* "Babylon 8.0 r20" available @ [download.cnet.com]
or
* [babelfish.yahoo.com]



Edited 9 time(s). Last edit at 07/01/2009 05:16AM by ronnystalker.

Options: ReplyQuote
Re: multiple projects stored outside of C:/wamp/
Posted by: ronnystalker (---.range86-136.btcentralplus.com)
Date: July 23, 2009 04:47PM

I have managed to get this to work...

One other thing to add is that , because the directory was outside the wamp/www folder i had to add a <directory> directive to allow access to it. (Otherwise i was getting an error message: "Forbidden You don't have permission to access / on this server." )

To solve this, i just copied the directory directive for the wamp/www folder in the main httpdconf

So my final virtual host directive looked like this


<VirtualHost *:80>
ServerName project2
DocumentRoot "C:\Documents and Settings\Me\My Documents\projects\ProjectB\webserve\project2"

<Directory "C:/Documents and Settings/Me/My Documents/projects/ProjectB/webserve/project2/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# [httpd.apache.org]
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride all

#
# Controls who can get stuff from this server.
#

# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1

</Directory>
</VirtualHost>



Edited 3 time(s). Last edit at 07/23/2009 05:18PM by ronnystalker.

Options: ReplyQuote


Sorry, only registered users may post in this forum.