![]() ![]() + eb4538c.41b2df8 master -> origin/master (forced update) Resolving deltas: 100% (245/245), completed with 156 local objects. Remote: Total 993 (delta 245), reused 522 (delta 117), pack-reused 0 Updated Homebrew from ff9aa97 to eb4538c. I started with a 'brew update' in order to make sure my homebrew installation was up to date: RYANs-iMac-6:~ alanturing$ brew update Homebrew is 'the missing package manager for macOS' find more information and installation instructions here. This guide assumes Homebrew has already been installed. In order to prepare a local database we'll begin by installing MariaDB, which is an open source replacement for MySQL. ::1 localhost Installing and Configuring MariaDB # localhost is used to configure the loopback interface Here is an example '/etc/hosts' file which maps local requests for 'v' to localhost to be handled by the above Virtual Host: # ServerAlias DocumentRoot "/Library/WebServer/Documents/test/"Ä®rrorLog "/Library/WebServer/logs/test-dev.log"ĬustomLog "/Library/WebServer/logs/test-dev-debug.log" combined This and other Virtual Host directives are to be placed in the '/etc/apache2/extra/nf'. Here is an example Virtual Host configuration with an example of custom logging directives. Verify Syntax of Apache Config FilesĪfter making changes to the '/etc/apache2/nf' file, or any of the configuration files included from the main config (such as the '/etc/apache2/extra/nf' file where the Virtual Hosts are defined) it is good practice to run the 'httpd -t' command to check the syntax of the configuration files: alanturing /Library/WebServer/Documents $ httpd -t I chose to leave the 'User' and 'Group' settings to the default _www as well. We can also see that I've configured a couple of Virtual Hosts which I have mapped for local access in '/etc/hosts'. In the output of the 'httpd -S' command we can see that the DocumentRoot is set to the default location '/Library/WebServer/Documents' change it if you wish. Mutex default: dir="/private/var/run/" mechanism=default Main ErrorLog: "/private/var/log/apache2/error_log" Main DocumentRoot: "/Library/WebServer/Documents" Port 80 namevhost v (/private/etc/apache2/extra/nf:24) Use httpd -S to take a look at the current virtualhosts and configuration: alanturing ~ $ httpd -SÄefault server v (/private/etc/apache2/extra/nf:24) This will gracefully restart the process and apply any new configuration changes. X : debug mode (only one worker, do not detach)Īs we can see, we'll use the httpd -k command with one of the following parameters (start|restart|graceful|graceful-stop|stop) to control the daemon for example:Īlanturing /etc/apache2 $ sudo httpd -k graceful t -D DUMP_MODULES : show all loaded modules S : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG t -D DUMP_RUN_CFG : show parsed run settings t -D DUMP_VHOSTS : show parsed vhost settings L : list available configuration directives ![]() h : list available command line options (this page) e level : show startup errors of level (see LogLevel) ![]() c "directive" : process directive after reading config files C "directive" : process directive before reading config files f file : specify an alternate ServerConfigFile d directory : specify an alternate initial ServerRoot D name : define a name for use in directivesD SERVER_CONFIG_FILE="/private/etc/apache2/nf" Control apache ServiceÄ®xecute the 'httpd -H' command to view the command line options for interacting with Apache: alanturing /Library/WebServer/Documents $ httpd -h D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types" D DEFAULT_SCOREBOARD="logs/apache_runtime_status" D DEFAULT_PIDLOG="/private/var/run/httpd.pid" D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) Setting up ApacheĬheck if apache2 / httpd is already installed (it is on this version of Mac OSX 10.11): alanturing /etc/apache2 $ whereis httpd These services in concert will allow us to host a local development environment for working on WordPress (and other) web projects. This guide will cover installing and configuring MariaDB (an open source drop-in replacement for MySQL), setting up Apache 2.4 (which is already installed on Mac OSX 10.11) along with PHP, and the installation of the WP CLI command line program for managing WordPress installations (including downloading, installing, configuring, enabling themes, plugins, etc.). Setting Up a Local WordPress Development Environment with Apache, PHP, MariaDB, and WP CLI on Mac OSX 10.11 Introduction ![]()
0 Comments
Leave a Reply. |