Skip to content

Instantly share code, notes, and snippets.

@sn00011
Created September 8, 2012 15:34
Show Gist options
  • Save sn00011/3676112 to your computer and use it in GitHub Desktop.
Save sn00011/3676112 to your computer and use it in GitHub Desktop.
log
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.
If you want to host pages on your local machine to the public, you should
change that to localhost:80, and run `sudo nginx`. You'll need to turn off
any other web servers running port 80, of course.
You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/nginx/1.2.3/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http's default of 80.)
For 10.5 and Apache:
Apache needs to run in 32-bit mode. You can either force Apache to start
in 32-bit mode or you can thin the Apache executable.
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/Cellar/php54/5.4.6/libexec/apache2/libphp5.so
The php.ini file can be found in:
/usr/local/etc/php/5.4/php.ini
If pear complains about permissions, 'Fix' the default PEAR permissions and config:
chmod -R ug+w /usr/local/Cellar/php54/5.4.6/lib/php
pear config-set php_ini /usr/local/etc/php/5.4/php.ini
If you are having issues with custom extension compiling, ensure that this php is
in your PATH:
PATH="$(brew --prefix josegonzalez/php/php54)/bin:$PATH"
If you have installed the formula with --with-fpm, to launch php-fpm on startup:
* If this is your first install:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/php54/5.4.6/homebrew-php.josegonzalez.php54.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist
* If this is an upgrade and you already have the homebrew-php.josegonzalez.php54.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist
cp /usr/local/Cellar/php54/5.4.6/homebrew-php.josegonzalez.php54.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist
You may also need to edit the plist to use the correct "UserName".
Please note that the plist was called 'org.php-fpm.plist' in old versions
of this formula.
==> Summary
/usr/local/Cellar/php54/5.4.6: 487 files, 37M, built in 6.1 minutes
@sn00011
Copy link
Author

sn00011 commented Sep 9, 2012

Set up databases to run AS YOUR USER ACCOUNT with:
unset TMPDIR
mysql_install_db --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

To set up base tables in another folder, or use a different user to run
mysqld, view the help for mysqld_install_db:
mysql_install_db --help

and view the MySQL documentation:

To run as, for instance, user "mysql", you may need to sudo:
sudo mysql_install_db ...options...

Start mysqld manually with:
mysql.server start

Note: if this fails, you probably forgot to run the first two steps up above

A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
mysql -uroot

To launch on startup:

  • if this is your first install:
    mkdir -p ~/Library/LaunchAgents
    cp /usr/local/Cellar/mysql/5.5.27/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  • if this is an upgrade and you already have the homebrew.mxcl.mysql.plist loaded:
    launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    cp /usr/local/Cellar/mysql/5.5.27/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

You may also need to edit the plist to use the correct "UserName".

==> Summary
/usr/local/Cellar/mysql/5.5.27: 6385 files, 222M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment