Recommend switching to Docker
The new macOS Mojave comes with Apache pre-installed. All we have to do is switch it on. Open Terminal using macOS Spotlight or go to /Applications/Utilities and open Terminal. To check the version of Apache installed run the following command in the Terminal. $ httpd -v macOS Mojave comes with Apache/2.4.34. Apache Tomcat is a widely used web server. It can be installed and run on numerous operating systems like Windows, Linux, and macOS. This article will tell you how to install tomcat on mac step by step. But before installing it, you should enable root user in macOS following article How To Enable Root User Or Change Root Password In MacOS. Make Apache listen only to localhost. Again, in httpd.conf: Listen 80 - Listen 127.0.0.1:80 And restart Apache again: $ sudo apachectl restart Disable Apache in the application firewall (note that you may have already disabled it if you clicked Deny if/when it was asked during the first time you run Apache). Scanpotter for mac os catalina 2017. The thing is macOS runs atop UNIX. So most UNIX software installs easily on macOS. Furthermore, Apache and PHP come preinstalled with macOS. To create a local web server, all you need to do is configure Apache and install MySQL. My current version of Apache httpd is: Apache/2.4.41 My security team told me that I need to update to Apache/2.4.42 or later.How do I do that? Can I run a simple command line that update the Apache httpd version to 2.4.42 or later. Apache configuration file is overwritten when you upgrade, macOS Big Sur: Server version: Apache/2.4.46 (Unix).
I finally switched to using Docker for local development on macOS. While the following tutorial works for macOS Catalina, it has limitations. I recommend following my latest tutorial on installing Apache, MySQL, and PHP on macOS using Docker.
Note: This post assumes you followed installing Apache, PHP, and MySQL on Mac OS X Mojave and have since upgraded to macOS Catalina. If you did not follow the original post, you should follow installing Apache, PHP, and MySQL on macOS Catalina.
When Mac OS X upgrades it overwrites previous configuration files. However, before doing so it will make backups. The print shop for mac version 2 download. For Catalina the original versions may have a suffix of mojave
or be copied to a backup folder on the Desktop. Most of the time, configuring your system after updating Mac OS X is simply a matter of comparing the new and old configurations.
This post will look at the differences in Apache, PHP, and MySQL between Mac OS X Mojave and macOS Catalina.
Updating Apache
Mac OS X Mojave and macOS Catalina both come with Apache pre-installed. As noted above, your Apache configuration file is overwritten me when you upgrade to macOS Catalina.
There were a few differences in the configuration files. However, since both Mojave and Catalina run Apache 2.4, you could simply backup the configuration file from Catalina and overwrite it with your Mojave version.
However, I encourage you to stay up-to-date. As such, you should take the time to update Catalina's Apache configuration. First, create a backup and compare the two configuration files for differences.
Now edit the Apache configuration. Feel free to use a different editor if you are not familiar with vi.
Uncomment the following line (remove #
):
In addition, uncomment or add any lines you noticed from the diff
above that may be needed. For example, I uncommented the following lines:
Finally, I cleaned up some of the backups that were created during the macOS Catalina upgrade. This will help avoid confusion in the future.
Note: These files were not changed between versions. However, if you changed them, you should compare the files before running the commands.
Restart Apache:
Updating PHP
Mac OS X Mojave came with PHP version 7.1 pre-installed. This PHP version has reached its end of life. macOS Catalina comes with PHP 7.3 pre-installed. If you added any extensions to PHP you will need to recompile them.
Also, if you changed the core PHP INI file it will have been overwritten when upgrading to macOS Catalina. You can compare the two files by running the following command:
Note: Your original file may note be named something else. You can see which PHP core files exist by running ls /etc/php.ini*
.
Note: Your original file may note be named something else. You can see which PHP core files exist by running ls /etc/php.ini*
.
I would encourage you not to change the PHP INI file directly. Instead, you should overwrite PHP configurations in a custom PHP INI file. This will prevent Mac OS X upgrades from overwriting your PHP configuration in the future. To determine the right path to add your custom PHP INI, run the following command:
Note: It appears Catalina does not include the PHP Zip extension. This is a popular extension used by many packages. This was one of the reasons I switched to using Docker.
Updating MySQL
MySQL is not pre-installed with Mac OS X. It is something you downloaded when following the original post. As such, the macOS Catalina upgrade should not have changed your MySQL configuration.
Find this interesting? Let's continue the conversation on Twitter.
Every time Apple releases a new version of macOS, I have to go in and re-configure Apache with PHP the way I want it. So this time, I thought I'd automate the configuration changes with a single command.
Prior versions of this article have more in-depth explanations, e.g.
No major change this time - macOS Catalina 10.15.1 ships with: Tool for mac laptop screws.
- Apache 2.4.41 (Mojave 10.14 came with Apache 2.4.34)
- PHP 7.3.9 (Mojave 10.14 came with PHP 7.1.19)
You can check the PHP version with php -v
:
And the Apache version with apachectl -version
:
Seems Apache now has the Multi-Processing Module mpm_prefork_module
enabled by default.
My previous instructions still hold - edit the Apache configuration in /private/etc/apache2/httpd.conf
:
- Uncomment the the PHP and rewrite modules.
- Change the
DocumentRoot
to one in your user folder (the default/Library/WebServer/Documents
is read-only) and - Add make the corresponding change to the
Directory
section, e.g. in the example below,[mylogin]
is your login profile's home directory[www]
is a folder serving the HTML and PHP files
Danger: Running as superuser, with irreversible changes made! Be warned.
Mac os system requirements for adobe cs5. So, all you need is to run this:
- The first regular expression replacement
s/a/b
looks for pattern a and replaces it with b. In this case, it matches a commented out line that starts with#
and uncomments it (replaces with the first match, i.e. without the#
). - The second
s/
does the same for the Rewrite module. - The third replaces the default DocumentRoot and directory - remember to replace
[mylogin]
and[www]
as appropriate. -i
creates a backup since sed will edit the file in-place.
This is basically all I need. Check and then re-start Apache with sudo apachectl -k restart
.
You may use this tiny script echo ' /Users/[mylogin]/[www]/phpinfo.php
to make sure PHP is enabled.
You may refer to my last post on this topic if you need to edit php.ini
also.
Macos Catalina Apache Download
There are many other settings you may need to change depending on your requirements!
Macos Catalina Apache Restart
- If you have overriding
.htaccess
files, then you needAllowOverride All
on the directory in question - The default
ServerRoot
/usr
is really not a good location. - You may also wish to change the Apache service user / group
_www
- if you encounter permission issues accessing files. - Also, the default access control is
Require all granted
- if you want to limit Apache to serve your mac only, useRequire local
instead. - Finally, note I didn't set a sensible
ServerName
.
Macos Catalina Apache Forbidden
Happy PHP-ing.