Mac computer Server configuration process, whether it is personal learning, or company testing is very practical, streamlined, easy to understand, for Mac computers to do the server to make network data requests for testing.
First step: Navigate to the Apache2 directory
$ cd/etc/apache2/
Step Two: Create a new Sites folder in the Finder and open read and write permissions.
Step three: Show directory list
$ ls
Fourth step: Open the Vim Editor with Administrator privileges and enter the Httpd.con server configuration file, enter the power-on password
$ sudo vim httpd.conf
Fifth step: Find the server default root path, VIM editor input
/documentroot
Sixth step: Navigate to DocumentRoot "/library/webserver/documents" This line dot keyboard I appear-insert-(edit modify)
Seventh Step: Add the # Comment before the two lines
DocumentRoot "/library/webserver/documents" This is the server of the raw computer.
<directory "/library/webserver/documents" >
Eighth step: Click ESC to exit Edit mode
#DocumentRoot "/library/webserver/documents"
#<directory "/library/webserver/documents" >
The cursor locates both lines, copying the two lines
Shift + V To select the row, then press Y to copy the selected line, p to paste the selected row
Nineth step: Find the copied line note Drag the server folder in your Mac to replace the previous two paths
#DocumentRoot "/library/webserver/documents"
DocumentRoot "/users/apple/sites"
#<directory "/library/webserver/documents" >
<directory "/users/apple/sites" >>
Tenth step: Press ESC to exit edit mode to find PHP
/php
Find to PHP Press I edit delete previous comment # ESC exit, open comment means mac support PHP code
#LoadModulephp5_module libexec/apache2/libphp5.so
11th Step: Find Options Follow
/optionsfollow
Navigate to Options Followsymlinksmultiviews
Press I to edit
Add Indexes after the options
Press ESC to exit edit
12th step: Click: Wq Save Exit
13th step: $ sudo apachectl-k restart (restart server)
Appears: HTTPd not running, trying to start represents server startup success
Tenth step: In the browser input 127.0.0.1 or localhost appears below the description service is already well-equipped
Index of/
Name Last modified Size Des Cription
Mac Computer Configuration Apache Server detailed description