Now, we will create a nf file to configure our document root. You will get a similar path for your Mac. You can merge the above two commands into one by running the following command.įor me the user document root path is the following. Now, run the following command to create the Sites directory. Run the following command in the Terminal to switch to the user home directory. So, open Terminal and get ready to create the user level document root directory. The system level document root in macOS Catalina is located in the following directory.įor the user level we can create a directory called Sites in user directory.
One is at the system level and the other is at the user level. This is the location in the computer file system from where the files are accessed when we visit the in a browser.ĭocument Root is a directory where we put our website files. In case you don't get to see the above output then run the following command to check the error. We will change this is the following sections. If you want to stop the Apache server then run the following command.Īnd to restart Apache server run the following command.Īfter starting Apache server go ahead and test it by opening a browser like Safari or Chrome and visit You will get to see the following output in your browser.īy default, the file is getting served from /Library/WebServer/Documents directory. When you use sudo in the terminal then you will be prompted to enter your admin password to proceed.
To start Apache web server run the following command. Note! macOS Catalina comes with Apache 2.4.41 To check the version of Apache installed run the following command in the Terminal. Open Terminal using macOS Spotlight or go to /Applications/Utilities and open Terminal. The new macOS Catalina comes with Apache pre-installed. Lets go ahead and configure our LAMP stack development environment on macOS Catalina.
#Mac start apache server how to#
If you are using macOS Mojave then check out this tutorial How to install Apache, MySQL, PHP on macOS Mojave 10.14
We will be using the pre-installed Apache and PHP and we will download and setup MySQL database. To change the default shell check the tutorial How to change default shell to bash on macOS Catalina.
#Mac start apache server upgrade#
Kindly upgrade your applications.Īpple has also made zsh as the default shell.
#Mac start apache server 32 bit#
Not sure why I had to take this mysterious detour - probably something local to my machine, but if you're having trouble after following the guide above, see if it helps.Note! Support for 32 bit apps is removed in Catalina so, all your 32 bit applications will no longer work. Just to be clear, leave the original file where it is, untouched and unharmed throughout this step. After which, I was able to delete the duplicated file and everything now works without issue. What I did was duplicate that file in the same folder and changed the duplicate's name to 'index.html', leaving the original in situ.īoth local and user sites then loaded. This contains the text "It works!" referred to in the post. However, if, like me, you still can't get the local host site to load, try the following: You should find a file at /Library/WebServer/Documents/. I tried logging out and back in (still no joy), then restarting the mac (still no joy). Just a note, in case anyone has the same issue.