Awesome dude.


Published:

Frontpage
On php | installing | osx | vhosts | migration | homebrew | textexpander

re-installing OSX

Gosh!

It's been a loooong time since I felt "anger/depress" - But this weekend - MY GOD!

I basically spend the whole weekeed re-installing OSX (It should only take 10-15 min. max!)

I must have failed something when copied OSX on my bootable USB!

Reminder: A quick guideline for myself how to setup ready-to-work apps with Homebrew - For next time!


Install Textmate and activate shell terminal

image


Install Homebrew via terminal

    $ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)">

Other good things to install via homebrew - start mysql - close terminal

$ brew install tmux
    $ tmux mysql.server start

Install mySQL

$ brew install mysql       
    $ sudo apachectl start (Apache start)
    $ mysql.server start (start mysql)

PHP.INI

$ mate /private/etc/php.ini.default /private/etc/php.ini

mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock
pdo_mysql.default_socket = /tmp/mysql.sock
error_reporting = E_ALL | E_STRICT
extension=php_exif.so
post_max_size 24M

Setup vhosts

$ mate /private/etc/apache2/extra/httpd-vhosts.conf

Activate in httpd file

$ mate /private/etc/apache2/httpd.conf

- Remove # - 
#Include /private/etc/apache2/extra/httpd-vhosts.conf
#LoadModule php5_module libexec/apache2/libphp5.so

Check hostfile

$ mate /etc/hosts

vhosts code example

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com

DocumentRoot "/Users/william/udvikling/mywebsite/trunk/site/"
<Directory /Users/williamengbjerg/udvikling/mywebsite/trunk/site/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

ServerName mywebsite.localhost
ServerAlias mywebsite.localhost

ErrorLog "/private/var/log/apache2/mywebsit.localhost-error_log"
CustomLog "/private/var/log/apache2/mywebsite.localhost-access_log" common


SQL FIX

$ ls -l /usr/local/var/mysql/
$ sudo chown -R user:admin /usr/local/var/mysql/

Helpers

Textexpander - Quick Insert

CREATE SCHEMA %filltext:name=dbname%;
GRANT ALL ON %filltext:name=dbname%.* TO '%filltext:name=username%'@'localhost' IDENTIFIED BY '%filltext:name=password%';

Mobile debug

 window.open('http://vielskerhunde2.localhost','x','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=no,width=320,height=500');