Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save ryaan-anthony/981c3080dfb027deaefc to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/981c3080dfb027deaefc to your computer and use it in GitHub Desktop.
How to start developing locally on OSX 10.10

create a Sites directory

mkdir ~/Sites

open apache user config

sudo vi /etc/apache2/users/*.conf

and set your config to look like this

<Directory "/Users/*/Sites/">
    Options All
    AllowOverride All
    Require all granted
</Directory>    

open apache virtual host config

sudo vi /etc/apache2/extra/httpd-vhosts.conf

and set your config to look like this (replace 'username')

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /Users/username/Sites
</VirtualHost>

open the main httpd.conf

sudo vi /etc/apache2/httpd.conf

and uncomment:

LoadModule authz_core_module libexec/apache2/mod_authz_core.so
LoadModule authz_host_module libexec/apache2/mod_authz_host.so
LoadModule userdir_module libexec/apache2/mod_userdir.so

and also:

Include /private/etc/apache2/extra/httpd-userdir.conf

open another Apache config file:

sudo vi /etc/apache2/extra/httpd-userdir.conf

and uncomment:

Include /private/etc/apache2/users/*.conf

start apache

sudo apachectl start

your Sites directory is now visible here:

http://localhost/~username/    

hello world to demonstrate project convention

mkdir ~/Sites/hello
echo "Hello, World!" > ~/Sites/hello/index.html

and go to

http://localhost/~username/hello/

install mysql

bash <(curl -Ls http://git.io/eUx7rg)

open bash profile file

vi ~/.bash_profile

and add the following aliases:

alias mysqlstart='sudo /usr/local/mysql/support-files/mysql.server start'
alias mysqlstop='sudo /usr/local/mysql/support-files/mysql.server stop'
alias mysqlrestart='sudo /usr/local/mysql/support-files/mysql.server restart'

IMPORTANT: reload terminal

...

start mysql

mysqlstart

log into mysql

mysql -u root -p

And create a database

create database DB_NAME;
@ryaan-anthony
Copy link
Author

@ryaan-anthony
Copy link
Author

@ryaan-anthony
Copy link
Author

@ryaan-anthony
Copy link
Author

@ryaan-anthony
Copy link
Author

@ryaan-anthony
Copy link
Author

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