Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

paulshryock/Local-Development-Setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local Development Setup

Start local development from scratch without reinventing the wheel

Maintenance

Quick Start

Follow the Table of Contents and use what you need.

Table of Contents

Setup Instructions

Operating System

TODO: Add Operating System content

  • MacOS
  • Setup: [https://dev.to/therealdanvega/new-macbook-setup-for-developers-2nma]
    • Applications
      • Browser
        • Google Chrome
        • Safari
        • FireFox
      • Chat: Slack
      • Cloud Storage
        • Backup and Sync from Google
        • OneDrive
      • Code Editor
        • MacDown
        • Sublime Text
      • Database Management: Sequel Pro
      • Development
        • Koala
        • LiveReload
        • PhoneGap
      • Font Management: Font Book
      • FTP: FileZilla
      • Giphy Capture
      • Git: GitHub Desktop
      • Image Optimization: ImageOptim
      • Search: Alfred
      • Shell
        • iTerm
        • Oh My ZSH
        • Z
      • List Creation: Wunderlist
      • Video Conferencing: Zoom
      • Virtual Machines: Virtual Box
      • Window Management: Spectacle
  • Windows
    • 10
    • 7
  • Linux
    • CentOS
    • Ubuntu

Server

  • Apache
    1. Stop and unload pre-installed Apache (MacOS)

      $ sudo apachectl stop
      $ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
    2. Install and start Apache

    3. Configure Apache, add Virtual Hosts and SSL

      • Edit Apache Config File: /conf/httpd.conf

        • Add Define localhost_location "path/to/folder"

        • Replace Listen 8080 with Listen 80

        • Uncomment LoadModule socache_shmcb_module lib/httpd/modules/mod_socache_shmcb.so

        • Uncomment LoadModule brotli_module lib/httpd/modules/mod_brotli.so

        • Uncomment LoadModule ssl_module lib/httpd/modules/mod_ssl.so

        • Uncomment LoadModule http2_module lib/httpd/modules/mod_http2.so

        • Uncomment LoadModule vhost_alias_module lib/httpd/modules/mod_vhost_alias.so

        • Uncomment LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so

        • Replace User with local User name

        • Replace Group with local Group name

          • Group staff (MacOS)
        • Replace #ServerName www.example.com:8080 with ServerName localhost

        • Update DocumentRoot and <Directory> locations with "${localhost_location}"

        • Replace AllowOverride None with AllowOverride All

        • Find and replace:

           <IfModule dir_module>
           	DirectoryIndex index.html
           </IfModule>

          with:

           <IfModule dir_module>
           	DirectoryIndex index.php index.html
           </IfModule>
          
           <FilesMatch \.php$>
           	SetHandler application/x-httpd-php
           </FilesMatch>
        • Uncomment Include /usr/local/etc/httpd/extra/httpd-vhosts.conf

        • Uncomment Include /usr/local/etc/httpd/extra/httpd-ssl.conf

      • Edit Virtual Hosts Config File: /conf/extra/httpd-vhosts.conf

        # Replace Your_Domain_Name with your domain (i.e. example.test)
        # Replace Project_Name with your project folder name
        <VirtualHost *:80>
            DocumentRoot "${localhost_location}"
            ServerName localhost
            <Directory "${localhost_location}">
                Require all granted
            </Directory>
        </VirtualHost>
        
        <VirtualHost *:80>
            DocumentRoot "${localhost_location}/Project_Name"
            ServerName Your_Domain_Name
            <Directory "${localhost_location}/Project_Name">
                Require all granted
            </Directory>
        </VirtualHost>  
        
        <VirtualHost *:443>
            Protocols h2 http/1.1
            DocumentRoot "${localhost_location}/Project_Name"
            ServerName Your_Domain_Name
            <Directory "${localhost_location}/Project_Name">
                Require all granted
            </Directory>
            SSLEngine on
            SSLCertificateFile "${localhost_location}/Project_Name/certs/server.crt"
            SSLCertificateKeyFile "${localhost_location}/Project_Name/certs/server.key"
        </VirtualHost>
      • Generate SSL Certificate files

        # Replace Your_Domain_Name with your domain (i.e. example.test)
        # Replace Project_Name with your project folder name
        cd Project_Name
        mkdir certs
        cd certs
        openssl req -x509 -out server.crt -keyout server.key \
          -newkey rsa:2048 -nodes -sha256 \
          -subj '/CN=Your_Domain_Name' -extensions EXT -config <( \
           printf "[dn]\nCN=Your_Domain_Name\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:Your_Domain_Name\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
      • Edit SSL Config File: /conf/extra/httpd-ssl.conf

        • Find/replace 8443 with 443
    4. Control Apache (MacOS, Linux)

      sudo apachectl start
      sudo apachectl stop
      sudo apachectl -k restart
    5. Visit http://localhost

  • NginX
    • TODO: Add NginX content
  • Microsoft IIS
    • TODO: Add Microsoft IIS content

DNS

hosts file

  • Open hosts file and add local websites

    127.0.0.1 localhost
    127.0.0.1 example.com
    127.0.0.1 www.example.com
hosts file location
  • MacOS: /etc/hosts
  • Windows: C:\Windows\system32\drivers\etc\hosts
  • Linux: /etc/hosts

Local DNS Masking

DNS Flushing

  1. Flush DNS
    • MacOS: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    • Windows 7: ipconfig /flushdns
  2. Clear browser cache:
    • MacOS
      • Chrome: cmd + shift + delete

Database

  • MySQL

  • MariaDB

    • Install MariaDB
    brew update
    brew install mariadb
    brew services start mariadb

    To stop the server:

    brew services stop mariadb
  • SQLite

  • PostgreSQL

Database Management

Programming Language

PHP

  • Install PHP

    • Install XCode Command Line Tools

      xcode-select --install
    • Install Homebrew (see below)

    • Install Mojave Required Libraries (MacOS Mojave)

      $ brew install openldap libiconv
      
    • Install Apache (see above)

    • Install PHP

      $ brew install php@5.6
      $ brew install php@7.0
      $ brew install php@7.1
      $ brew install php@7.2
      • TODO: See if this also works:

        $ brew install php@7.3
    • Switch to PHP 5.6

      $ brew unlink php@7.2 && brew link --force --overwrite php@5.6
  • Check PHP version: php -v

Ruby

TODO: Add Ruby content

Node.js

TODO: Add Node.js content

Go

TODO: Add Go content

Content Management System

TODO: Add Content Management System content

  • WordPress
  • Cockpit
  • Netlify CMS

Static Site Generator

TODO: Add Static Site Generator content

  • Eleventy
  • Jekyll

Version Control

TODO: Add Version Control content

  • Git
    • GitHub

Package Management

  • Homebrew

    • Is Homebrew installed?

      $ brew --version
    • Install Homebrew

      $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    • Fix/correct Homebrew

      $ brew doctor
    • Update Homebrew

  • npm

    • TODO: Add npm content
  • Chocolatey

    • TODO: Add Chocolatey content
  • apt-get

    • TODO: Add apt-get content

Cloud Storage

TODO: Add Cloud Storage content

  • OneDrive
  • Google Drive
  • DropBox
  • Box

Symbolic Links

MacOS, Linux

Otherwise known as symlinks, they are like pointers to another place. While you don't have to actually move the folder you are referencing, you can create a pointer to it that behaves as if you did. —Chris Coyier

ln -s /path/to/original/ /path/to/link

Windows

You can create symbolic links using the mklink command in a Command Prompt window as Administrator. To open one, locate the “Command Prompt” shortcut in your Start menu, right-click it, and select “Run as Administrator”. —How-To Geek

# Without any extra options, mklink creates a symbolic link to a file. The below command creates a symbolic, or “soft”, link at Link pointing to the file Target :
mklink Link Target

# Use /D when you want to create a soft link pointing to a directory. like so:
mklink /D Link Target

# Use /H when you want to create a hard link pointing to a file:
mklink /H Link Target

# Use /J to create a hard link pointing to a directory, also known as a directory junction:
mklink /J Link Target

Roadmap

Upcoming changes are indicated by TODO.

Contributing

If you'd like to contribute, please read the Code of Conduct, then fork the repository and use a feature branch. Pull requests are welcome.

Your First Contribution

Working on your first Pull Request? You can learn how from this free series, How to Contribute to an Open Source Project on GitHub.

Contributors

Name Role
Paul Shryock Owner

Links

Licensing

The code in this project is licensed under GNU General Public License v3.0.

About

A roadmap with shortcuts and suggests for setting up a local machine for development

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published