MAC 10.10 Apache Server Configuration

Source: Internet
Author: User

The Apache server comes with your Mac, and if you need to use the Apache server on your Mac, you only need to configure and start the server.

The Apache version that comes with Mac 10.10 is 2.4

The Apache version that comes with Mac 10.9 is 2.2

1. Start the server

Open terminal and enter sudo apachectl start.

After booting, enter http://localhost in the browser to see "It works!"

Common commands:

Start server: sudo apachectl start

Shutdown server: sudo apachectl stop

Restart server: sudo apachectl restart

2. Configure Personal Sites

The Apache configuration file that comes with Mac is placed in the/etc/apache2/directory

    • Open/etc/apache2/httpd.conf, find the following lines, remove the opening #
LoadModule Userdir_module libexec/apache2/mod_userdir.soinclude/private/etc/apache2/extra/httpd-userdir.conf
    • Open the/etc/apache2/extra/httpd-userdir.conf, find the following, and remove the # number from the beginning
Include/private/etc/apache2/users/*.conf
    • Under the/etc/apache2/users folder, create a Fengquan. conf profile (what your user name is, and what the red part says). Write the following in the file: ( Fengquanbelow, change your username)
<"/users/fengquan/sites/">    Options Indexes multiviews    AllowOverride None    require all granted</Directory>
    • Create a ~/sites folder and create a index.html under the folder, and write something in it.
    • Restart the Apache server. sudo apachectl restart

3. Support PHP

Open the/etc/apache2/httpd.conf, find the following, remove the previous # number

LoadModule Php5_module libexec/apache2/libphp5.so

Restarting the server

4. Permissions issues

Mac 10.9, apache2.2, control permissions are used

<"/users/fengquan/sites/">    Options Indexes multiviews    allowoverride None    Order allow,deny    allow from all</Directory>

Mac 10.10, apache2.4, CONTROL permission changed to

<"/users/fengquan/sites/">    Options Indexes multiviews    allowoverride None    require all granted</Directory>

Enjoy yourself!

MAC 10.10 Apache Server Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.