visit
This is my personal macOS workspace setup for web development. If you’d like to install latest technologies and stay up to date, follow my guide and you will enjoy using your macOS computer more than ever. This post will remain updated, as this guide is based on personal preference.
Tested and working on macOS High Sierra, version 10.13.5.
Xcode is an integrated development environment for macOS containing a suite of software development tools developed by Apple for developing software for macOS, iOS, watchOS, and tvOS. Source:
Installation
xcode-select --install
Ta-da
We’re done with it. There’s nothing further for this one. Move on to the next…Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple’s macOS operating system.Source:
Installation
ruby -e "$(curl -fsSL //raw.githubusercontent.com/Homebrew/install/master/install)"
Repositories
Upgrade and update
brew upgrade && brew update
Ta-da
We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.HINT — to learn more about each command and its use, enter brew help [COMMAND]
command, and it will display all details about specific command and each flag it has… If you’d like to learn more, see .
Extends Homebrew and brings its elegance, simplicity, and speed to the installation and management of GUI macOS applications.Source:
Installation
brew install cask
Ta-da
We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.A simple command line interface for the Mac App Store. Designed for scripting and automation. Source:
Installation
brew install mas
Ta-da
We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.A Unix shell that can be used as an interactive login shell and as a powerful command interpreter for shell scripting. Source:
**Configuration**Instead of editing the .zshrc
file, we will make our own and then point it as a source to the main configuration file.
touch ~/.my-zshrc && bash -c 'exec env ${EDITOR:=nano} ~/.my-zshrc'
echo ". ~/.my-zshrc" >> "$HOME/.zshrc"
touch ~/.aliases && bash -c 'exec env ${EDITOR:=nano} ~/.aliases'
Copy/Paste the following content:
touch ~/.functions && bash -c 'exec env ${EDITOR:=nano} ~/.functions'
Copy/Paste the following content:
# Make directory and enter itfunction mkd () { mkdir -p "$@" && cd "$_";}# Copy website and its contentsfunction copy_website () { wget -e robots=off -p -k "$1"}# Extract most know archives with one commandextract () { if [ -f $1 ] ; then case $1 in *.tar.bz2) tar xjf $1 ;; *.tar.gz) tar xzf $1 ;; *.bz2) bunzip2 $1 ;; *.rar) unrar e $1 ;; *.gz) gunzip $1 ;; *.tar) tar xf $1 ;; *.tbz2) tar xjf $1 ;; *.tgz) tar xzf $1 ;; *.zip) unzip $1 ;; *.Z) uncompress $1 ;; *.7z) 7z x $1 ;; *) echo "'$1' cannot be extracted via extract()" ;; esac else echo "'$1' is not a valid file" fi}# Determine size of a file or total size of a directoryfunction fs () { if du -b /dev/null > /dev/null 2>&1; then local arg=-sbh else local arg=-sh fi if [[ -n "$@" ]]; then du $arg -- "$@" else du $arg .[^.]* * fi}
Ta-da
We’re done with it. There’s nothing further for this one. Move on to the next…A proprietary cross-platform source code editor with a Python application programming interface. Source:
**Package Control**Here’s the , but I think it is no longer required. Instead, open Sublime Text, press cmd + shift + p
and type “Install”. It should show “Install Package Control”.
Preferences > Package Settings > Package Control > Settings — User
User Settings will open up… Replace the existing content with the following:
After that, open Preferences **>** Settings
or with a shortcut cmd + ,
and replace the contents in the right pane with the following. Make sure to replace font_face with the one that you installed on the system.
Ta-da
We’re done with it. There’s nothing further for this one. Move on to the next…Apache is already bundled in macOS. However, it is not the latest version and it’s always the best to keep all our workspace dependencies within Homebrew.A free and open-source cross-platform web server, released under the terms of Apache License 2.0. Source:
Across the configuration, you will need to replace all dvlden
occurrences with your system username. Type whoami
in the terminal to see your username, if you don’t know it already.
Stop and unload system-bundled version
Installation
brew install httpd
Configuration
Open configuration file in the Editor: bash -c 'exec env ${EDITOR:=nano} /usr/local/etc/httpd/httpd.conf' Here’s the table of contents. I hope I made it clear enough…Configuration of dynamic virtual hosts
Open configuration file in the Editor:bash -c 'exec env ${EDITOR:=nano}
Replace the file contents with the following:
When we setup our DNSMasq below, we will be able to have automatic dynamic virtual hosts.
Every folder that we make in our ~/Sites
directory, should be lowercase with hyphens, for readability. Think of the folder names as domain names, without TLD. Each folder will be automatically accessible. Use .test
for static websites and use .public
for dynamic sites. If you’re using an PHP Framework like , this will be very handy. It’s like !
Restart
sudo apachectl -e info -k restart
Start a daemon
sudo brew services start httpd
Ta-da
We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.We’re going to use this along with our dynamic virtual hosts configuration. This package will then redirect our specified TLD’s to a localhost.It provides Domain Name System forwarder, Dynamic Host Configuration Protocol server, router advertisement and network boot features for small computer networks, created as free software. Source:
Installation
brew install dnsmasqConfiguration
Start a daemon
sudo brew services start dnsmasqAdd resolvers
Restart a daemon
sudo brew services restart dnsmasqTest it
dig demo.test @127.0.0.1 You should be able to find the following section in your output.
PHP is already bundled in macOS. However, it is not the latest version and it’s always the best to keep all our workspace dependencies within Homebrew.
A server-side scripting language designed for Web development, but also used as a general-purpose programming language. Source:
Installation
brew install php
Installation of ComposerSince we’re using PHP, we are definitely going to need .
brew install composer
Configuration
Open configuration file in the Editor:bash -c 'exec env ${EDITOR:=nano} /usr/local/etc/php/7.2/php.ini'
Here’s the table of contents. I hope I made it clear enough…
Ta-da
We’re done with it. There’s nothing further for this one. Move on to the next…An open-source relational database management system. Its name is a combination of “My”, the name of co-founder Michael Widenius’s daughter, and “SQL”, the abbreviation for Structured Query Language.Source:
Installation
brew install mysql
Start a daemon
brew services start mysql
Configuration (optional)
By default MySQL is installed with a user root
and no password. If you want to configure that, go ahead.
An open-source, cross-platform JavaScript run-time environment that executes JavaScript code server-side. Source:
Installation
brew install nodeNode JS is bundled with NPM, so it will install it along with it… There’s nothing for us to do here, except to optionally install some global packages.A package manager for the JavaScript programming language. It is the default package manager for the JavaScript runtime environment Node.js. Source:
Ta-da
We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.To learn more about each command and its use, enter npm help [COMMAND]
command, and it will display all details about specific command and each flag it has... If you'd like to learn more, see .
A version control system for tracking changes in computer files and coordinating work on those files among multiple people. Source:
Installation
brew install git
Configuration
Make sure to replace name and email with your personal details.
I’m using https
as authentication, so I’ll add the following extra line to a configuration.
git config --global credential.helper osxkeychain
If you are using ssh
authentication, you can set it up this way:
# Test connectionssh -T [email protected]
# > Hi dvlden! You've successfully authenticated, but GitHub does not provide shell access.Ta-da
We’re done with it, but I will add a curated list of commands below. They are highly useful and you might need to memorize some of them for daily use.To learn more about each command and its use, enter _git help [COMMAND]_
command, and it will display all details about specific command and each flag it has... If you'd like to learn more, see .