Reputation: 63
I have been using Homebrew on my development machines for a long time. Now I am considering to use Homebrew on a Mac Mini Server.
I will use Homebrew to update Mysql, PHP, git and the machine will work as our main web server hosting several websites (around 100K pageviews daily).
I am a little worried because I cannot find many references to the use of Homebrew in a server and production environment.
Does anybody share his/her experience about a similar problem?
Thank you very much.
Upvotes: 2
Views: 709
Reputation: 2737
I am in the process of trying the exact same thing. I wanted to install gitlab with postgres but haven't figured out all the necessary details yet. Here are my assumptions. Please point out any flaws in my thinking!
Things to consider / questions I have:
Homebrew by default installs all software with your user being the owner. This is bad, as most server processes or daemons should have their own user and group for security reasons. So you would need to chown / chmod
the installation directory for that package. I have no idea how this would work out, but it doesn't seem to be a good idea.
I read quite a bit on how to start servers at boot-time instead of at login. Most blogs are plain out wrong about this by the way. You will never have anything start at boot time if you use launchAgents. You must use launchDaemons. Just putting the launchd plist in the right directory should work?
One of the few articles that is actually doing it right:
http://naleid.com/blog/2011/03/05/running-redis-as-a-user-daemon-on-osx-with-launchd
If any of the daemons needs a certain ruby version or gems, I am not sure how to accomplish this.
If you create a user for your daemon to run, this user will not have a shell (probably?) and I guess you will need to use absolute paths for executables then? You can install rbenv where the RBENV_HOME is somewhere user-agnostic, which should work. I am not sure about gems then.
An example of Apple's postgres daemon startup script:
http://www.opensource.apple.com/source/PostgreSQL/PostgreSQL-23/org.postgresql.postgres.plist
com.apple.access_ssh
using dseditgroup
should work?Maybe we can figure this out together as I'd really love to accomplish this as well, and homebrew is such a nice way to manage the installations.
edit: I found a nice tutorial (though a bit dated and using rvm) that explains a few things nicely:
http://jasoncodes.com/posts/mac-os-rails-server
Upvotes: 1