Skip to content

Instantly share code, notes, and snippets.

@ryangreenberg
Created June 5, 2011 20:36
Show Gist options
  • Save ryangreenberg/1009398 to your computer and use it in GitHub Desktop.
Save ryangreenberg/1009398 to your computer and use it in GitHub Desktop.
Steps to create a new local development site

Steps to create a new local development site

[site] = name of site [root dir] = path to site root [logs] = path to logs directory

Example: site = helloworld root dir = /Users/me/Sites/helloworld logs = /Users/me/Sites/logs

  • Add site directory to /etc/apache2/httpd.conf:

      <Directory "[root dir]/">
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      Allow from all
    
  • Add configuration for vhost to /etc/apache2/extra/httpd-vhosts.conf:

      <VirtualHost *>
          ServerAdmin [email protected]
          DocumentRoot "[root dir]"
          ServerName [site].local
          ErrorLog "[logs]/[site]"
      </VirtualHost>
    
  • Create dir for logs:

    mkdir -p "[logs]/[site]/" chmod 777 "[logs]/[site]"

  • Add domain to /etc/hosts:

    127.0.0.1 [site].local

  • Restart Apache

    sudo apachectl restart

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