SSLCertificateFile "/usr/local/etc/httpd/server.crt" Vi /usr/local/etc/httpd/extra/nf ĭocumentRoot "/Users/username/Sites/yourprojectname"ĮrrorLog "/usr/local/var/log/httpd/yourprojectname-error_log"ĬustomLog "/usr/local/var/log/httpd/yourprojectname-access_log" common Open up /usr/local/etc/httpd/extra/nf and add your own SSL based virtual hosts. $ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
#MARIADB MAC OS MOJAVE PLUS#
Save the file plus generate a key and certificate. Replace all lines that say '8443' with '443'. With Zend OPcache v7.3.7, Copyright (c) 1999-2018, by Zend TechnologiesĬhange default 8443 ports to 443 in the SSL configuration file. Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies You should see a message saying, “It works!” If it says "Syntax OK" open browser using. It reports Syntax Ok or detailed information about the particular syntax error. Run a configuration file syntax test to verify/validate the configuration. Uncomment to enable User home directories, Virtual hosts and Secure (SSL/TLS) connections. DirectoryIndex index.php index.htmlĪnd we need to add the FilesMatch directive so that Apache will now process PHP files. DocumentRoot "/Users/username/Sites"Ĭheck that directive DirectoryIndex includes index.php. Servername is disabled by default, set it to localhost: #ServerName ServerName localhostĬhange DocumentRoot it makes up the basic document tree, which will be visible from the web. LoadModule rewrite_module lib/httpd/modules/mod_rewrite.soĪdd the following entry at the end of the LoadModules section: LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so LoadModule userdir_module lib/httpd/modules/mod_userdir.so LoadModule vhost_alias_module lib/httpd/modules/mod_vhost_alias.so LoadModule ssl_module lib/httpd/modules/mod_ssl.so
LoadModule socache_shmcb_module lib/httpd/modules/mod_socache_shmcb.so vi /usr/local/etc/httpd/nfįind Listen 8080 and change it to port 80: Listen 80 You have successfully installed PHP, but you need to tell Apache to use it.Įdit the nf file. The php.ini file can be found in: /usr/local/etc/php/7.x/php.ini. You can watch the Apache error log in a new Terminal tab/window during a restart to see if anything is invalid or causing a problem: $ tail -f /usr/local/var/log/httpd/error_log Set Apache to start now and restart at login $ sudo brew services start httpd
#MARIADB MAC OS MOJAVE INSTALL#
$ brew install httpdĬheck the installation path. Now, let's brew and configure our new Apache version and change it to run on standard ports (80/443).
MacOS automatically adds the compass icon to your folder. Type the following command into your terminal: $ mkdir ~/Sites $ sudo launchctl unload /System/Library/LaunchDaemons/ 2>/dev/null We don't want Apple in control of our web server so let's stop it and prevent it from starting on boot. If successful it should display "Your system is ready to brew." Apache Installation Let's see if everything is working the way it should. Homebrew can self-diagnose and check your system for potential problems. $ /bin/bash -c "$(curl -fsSL )"Īdd the Homebrew taps we need. Homebrew is an excellent package manager for macOS let's install it. This document provides help on getting your macOS development environment up and running with the latest versions of Homebrew, Apache, PHP, etc. MacOS Mojave Setup: Homebrew + Apache + PHP + MariaDB