Next, you can enable the following two handy Apache modules. Scroll down and find the line that says Listen 8080 and change it to: Listen 80 Enable useful Apache modules Let’s open up the Apache configuration file: open -e /usr/local/etc/httpd/nf Change the listening port Now that we have a working web server, we’ll want to make some configuration changes so it works more to our liking - or really just more to the way I like it. We’re going to change that in the following steps. Note, we’re currently pointed to port 8080. It should already be running, so you should be able to point your browser at and see a simple header that says It works! You’ve now installed Homebrew’s version of Apache and configured it to autostart on reboot. Once that’s complete, run the following command to start the Apache service and make sure that it restarts automatically at login. Now install the new version of Apache provided by Homebrew. sudo apachectl stop sudo launchctl unload -w /System/Library/LaunchDaemons/ 2>/dev/null Note: The second command is a single line that has wrapped due to page width constraints in Medium. It doesn’t hurt to run both of the following commands, even on a fresh install. If you already have the pre-installed Apache running, it will need to be shut down first and any auto-loading scripts removed. However, instead of using the delivered version, we’re going to install Apache via Homebrew and then configure it to run on port 80. MacOS 10.15 Catalina comes with Apache pre-installed. sudo mkdir /usr/local/log sudo mkdir /usr/local/log/httpd sudo chgrp -R staff /usr/local/log/httpd sudo chmod -R ug+w /usr/local/log/httpd/ Install and configure Apache Disregard any already exists messages you might get. If you’re going to move on to reading the next piece and install PHP, we’ll be using this same log file location for the PHP logs, too, and have all the logs in one place.įollow these steps to create the appropriate directories and set their permissions. ruby -e "$(curl -fsSL )" Create Apache log file directoriesĪpache comes pre-configured with its own log directories, but we’re going to create our own /usr/local/log/ folder so they’re easy to find when we need to. Note: The following command is a single line that has wrapped due to page width constraints in Medium. The following command will install Homebrew. To do this, you can run the following command from the Terminal. However, I recommend the full install, especially if you’re running Catalina. The Homebrew install command will install the basic Xcode Command Line Tools that it needs. If you’re not interested in installing the entire Xcode app, that’s fine. If you’re working from an upgrade, go into System Preferences and select the Software Update icon to make sure everything is current. If you’ve just done a fresh OS install, you probably won’t need to do this.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |