Long time owners of Mac PCs who want to try out unique website hosting solutions may consider this older procedure to convert the personal system into a web server.

Set up your own web server under macOS 10.14 Mojave - this is how it works.

Would you like to develop a web application on your Mac at home? Or maybe it should just be a “theme” for Wordpress, Drupal or another CMS? Then you can either use dozens of cloud offers, work with container solutions and apps, or virtual machines. Or you simply use the on-board resources of macOS. If concerned about additional protection, install the best mac antivirus software you can for added security.

With a little knowledge or courage to use the Terminal app, but also web servers and a text editor, you should be able to follow our guide and start an Apache web server on macOS, so that you can then quickly load HTML pages and View Javascript projects and run PHP scripts yourself (you need Xcode if you want to install additional PHP modules).

Set up a local web server in macOS

The terminal gives you access to text editors like vim or nano. If the operation seems too complicated for you, you can theoretically also use other editors, for example Atom. Type in the terminal:

sudo atom /etc/apache2/httpd.conf

and confirm the entry with Enter. Instead of "atom" you could also write "vi" for vim or "nano" for the nano text editor. You could theoretically use Apple's text edit as well.

According to Lifehacker, “OS X: You need only one tiny command to start a web server from any directory through OS X's terminal. If you've got a web site lying around and need to test it out, this is possibly the fastest way to make that happen (Just navigate to the directory you want to use and enter the following command:

python –m SimpleHTTPServer 8000).

You may want to change the port if you already have something running on 8000, but other than that the command doesn't require much alteration. It's a great little snippet to keep in mind (or in your TextExpander shortcuts) for the next time you need a quick little web server.”

Guest User

Then setup a profile for a guest user "Guest.conf". If this is the case for you, create a profile that matches your username (which you use to log in to macOS) and which is also displayed in the terminal prompt.

Author's Bio: 

This Article Penned by Benjamin Kirby Tennyson.