development setup, multiple installs the easy way
This is an open discussion with 9 replies, filed under Installation.
Search
I am basically using your #1 right now... in Symphony it doesn't really matter as long as you use {$root} everywhere in your templates. It becomes an issue if you would be hardcoding links to other "pages" from textareas, where that link would include that subdirectory.
The simplest way in my eyes is adding a new VirtualHost directive to your Apache config and modify your hosts file. MAMP Pro and VirtualHostX do these for you, but it's just a case of editing text files!
@ thejetster
The nice thing is you don't have to bookmark the urls to your sites, because (with index) localhost shows them all ;-) And if it really has no other disadvantages then the one you listed. I would say it's indeed by far the simplest, as there is NO setup needed at all.
@ nick
I used to do that, maybe you prefer it because you have seperate error logs per site that way?
Am I correct that having proper urls is only because it is nice but option 1 works just as good?
When referring to multicast DNS (aka bonjour) I mistakenly linked to a BIND script, now I fixed the link, to what are just a few lines to setup bonjour to resolve the urls to your virtual sites (setup with virtualdocumentroot):
As super user, create the folder
/etc/resolve
for each TLD domain you want to host on your machine, create a file in that folder that’s named after the tld. EG, if you want to host
.dev
locally you’d create a file named/etc/resolve/dev
inside each file you create in
/etc/resolve
file add two lines:domain dev
nameserver 127.0.0.1fix
AllowOverride All
(not explicitly setup in/etc/apache2/httpd.conf
) by pasting:DocumentRoot /Users/username/Sites/_public
Options Indexes MultiViews FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
AllowOverride all
NameVirtualHost 127.0.0.1:80
VirtualDocumentRoot /Users/username/Sites/%-1/%-2+/site
Inside /etc/apache2/users/username.conf
for a project directory like this:
So now you can access the sites like thus:
http://projectname.dev/
http://beta.projectname.dev/
I used to do that, maybe you prefer it because you have seperate error logs per site that way? Am I correct that having proper urls is only because it is nice but option 1 works just as good?
I do it because it's how production servers are set up, so in my eyes a development environment should be as close as possible. But everyone has their own taste and workflow.
Not only that, but Chrome seems to base autocomplete entries on an entire domain, so my username and password might be different between sites, and it will remember the wrong one. Also, when creating entries or sections it will try to autocomplete things from other sites. This is both good and bad, but I prefer to have the separation.
I'm going to try out the Bonjour/zeronconf method of resolving local addresses tonight.
@Henry and, success? Automatic virtualhost with manual DNS entry works fine with me, but setting up the bonjour dns seems a no-go. I assumed at least you don't need the bind stuff when you setup the bonjour?....
bump
I tried for two evenings to get the bonjour stuff working - I could never get it to answer any request locally, no matter what I tried. It wasn't a complete waste, as I found out more about the various layers of name resolution in OS X than I should ever need to know. :P
I've gone back to adding entries to my hosts file. Though I am going to incorporate that into my project setup script to make it somewhat less painful.
Edit: btw I totally got rid of my local version of bind. I think it was causing issues on Chrome. Every 20th page load or so it would just sit there and do nothing till I went to the address bar and hit enter again.
Yeah pretty much the same here. So your understanding too was that the multicast completely removes the need for bind, that you don't need both the have it working? Lets hope the author of that write up could clarify...
Create an account or sign in to comment.
I am looking into the most simple (like extremely simple, with compromises) way to host several different symphony installs locally on my mac (without making use of mamp pro). Just for development, not even to serve to other machins on the network. I don't need nice url's, just isolated installs, or maybe not even that?
With my mac's build in apache and php running, and mysql (installed) too, so one install in the root of
~/Sites
can run and be accessed with the urllocalhost
, these are the options I think of to add more installs;localhost/sub1
to accesslocalhost/sub1
to accesshttp://sub1.local
to accesshttp://sub1.local
to accessvirtualdocumentroot
multicast DNS, bonjour
What are the disdvantages (like joint errorlogs) of just sticking to 1, or isn't is possible at all? Must multiple symphony installs be on hosts, or may they live in subdirectories of 1 host without conflicts? ea is document root function used in symphony?