Install Apache On Mac Catalina

Posted on  by 

  1. 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.
  2. In this tutorial, I'll be using my Mac running macOS 10.14 ('Mojave'), but the steps are the same for the other versions of Mac OSX and macOS 10.x (update: I've tested this on Catalina and it works there too). Go to Apache Friends and download the correct version of XAMPP. For this tutorial, I'll be using XAMPP 7.3.2 for OSX.

I have upgraded my laptop from Mojave to Catalina. I do not use my laptop with any of the Apache Services. 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 is the most widely used web server software which is developed and maintained by the Apache Software Foundation. It is an open source software. Apache Tomcat is used to deploy Java Servlets and JSPs. So basically Apache is an HTTP Server, serving HTTP. Tomcat is a Servlet and JSP Server serving Java technologies. Install Apache Tomcat 7. The current Apache OpenOffice supports Apple OS X version 10.7 (Lion), 10.8 (Mountain Lion), 10.9 (Mavericks), 10.10 (Yosemite), 10.11 (El Capitan) and macOS 10.12 (Sierra), 10.13 (High Sierra), 10.14 (Mojave), 10.15 (Catalina). The last OpenOffice version supporting Mac OS X 10.4 (Tiger), 10.5 (Leopard), 10.6 (Snow Leopard) is.

30 25 likes 31,786 views Last modified Dec 7, 2020 11:09 AM

Here is my definitive guide to getting a local web server running on macOS 10.15 “Catalina”. This is meant to be a development platform so that you can build and test your sites locally, then deploy to an internet server. This User Tip only contains instructions for configuring the Apache server, PHP module, and Perl module. I have another User Tip for installing and configuring MySQL and email servers.


Note: This user tip is specific to macOS 10.15 “Catalina”. Pay attention to your OS version. There have been significant changes since earlier versions of macOS. Another note: These instructions apply to the client versions of OS X, not Server. Server does a few specific tricks really well and is a good choice for those. For things like database, web, and mail services, I have found it easier to just setup the client OS version manually.


Requirements:

  1. Basic understanding of Terminal.app and how to run command-line programs.
  2. Basic understanding of web servers.
  3. Basic usage of vi. You can substitute nano if you want.


Optional: Xcode is required for adding PHP modules.


Lines in bold are what you will have to type in. Lines in bold courier should be typed at the Terminal.Replace <your short user name> with your short user name.


Here goes... Enjoy!

Install Apache On Mac Catalina


To get started, edit the Apache configuration file as root:

sudo vi /etc/apache2/httpd.conf


Enable PHP by uncommenting line 186, changing:

#LoadModule php7_module libexec/apache2/libphp7.so

to

LoadModule php7_module libexec/apache2/libphp7.so

(If you aren't familiar with vi, go to line 186 by typing '186G' (without the quotes). Then just press 'x' over the '#' character to delete it. Then type ':w!' to save, or just 'ZZ' to save and quit. Don't do that yet though. More changes are still needed.)


If you want to run Perl scripts, you will have to do something similar:


Enable Perl by uncommenting line 187, changing:

#LoadModule perl_module libexec/apache2/mod_perl.so

to

LoadModule perl_module libexec/apache2/mod_perl.so


Enable personal websites by uncommenting the following at line 183:

#LoadModule userdir_module libexec/apache2/mod_userdir.so

to

LoadModule userdir_module libexec/apache2/mod_userdir.so


and do the same at line 520:

#Include /private/etc/apache2/extra/httpd-userdir.conf

to

Include /private/etc/apache2/extra/httpd-userdir.conf

Now save and quit.


Open the file you just enabled above with:

sudo vi /etc/apache2/extra/httpd-userdir.conf

and uncomment the following at line 16:

#Include /private/etc/apache2/users/*.conf

to

Include /private/etc/apache2/users/*.conf

Save and exit.


Lion and later versions no longer create personal web sites by default. If you already had a Sites folder in Snow Leopard, it should still be there. To create one manually, enter the following:

mkdir ~/Sites

echo '<html><body><h1>My site works</h1></body></html>' > ~/Sites/index.html.en


While you are in /etc/apache2, double-check to make sure you have a user config file. It should exist at the path: /etc/apache2/users/<your short user name>.conf.


That file may not exist and if you upgrade from an older version, you may still not have it. It does appear to be created when you create a new user. If that file doesn't exist, you will need to create it with:

sudo vi /etc/apache2/users/<your short user name>.conf


Use the following as the content:

<Directory '/Users/<your short user name>/Sites/'>

AddLanguage en .en

AddHandler perl-script .pl

PerlHandler ModPerl::Registry

Options Indexes MultiViews FollowSymLinks ExecCGI

AllowOverride None

Require host localhost

</Directory>


Now you are ready to turn on Apache itself. But first, do a sanity check. Sometimes copying and pasting from an internet forum can insert invisible, invalid characters into config files. Check your configuration by running the following command in the Terminal:

apachectl configtest


If this command returns 'Syntax OK' then you are ready to go. It may also print a warning saying 'httpd: Could not reliably determine the server's fully qualified domain name'. You could fix this by setting the ServerName directive in /etc/apache2/httpd.conf and adding a matching entry into /etc/hosts. But for a development server, you don't need to do anything. You can just ignore that warning. You can safely ignore other warnings too.


Turn on the Apache httpd service by running the following command in the Terminal:

sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist


In Safari, navigate to your web site with the following address:


DownloadInstall Apache On Mac Catalina

It should say:


It works!


Now try your user home directory:

http://localhost/~<your short user name>

Install


It should say:


My site works


Now try PHP. Create a PHP info file with:

echo '<?php echo phpinfo(); ?>' > ~/Sites/info.php


And test it by entering the following into Safari's address bar:

http://localhost/~<your short user name>/info.php


You should see your PHP configuration information.


To test Perl, try something similar. Create a Perl test file with:

echo 'print $ENV{MOD_PERL} . qq{n};' > ~/Sites/info.pl


And test it by entering the following into Safari's address bar:

http://localhost/~<your short user name>/info.pl


You should see the string 'mod_perl/2.0.9'.


If you want to setup MySQL, see my User Tip on Installing MySQL.


If you want to add modules to PHP, I suggest the following site. I can't explain it any better.


If you want to make further changes to your Apache system or user config files, you will need to restart the Apache server with:

sudo apachectl graceful

This short guide will assume that you already have already homebrew, xcode-select and java installed on your macOS. If not, run the following commands on your terminal.

Once you are sure that everything is correctly installed on your machine, you have to follow these steps to install Apache Spark

How To Install Apache On Macos Catalina

Step 1: Install scala

Step 2: Install Spark

Step 3: Add environment variables

Install Apache On Mac Catalina Update

Add the following environment variables to your .bash_profile or .zshrc

Step 4: Review binaries permissions

For some reason, some installations are not give execution permission to binaries. Review it and give them if necessary.

Step 5: Verify installation

If everything worked fine you will be able to open a spark-shell running the following command

This should open a shell as follows

We are done! You have successfully installed Apache Spark on macOS

Download

Install Apache Mysql Php On Macos Catalina 10.15

You can also find me on Twitter if you’d like to read similar technical tricks!

Coments are closed