![]() ![]() For me, who regularly works with Web servers, I can do anything on my personal computer just the same as I can on a Web server. For many people I know and work with-great with computers but not a geek, it’s easy to appreciate the nice interface and reliability and features and so forth, without an awareness of the underlying Unix stuff. One of the main reasons I prefer Macs is that it’s Unix (based on Free BSD, since the creation of Mac OS X) without being too Unix-y. I’m not trying to start an argument over the best computer, I’m just saying I like the Mac. A few weeks ago, The Rocket Yard ran an article detailing the many services that will be removed from macOS Server in the near future.I primarily use a Mac for everything I do (and by “primarily” I mean just about 99.9% of the time), and have for years. Today, I’ll discuss how to bring back one of those services - web hosting - using both the Apache web server that is built into macOS and the full MAMP suite. Most Mac users don’t realize it, but macOS comes with its own built-in web server. Apache is an open-source web server that has been available since 1995, and as of 2016, it was the engine behind 46% of all websites and 43% of the top million websites in terms of traffic. Having a web server built into macOS is perfect for those who want to share information in a small workgroup or set up and test sites on a development web server before deploying them to an internet server. These instructions show you how to set up Apache server in macOS High Sierra. You’ll need to have some knowledge of the Terminal app and how to run command line programs, an understanding of web servers, and a familiarity with the vi editor. To begin, we edit the Apache configuration file as root:Ī web server is relatively useless without a server-side scripting language with which to handle interactions the most popular languages are PHP, Perl, and Python. ![]() In this example, we’ll enable PHP and Perl. To do so, you’ll need to uncomment line 176 of the configuration file. #LoadModule php7_module libexec/apache2/libphp7.so Next, type an x over the # at the beginning of the following line to delete the # comment marker: In the vi editor, you can do this easily by typing 176G to go directly to line 176. We want to do the same to be able to run Perl scripts, which is in line 177 of the configuration file. To save your changes in the editor, type :w! The configuration file should then looks something like this around line 176 (see screenshot below): Editing the Apache configuration file in the vi editor Use your arrow key to go down to the beginning of the next line, then type the x over the # to delete the comment marker. We still need to enable personal websites by uncommenting line 173, so type 173G and press return, then type an x over the # to delete it. The same must be done with line 513 of the file - type 513G and press return, then type an x over the # to delete it. The last command just enabled a file named nf, and we now need to edit it: In Terminal, enter: Now we’ll save these two final changes and quit the editor by typing ZZ. In this configuration file, we need to uncomment line 16. Type 16G and press return, then type an x over the # to delete it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |