I used to maintain a PHP 5.2 brew and I used it with someone else's 5.3 brew for Drupal dev. You shouldn't need to mv the built in php from apple. The homebrew way is to only use /usr/local and maybe just preference /usr/local/bin in PATH to make your custom builds the default.
How different is it for Ubuntu intallation? Will this tutorial help with ubuntu 10.04? Thanks
I would be curious to know if you've found many issues with deploying sites developed using this setup on production machines with different setup (like traditional lamp)
I've come across a few minor issues with a few modules, which is actually a good thing as they where issues with modules under Nginx that I may not have known about otherwise and have fixed those that I can.
As for standard development, no issues, other than trying to figure out what to do with all my free time now that everything is so quick and easy :)
Nice video. I have a few suggestions on how to improve things.
The <a href="http://code.google.com/speed/public-dns/">Google DNS</a> IP addresses are 126.96.36.199 and <strong>188.8.131.52</strong> not <strong>184.108.40.206</strong>.
In my experience <a href="http://thekelleys.org.uk/dnsmasq/doc.html">dnsmasq</a> is a better and more lightweight DNS solution for dev environments over BIND.
Your PHP FPM config seems to massively overspeced for a local dev environment. I'd recommend the following settings:
pm.start_servers = 3
pm.min_spare_servers = 3
pm.max_spare_servers = 5
pm.max_requests = 500
This config means you don't have idle threads sitting around consuming memory. Given that you up the memory limit to 256M, your dev environment could consume upto 8.75G of RAM (35*256M). The above defaults are saner for most devs.
"sudo -i" is preferred over "sudo -s" for becoming root.
visudo is the preferred method for editing the /etc/sudoers file under Linux. I don't know if OSX support this, but if it does you should use it as it stops you creating an invalid config file.
Where using your own username "`whoami`" (without the quotes) can be used to input the current user's name. for example 'drush dl drush-make-6.x --destination="users/`whoami`/.drush"'
You can use [CTRL]-L should clear your terminal, instead of typing "clear" all the time
<strong>Note:</strong> I emailed this to Brian last night because Mollom was misbehaving.
Why aren't you installing drush from homebrew? And did you know you can install drush_make by the following drush command: drush dl drush_make
This will download drush_make and install it in the right directory.
Damn, I'm stuck. Aegir 1.5 is out, but that patch was not applied... So I ran through the hostmaster process, but with some warnings (about reloading nginx). I restarted my mac, but aegir.ld is not working. When checking mysql, there is an aegirld database.
When trying to run that postmaster command again, I run into a mysql error.
How can I analyze what's wrong? Something wrong with the DNS? Where is aegir.ld set?
ping & dig aegir.ld are working... When opening aegis.ld I get this in the url: file:///Applications/Safari.app/Contents/Resources/ With the message the server can't be found. Is there a way to check if nginx is working?
Ok, did some more research. I still had an error in my php-fpm conf. I corrected it. Now everything is up. But aegir.ld is not working. Is the hostmaster command supposed to add a vhost to nginx? Because it is not there.
How can I clean out all the hostmaster stuff and start that command over again? Or could you tell me where the aegir.ld vhost is. In which conf file? And what should be in there?
I've gone through all of this on a Lion system that was upgraded from Snow Leopard and is up to date with Apple software updates.
Having similar troubles to Nicolas where the first time I tried to install hostmaster there were errors saying that nginx couldn't be restarted - I had to put my username *and* a group name into the nginx.conf file (I haven't set up nginx manually before so i didn't realize that was necessary in Step 3) to get nginx to stop complaining when I restart it.
Anyway, I cleared out aegir/hostmaster files as suggested here and re-installed it. So I'm at the end of the process after having gone through each step with no more warnings or errors, I can ping test.ld and dig test.ld says NOERROR.
I can see that there are running master/worker processes for nginx and for php-fpm, i can connect to and see the aegirld database tables.
This all looks good to me, except that when I actually try to visit aegir.ld in any browser (FF/chrome/safari) I get "Unable to connect, Firefox can't establish a connection to the server".
I'm kind of out of ideas as to how I should go about debugging this any further, let alone fixing it, although I have a feeling (hope) that it is a config issue somewhere that should be easy enough to fix once it has been identified. I'm also not sure if what I'm experiencing is an issue with the DNS, the nginx server or something else entirely...
Brian, any ideas for further things that I could try to isolate the problem?
Stuart helped me get this working.
So, some hopefully helpful feedback on this process:
1. The nginx config file referenced in the article wasn't the right one (it has been updated now)
2. Many people will have macports installed, if you do the steps to clean out macports could be helpful to come before trying to install homebrew, or at least a warning that this should be done before starting - this worked for me http://guide.macports.org/chunked/installing.macports.uninstalling.html
3. Not sure if it is related to #2, but I had to wipe (or rename) /usr/local before installing homebrew - http://apple.stackexchange.com/questions/9992/homebrew-wants-me-to-delet...
4. I had to change the order of the entries in /etc/paths so that usr/local/bin was at the top
5. Not really something that everyone will come across, but having an apostrophe in your root password for MariaDB will cause aegir to not be able to verify the server or build new sites - to fix this, change the password for the database then click "edit" on the unverified server and update the password record in aegir
oh, i'd also like to mention that the step where you try to disable Apache is supposed to return an error if you don't have Apache running, so in this case error = good.
Just before you jump into step 7, you should do yourself a favour and open up activity monitor to make sure that you can see processes running for nginx, mysqld and php-fpm. Unfortunately my experience is that you're unlikely to get 100% success just copying and pasting these instructions into terminal - there will be some amount of debugging required for each system.
If you've followed the steps here and you can see all three then you're probably good to go for the aegir installation, if you're missing one or more of those working processes then the installation will *definitely* fail - but possibly not before dumping a bunch of files on your system that will need to be rooted out manually before you can re-attempt the installation.
I installed everything to test out Aegir, but I would like to add vhosts to nginx to quickly install existing sites (without importing them in aegir), site-by-side with the aegir install. How to do this? I tried adding a vhost in the nginx.conf file, but it isn't working... Any advice?
Mostly converted (but not tested due to lack of internets on the plane) here:
I sat down to do some work today to find that for the first time I can only get to my local (.ld) sights when I have an internet connection? With wifi turned off / disconnected I cant access aegir or any local sites but as soon as I connect I can? I haven't made any changes to any settings... Any suggestions on where I should start?
Very frustrating indeed, and hours of searching hasn't led me to a viable solution. Bonjour would be so practical, but I turned it off for now because I'm often working without an internet connection.
Good old /etc/hosts is doing the trick... for now :-(
Great post nonetheless. Thanks!
I had tried this previously, but I must be doing something wrong.
Although I can dig/ping .ld urls with wifi off, safari keeps telling me "you are not connected to internet"
It works using Firefox, but not Safari and Chrome!?
I don't know if anyone else observed this behavior, but this is how it is for me.
I thought, this can't be true. So I restarted my machine, opened Chrome, Safari and Firefox, opened mysite.ld, turned wifi off and refreshed all three. Only Firefox displayed the site without an internet connection. Of course, I did this about 50 times! I tried different variations and sometimes Firefox didn't display the page, but mostly it would. It boggles my mind.
Just (re)did this on a fresh install of osx lion
Thought it might be worth mentioning the following updates
### homebrew installation ###
(as shown on the homebrew git page)
/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/instal...)"
### Library ALT ###
Library Alt is no longer maintained by git user adamv. He has indicated to use the following git
This includes a new version of php and mariadb
### PHP.INI ###
I also added the following link
ln -s /usr/local/etc/php.ini /etc/php.ini
I could have also changed the Configuration File (php.ini) Path => /usr/local/etc/
### 403 Forbidden ###
Funny thing, nginx is giving me a 403 forbidden error on my hostmaster installation and my newly created sites.
I have to change the permissions of settings.php to 444 instead of 440 (granted by postmaster)
haven't yet found a solution
The 403 forbidden was caused by the php-fpm user. Wrong user was running the process.
Somehow I didn't link the right file, or whatever. User error.
Great stuff, and it all works well for me except:
Does anyone get the content of a bona fide php error message in any of their logs with this configuration, and if so, which log?
I have run and re-run the install, double- and triple-checked my work, which is not to say I got it right, and all I ever get is a message saying that php-fpm caught SIGSEGV in its log:
/var/log/nginx/php-fpm.log -> /usr/local/Cellar/php/[version]/var/log/php-fpm.log
if and only if it is the sort of error that causes nginx to throw a 502, and I have yet to get anything at all in
For most PHP errors, like removing a module directory, I just get a 500 and nothing useful anywhere. I don't plan on deleting directories, but when troubleshooting Aegir imports is smack-dab in the path of doing anything, it's useful to see what is missing and why.
I get this error when i try to ensure the configuration :
bash-3.2# named-checkconf /etc/named.conf
/etc/named.conf:4: open: /etc/rndc.key: file not found
bash-3.2# named-checkzone ld /var/named/db.ld
/var/named/db.ld:1: SOA record not at top of zone (N.ld)
/var/named/db.ld:8: no TTL specified; zone rejected
/var/named/db.ld:10: no TTL specified; zone rejected
/var/named/db.ld:11: no TTL specified; zone rejected
zone ld/IN: loading from master file /var/named/db.ld failed: not at top of zone
zone ld/IN: not loaded due to errors.
any idea why?! thanks