Search

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 url localhost, these are the options I think of to add more installs;

  1. create a bunch of subdirectories in the root for all the installs, using localhost/sub1 to access
  2. as 1 but setup virtualhosts without hostfiles using virtualdocument root and localhost/sub1 to access
  3. as 2 but manually add lines to my hostfile for each site, http://sub1.local to access
  4. as 2 and use multicast DNS, http://sub1.local to access
  5. adding a new VirtualHost directive to your Apache config and modify your hosts file (manually editing 2 files)

virtualdocumentroot
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?

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):

  1. As super user, create the folder /etc/resolve

  2. 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

  3. inside each file you create in /etc/resolve file add two lines:

    domain dev
    nameserver 127.0.0.1

  4. fix 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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details