Tutorial to be transferred to blog post.
Starts with Apache version 2.4.48
Linux Directories Demystified:
/bin – Binaries — should be
/binaries/boot – Boot Files — should be
/boot-files/etc – Configuration Files — should be
/configuration-files/home – Users’ Folder —
/homeactually works here/lib – Libraries — should be
/libraries/usr – User Binaries — should be
/user-binaries/var – Variable Files — should be
/variable-files
Crazy that we use abstractions for words as short as "binaries." Abstractions such as /usr for "User Binaries" are incredibly unhelpful.
When you install a program, where does it go?
On Mac, the program is stored in an individual folder inside /Applications.
What is a binary?
An executable file compiled from source code to machine code.
If Mac apps are stored in /Applications, what are the apps inside /usr (user-binaries)?
These are mostly command line / linux related apps such as ssh-keygen.
What is the libexec folder supposed to contain?
Executable machine code used by other programs.
The process:
1. Keep your docroot as the default /Library/WebServer/Documents, changing this will give you permission issues with a 403 error.
2. Add the option Indexes to the docroot XML tag to allow Apache to list out all websites located within the directory. It should look like this:
DocumentRoot "/Library/WebServer/Documents"
<Directory "/Library/WebServer/Documents">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks Multiviews
MultiviewsMatch Any
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>3. Install PHP with:
brew install phpxcode-select --install prior for this php install to work.4. Add index.php as an option prior to index.html so apache will look for PHP files first:
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>Seeming impossible, I've made a switch to Docker to try and run an Ubuntu image off MacOS. So far, setup has been frustrating and difficult.
Setup Docker and access a container via command line:
docker pull ubuntuordocker pull ubuntu:18.04docker start container_name
docker attach container_name
Docker also doesn't allow you to use apt-get update with success. Program seems quite unintuitive, and all answers on Google are unhelpful.
Switch to MAMP...
Want to participate?
Create a free Chris Courses account to begin