Skip to content

Install Dotspotting locally for Snow Leopard

sconnelley edited this page Jan 24, 2011 · 9 revisions

This outlines my steps to getting Dotspotting up & running locally on my Macbook, 10.6.6

Few gotchas I ran into:

Needed to turn PHP short tags

Fix annoying mysql socket problem

needed to install PHP mycrypt module

  1. If you don't have Git, install it: http://git-scm.com/

  2. grab copy of dotspotting @ https://github.com/Citytracking/dotspotting

  3. move whole thing into a web enabled folder, like /Users/user/Sites or /Library/WebServer/Documents

  4. Install MYSQL. Download DMG from: http://dev.mysql.com/downloads/mysql/

    /* Follow instructions from installer */
    can install preference panel & startup scripts (pref pane did not work for me)
    
    /* need to add 'mysql' to path */
    open bash_profile, (~/.bash_profile)
    add this: export PATH=/usr/local/mysql/bin:$PATH
    
    /* Start & Stop commands if pref panel doesn't work for you */
    In Terminal app, type:
    /* Start */
    sudo /usr/local/mysql/bin/mysqld_safe
    or
    sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
    
    /* stop mysql */
    sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
    
    recommend creating alias, stick in bash_profile
    alias start_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM start"
    alias stop_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM stop"
    alias restart_mysql="/Library/StartupItems/MySQLCOM/MySQLCOM restart"
    
  5. set up users & database, (using Terminal app) /* set password for root */ mysqladmin -u root password {new-password} mysqladmin -u root -p{new-password} -h localhost password {new-password} mysqladmin -u root -p reload

     /* create new database */
     mysql -u root -p
     > create dotspotting;
    
     /* create new user for dotspotting, obviously change username & password */
     mysql -u root -p
     > CREATE USER 'dotperson'@'localhost' IDENTIFIED BY 'alldots';
     > CREATE USER 'dotperson'@'%' IDENTIFIED BY 'alldots';
     > GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON dotspotting.* TO 'dotperson'@'localhost';
     > GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON dotspotting.* TO 'dotperson'@'%';
     > FLUSH PRIVILEGES;
    
    
     /* load schema's */
     look at README.DATABASE.md in Dotspotting folder, but it goes something like this:
     mysql -u root  -p dotspotting < schema/db_main.schema
     mysql -u root  -p dotspotting < schema/db_users.schema
     mysql -u root  -p dotspotting < schema/db_tickets.schema
    
  6. Fix mysql socket /* needed to create a symbolic link for mysql.sock probably a better way */ sudo mkdir /var/mysql sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

  7. Config PHP You'll need to enable "Web Sharing", in System Preference's -> Sharing Panel

    /* Enable PHP */
    open /etc/apache2/httpd.conf
    uncomment this line: LoadModule php5_module        libexec/apache2/libphp5.so
    restart apache
    
    /* create php.ini */
    cd /etc
    sudo cp php.ini.default php.ini
    sudo chmod 666 php.ini
    	
    /* need to allow php short tags */
    open php.ini
    change 'short_open_tag = Off' to 'short_open_tag = On'
    
    /* need to install mcrypt php module */
    Thankfully found this: http://michaelgracie.com/2009/09/23/plugging-mcrypt-into-php-on-mac-os-x-snow-leopard-10.6.1/
    
    restart apache (turn 'web sharing' on & off)
    
  8. create virtual host & config apache to point to the www folder, here is helpful article -- http://blog.kukiel.net/2009/09/how-to-add-virtual-hosts-in-snow.html

  9. rename config file in config folder to "dotspotting.php" and update the settings. Mainly the database stuff.

  10. should be it

Clone this wiki locally