local dev environment - changing wwwroot determined by port |
[eluser]drewbee[/eluser]
Hello All, I have multiple projects, each of which exist at the root on my local machine but exist on completely separate entities out in the web. Also, I am running WAMP but all of this should be taken care of by the apache config directive. I want to setup a type of routing with the http.config but not sure if it is possible. Let's say I have the following structure wwwroot/Project1 wwwroot/Project2 wwwroot/Porject3 What I need to happen, lets say based on the port given to change the webroot directive to actually be at the given project so http://localhost (default, point to www/Project1) http://localhost:81 (point to wwwroot/Project2) http://localhost:82 (point to wwwroot/Project3) so on and so forth. Is this possible to do? Maybe with htaccess? Searching has led me no results anywhere. If anyone else has some suggestions on this one, please let me know. I am not looking to redirect or anything like that, as I want the subfolder to truly be the 'document root' of the current instance. Right now I actually go into the apache httpd.config and edit the webroot value, and restart the server. Edit again. Maybe I can use virtual hosts to toggle between the different roots. I just happened to stumble across this document: http://httpd.apache.org/docs/1.3/vhosts/examples.html
[eluser]drewbee[/eluser]
Looks like this may be what I am looking for: Code: Listen 80
[eluser]TWP Marketing[/eluser]
drewbee, I use a WAMP also ( UniformServer.com ) and the following configuration of httpd.conf and the windows hosts file: Code: httpd.conf The hosts file uses only one port (in case you have other apps needing port access.) It allows me to reference my dev sites by actual full domain name instead of http://localhost/... The DocumentRoot for my installation is "/www/" which will vary depending on your apache configuration. Yours is apparently something like: "/wwwroot/". Season to taste... NOTE: the first two lines of the hosts file seem to be required to correctly resolve the domain names, they must be the first two lines. It caused me some grief and lost time before a kind developer revealed the secret to me... |
Welcome Guest, Not a member yet? Register Sign In |